@regardio/js 0.7.2 → 0.7.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/intl/index.d.mts +25 -25
- package/package.json +4 -4
package/dist/intl/index.d.mts
CHANGED
|
@@ -3,11 +3,10 @@ import { Cookie, SessionStorage } from "react-router";
|
|
|
3
3
|
//#region src/intl/language-detector.d.ts
|
|
4
4
|
interface LanguageDetectorOption {
|
|
5
5
|
/**
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
* This should be be same as the supportedLngs in the i18next options.
|
|
6
|
+
* If you want to use a cookie to store the user preferred language, you can
|
|
7
|
+
* pass the Cookie object here.
|
|
9
8
|
*/
|
|
10
|
-
|
|
9
|
+
cookie?: Cookie;
|
|
11
10
|
/**
|
|
12
11
|
* Define the fallback language that it's going to be used in the case user
|
|
13
12
|
* expected language is not supported.
|
|
@@ -15,16 +14,23 @@ interface LanguageDetectorOption {
|
|
|
15
14
|
*/
|
|
16
15
|
fallbackLanguage: string;
|
|
17
16
|
/**
|
|
18
|
-
*
|
|
19
|
-
*
|
|
17
|
+
* The order the library will use to detect the user preferred language.
|
|
18
|
+
* By default the order is
|
|
19
|
+
* - urlPath (first segment like /de/ or /en/)
|
|
20
|
+
* - cookie
|
|
21
|
+
* - session
|
|
22
|
+
* - searchParams
|
|
23
|
+
* - header
|
|
24
|
+
* And finally the fallback language.
|
|
20
25
|
*/
|
|
21
|
-
|
|
26
|
+
order?: Array<"urlPath" | "searchParams" | "cookie" | "session" | "header">;
|
|
22
27
|
/**
|
|
23
|
-
* If you want to use
|
|
24
|
-
*
|
|
25
|
-
*
|
|
28
|
+
* If you want to use search parameters for language detection and want to
|
|
29
|
+
* change the default key used to for the parameter name,
|
|
30
|
+
* you can pass the key here.
|
|
31
|
+
* @default "lng"
|
|
26
32
|
*/
|
|
27
|
-
|
|
33
|
+
searchParamKey?: string;
|
|
28
34
|
/**
|
|
29
35
|
* If defined a sessionStorage and want to change the default key used to
|
|
30
36
|
* store the user preferred language, you can pass the key here.
|
|
@@ -32,23 +38,17 @@ interface LanguageDetectorOption {
|
|
|
32
38
|
*/
|
|
33
39
|
sessionKey?: string;
|
|
34
40
|
/**
|
|
35
|
-
* If you want to use
|
|
36
|
-
*
|
|
37
|
-
*
|
|
38
|
-
* @default "lng"
|
|
41
|
+
* If you want to use a session to store the user preferred language, you can
|
|
42
|
+
* pass the SessionStorage object here.
|
|
43
|
+
* When this is not defined, getting the locale will ignore the session.
|
|
39
44
|
*/
|
|
40
|
-
|
|
45
|
+
sessionStorage?: SessionStorage;
|
|
41
46
|
/**
|
|
42
|
-
*
|
|
43
|
-
*
|
|
44
|
-
*
|
|
45
|
-
* - cookie
|
|
46
|
-
* - session
|
|
47
|
-
* - searchParams
|
|
48
|
-
* - header
|
|
49
|
-
* And finally the fallback language.
|
|
47
|
+
* Define the list of supported languages, this is used to determine if one of
|
|
48
|
+
* the languages requested by the user is supported by the application.
|
|
49
|
+
* This should be be same as the supportedLngs in the i18next options.
|
|
50
50
|
*/
|
|
51
|
-
|
|
51
|
+
supportedLanguages: string[];
|
|
52
52
|
}
|
|
53
53
|
interface LanguageDetectorLinguiOptions {
|
|
54
54
|
detection: LanguageDetectorOption;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://www.schemastore.org/package.json",
|
|
3
3
|
"name": "@regardio/js",
|
|
4
|
-
"version": "0.7.
|
|
4
|
+
"version": "0.7.3",
|
|
5
5
|
"private": false,
|
|
6
6
|
"description": "Regardio JavaScript utilities",
|
|
7
7
|
"keywords": [
|
|
@@ -80,12 +80,12 @@
|
|
|
80
80
|
"react-router": "7.13.0"
|
|
81
81
|
},
|
|
82
82
|
"devDependencies": {
|
|
83
|
-
"@regardio/dev": "1.13.
|
|
83
|
+
"@regardio/dev": "1.13.5",
|
|
84
84
|
"@total-typescript/ts-reset": "0.6.1",
|
|
85
|
-
"@types/node": "25.
|
|
85
|
+
"@types/node": "25.2.3",
|
|
86
86
|
"@vitest/coverage-v8": "4.0.18",
|
|
87
87
|
"@vitest/ui": "4.0.18",
|
|
88
|
-
"tsdown": "0.20.
|
|
88
|
+
"tsdown": "0.20.3",
|
|
89
89
|
"vitest": "4.0.18"
|
|
90
90
|
},
|
|
91
91
|
"publishConfig": {
|