@ichaingo/i18n 1.1.0
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/README.md +11 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +13 -0
- package/dist/lib/i18n.d.ts +2 -0
- package/dist/lib/i18n.d.ts.map +1 -0
- package/dist/middleware.d.ts +2 -0
- package/dist/middleware.d.ts.map +1 -0
- package/dist/middleware.js +9 -0
- package/dist/navigation.d.ts +313 -0
- package/dist/navigation.d.ts.map +1 -0
- package/dist/navigation.js +10 -0
- package/dist/redirectWithLanguage.d.ts +6 -0
- package/dist/redirectWithLanguage.d.ts.map +1 -0
- package/dist/redirectWithLanguage.js +4008 -0
- package/dist/request.d.ts +3 -0
- package/dist/request.d.ts.map +1 -0
- package/dist/request.js +13 -0
- package/dist/routing.d.ts +19 -0
- package/dist/routing.d.ts.map +1 -0
- package/dist/routing.js +12 -0
- package/package.json +49 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"request.d.ts","sourceRoot":"","sources":["../src/request.ts"],"names":[],"mappings":";AAIA,wBAWG"}
|
package/dist/request.js
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { getRequestConfig as a } from "next-intl/server";
|
|
2
|
+
import { hasLocale as r } from "next-intl";
|
|
3
|
+
import { routing as o } from "./routing.js";
|
|
4
|
+
const i = a(async ({ requestLocale: s }) => {
|
|
5
|
+
const e = await s, t = r(o.locales, e) ? e : o.defaultLocale;
|
|
6
|
+
return {
|
|
7
|
+
locale: t,
|
|
8
|
+
messages: (await import(`/messages/${t}.json`)).default
|
|
9
|
+
};
|
|
10
|
+
});
|
|
11
|
+
export {
|
|
12
|
+
i as default
|
|
13
|
+
};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export declare const routing: {
|
|
2
|
+
locales: readonly ["en", "zh-hans", "zh-hant", "ko", "ja"];
|
|
3
|
+
defaultLocale: "en" | "zh-hans" | "zh-hant" | "ko" | "ja";
|
|
4
|
+
localePrefix?: import('next-intl/routing').LocalePrefix<readonly ["en", "zh-hans", "zh-hant", "ko", "ja"], "always"> | undefined;
|
|
5
|
+
domains?: undefined;
|
|
6
|
+
localeCookie?: boolean | {
|
|
7
|
+
maxAge?: number | undefined | undefined;
|
|
8
|
+
priority?: "low" | "medium" | "high" | undefined | undefined;
|
|
9
|
+
domain?: string | undefined | undefined;
|
|
10
|
+
path?: string | undefined | undefined;
|
|
11
|
+
secure?: boolean | undefined | undefined;
|
|
12
|
+
sameSite?: true | false | "lax" | "strict" | "none" | undefined | undefined;
|
|
13
|
+
partitioned?: boolean | undefined | undefined;
|
|
14
|
+
name?: string | undefined;
|
|
15
|
+
};
|
|
16
|
+
alternateLinks?: boolean;
|
|
17
|
+
localeDetection?: boolean;
|
|
18
|
+
};
|
|
19
|
+
//# sourceMappingURL=routing.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"routing.d.ts","sourceRoot":"","sources":["../src/routing.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,OAAO;;;;;;;;;;;;;;;;;CAQlB,CAAC"}
|
package/dist/routing.js
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { defineRouting as e } from "next-intl/routing";
|
|
2
|
+
const n = e({
|
|
3
|
+
// A list of all locales that are supported
|
|
4
|
+
locales: ["en", "zh-hans", "zh-hant", "ko", "ja"],
|
|
5
|
+
// Used when no locale matches
|
|
6
|
+
defaultLocale: "en",
|
|
7
|
+
localePrefix: "always",
|
|
8
|
+
alternateLinks: !0
|
|
9
|
+
});
|
|
10
|
+
export {
|
|
11
|
+
n as routing
|
|
12
|
+
};
|
package/package.json
ADDED
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@ichaingo/i18n",
|
|
3
|
+
"version": "1.1.0",
|
|
4
|
+
"type": "module",
|
|
5
|
+
"main": "./dist/index.js",
|
|
6
|
+
"module": "./dist/index.js",
|
|
7
|
+
"types": "./dist/index.d.ts",
|
|
8
|
+
"exports": {
|
|
9
|
+
"./package.json": "./package.json",
|
|
10
|
+
".": {
|
|
11
|
+
"types": "./dist/index.d.ts",
|
|
12
|
+
"import": "./dist/index.js",
|
|
13
|
+
"default": "./dist/index.js"
|
|
14
|
+
},
|
|
15
|
+
"./navigation": {
|
|
16
|
+
"types": "./dist/navigation.d.ts",
|
|
17
|
+
"import": "./dist/navigation.js",
|
|
18
|
+
"default": "./dist/navigation.js"
|
|
19
|
+
},
|
|
20
|
+
"./routing": {
|
|
21
|
+
"types": "./dist/routing.d.ts",
|
|
22
|
+
"import": "./dist/routing.js",
|
|
23
|
+
"default": "./dist/routing.js"
|
|
24
|
+
},
|
|
25
|
+
"./request": {
|
|
26
|
+
"types": "./dist/request.d.ts",
|
|
27
|
+
"import": "./dist/request.js",
|
|
28
|
+
"default": "./dist/request.js"
|
|
29
|
+
},
|
|
30
|
+
"./middleware": {
|
|
31
|
+
"types": "./dist/middleware.d.ts",
|
|
32
|
+
"import": "./dist/middleware.js",
|
|
33
|
+
"default": "./dist/middleware.js"
|
|
34
|
+
},
|
|
35
|
+
"./redirectWithLanguage": {
|
|
36
|
+
"types": "./dist/redirectWithLanguage.d.ts",
|
|
37
|
+
"import": "./dist/redirectWithLanguage.js",
|
|
38
|
+
"default": "./dist/redirectWithLanguage.js"
|
|
39
|
+
}
|
|
40
|
+
},
|
|
41
|
+
"files": [
|
|
42
|
+
"dist",
|
|
43
|
+
"!**/*.tsbuildinfo"
|
|
44
|
+
],
|
|
45
|
+
"peerDependencies": {
|
|
46
|
+
"next-intl": "^4.3.4",
|
|
47
|
+
"next": "^15.1.6"
|
|
48
|
+
}
|
|
49
|
+
}
|