@0xchain/i18n 0.0.1
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 +315 -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 +4699 -0
- package/dist/request.d.ts +3 -0
- package/dist/request.d.ts.map +1 -0
- package/dist/request.js +15 -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 +52 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"request.d.ts","sourceRoot":"","sources":["../src/request.ts"],"names":[],"mappings":";AAMA,wBAYG"}
|
package/dist/request.js
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { getRequestConfig as c } from "next-intl/server";
|
|
2
|
+
import { hasLocale as m } from "next-intl";
|
|
3
|
+
import { routing as s } from "./routing.js";
|
|
4
|
+
import n from "fs";
|
|
5
|
+
import f from "path";
|
|
6
|
+
const g = c(async ({ requestLocale: t }) => {
|
|
7
|
+
const e = await t, o = m(s.locales, e) ? e : s.defaultLocale, r = f.join(process.cwd(), "messages", `${o}.json`), a = JSON.parse(n.readFileSync(r, "utf8"));
|
|
8
|
+
return {
|
|
9
|
+
locale: o,
|
|
10
|
+
messages: a
|
|
11
|
+
};
|
|
12
|
+
});
|
|
13
|
+
export {
|
|
14
|
+
g as default
|
|
15
|
+
};
|
|
@@ -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,52 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@0xchain/i18n",
|
|
3
|
+
"version": "0.0.1",
|
|
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
|
+
"dependencies": {
|
|
46
|
+
"next-intl": "4.6.1",
|
|
47
|
+
"next": "15.5.6"
|
|
48
|
+
},
|
|
49
|
+
"publishConfig": {
|
|
50
|
+
"access": "public"
|
|
51
|
+
}
|
|
52
|
+
}
|