@regardio/js 0.7.1 → 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 +48 -48
- package/package.json +8 -8
package/dist/intl/index.d.mts
CHANGED
|
@@ -3,52 +3,52 @@ import { Cookie, SessionStorage } from "react-router";
|
|
|
3
3
|
//#region src/intl/language-detector.d.ts
|
|
4
4
|
interface LanguageDetectorOption {
|
|
5
5
|
/**
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
supportedLanguages: string[];
|
|
6
|
+
* If you want to use a cookie to store the user preferred language, you can
|
|
7
|
+
* pass the Cookie object here.
|
|
8
|
+
*/
|
|
9
|
+
cookie?: Cookie;
|
|
11
10
|
/**
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
11
|
+
* Define the fallback language that it's going to be used in the case user
|
|
12
|
+
* expected language is not supported.
|
|
13
|
+
* This should be be same as the fallbackLng in the i18next options.
|
|
14
|
+
*/
|
|
16
15
|
fallbackLanguage: string;
|
|
17
16
|
/**
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
cookie
|
|
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.
|
|
25
|
+
*/
|
|
26
|
+
order?: Array<"urlPath" | "searchParams" | "cookie" | "session" | "header">;
|
|
22
27
|
/**
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
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"
|
|
32
|
+
*/
|
|
33
|
+
searchParamKey?: string;
|
|
28
34
|
/**
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
35
|
+
* If defined a sessionStorage and want to change the default key used to
|
|
36
|
+
* store the user preferred language, you can pass the key here.
|
|
37
|
+
* @default "lng"
|
|
38
|
+
*/
|
|
33
39
|
sessionKey?: string;
|
|
34
40
|
/**
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
searchParamKey?: string;
|
|
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.
|
|
44
|
+
*/
|
|
45
|
+
sessionStorage?: SessionStorage;
|
|
41
46
|
/**
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
* - searchParams
|
|
48
|
-
* - header
|
|
49
|
-
* And finally the fallback language.
|
|
50
|
-
*/
|
|
51
|
-
order?: Array<"urlPath" | "searchParams" | "cookie" | "session" | "header">;
|
|
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
|
+
*/
|
|
51
|
+
supportedLanguages: string[];
|
|
52
52
|
}
|
|
53
53
|
interface LanguageDetectorLinguiOptions {
|
|
54
54
|
detection: LanguageDetectorOption;
|
|
@@ -58,16 +58,16 @@ declare class LanguageDetectorLingui {
|
|
|
58
58
|
private options;
|
|
59
59
|
constructor(options: LanguageDetectorLinguiOptions);
|
|
60
60
|
/**
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
61
|
+
* Detect the current locale by following the order defined in the
|
|
62
|
+
* `detection.order` option.
|
|
63
|
+
* By default the order is
|
|
64
|
+
* - urlPath (first segment like /de/ or /en/)
|
|
65
|
+
* - cookie
|
|
66
|
+
* - session
|
|
67
|
+
* - searchParams
|
|
68
|
+
* - header
|
|
69
|
+
* And finally the fallback language.
|
|
70
|
+
*/
|
|
71
71
|
getLocale(request: Request): Promise<string>;
|
|
72
72
|
}
|
|
73
73
|
/**
|
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": [
|
|
@@ -77,16 +77,16 @@
|
|
|
77
77
|
},
|
|
78
78
|
"dependencies": {
|
|
79
79
|
"intl-parse-accept-language": "1.0.0",
|
|
80
|
-
"react-router": "7.
|
|
80
|
+
"react-router": "7.13.0"
|
|
81
81
|
},
|
|
82
82
|
"devDependencies": {
|
|
83
|
-
"@regardio/dev": "1.
|
|
83
|
+
"@regardio/dev": "1.13.5",
|
|
84
84
|
"@total-typescript/ts-reset": "0.6.1",
|
|
85
|
-
"@types/node": "25.
|
|
86
|
-
"@vitest/coverage-v8": "4.0.
|
|
87
|
-
"@vitest/ui": "4.0.
|
|
88
|
-
"tsdown": "0.20.
|
|
89
|
-
"vitest": "4.0.
|
|
85
|
+
"@types/node": "25.2.3",
|
|
86
|
+
"@vitest/coverage-v8": "4.0.18",
|
|
87
|
+
"@vitest/ui": "4.0.18",
|
|
88
|
+
"tsdown": "0.20.3",
|
|
89
|
+
"vitest": "4.0.18"
|
|
90
90
|
},
|
|
91
91
|
"publishConfig": {
|
|
92
92
|
"access": "public"
|