-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathi18n.config.ts
117 lines (108 loc) · 2.26 KB
/
i18n.config.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
import { type LocalePrefix } from "next-intl/routing";
export const locales = [
"en-US", // english
"ar-SA", // arabic
"bn-BD", // bengali
"fr-FR", // french
"hi-IN", // hindi
"ha-NG", // hausa
"ms-MY", // malay
"ps-AF", // pashto
"fa-IR", // persian
"ru-RU", // russian
"so-SO", // somali
"es-ES", // spanish
"tr-TR", // turkish
"ur-PK", // urdu
] as const;
export const defaultLocale = "en-US" as const;
export const pathLocaleToSupportedBcp47LocaleMap = {
en: "en-US",
ar: "ar-SA",
bn: "bn-BD",
fr: "fr-FR",
hi: "hi-IN",
ha: "ha-NG",
ms: "ms-MY",
ps: "ps-AF",
fa: "fa-IR",
ru: "ru-RU",
so: "so-SO",
es: "es-ES",
tr: "tr-TR",
ur: "ur-PK",
} as const;
export const localePrefix = {
mode: "as-needed" as const,
prefixes: {
"en-US": "/en",
"ar-SA": "/ar",
"bn-BD": "/bn",
"fr-FR": "/fr",
"hi-IN": "/hi",
"ha-NG": "/ha",
"ms-MY": "/ms",
"ps-AF": "/ps",
"fa-IR": "/fa",
"ru-RU": "/ru",
"so-SO": "/so",
"es-ES": "/es",
"tr-TR": "/tr",
"ur-PK": "/ur",
},
} satisfies LocalePrefix<typeof locales>;
const config = {
namespaces: [
"common",
"home",
"entities",
"reader",
"meta",
"about",
"team",
"donate",
] as const,
namespacedRoutes: {
"*": ["common", "entities", "meta", "reader"],
"/": ["home"],
"/t/*": ["reader"],
"/about": ["about"],
"/team": ["team"],
"/donate": ["donate"],
// "/chat/*": ["reader"],
},
};
export default config;
export type AppLocale = (typeof locales)[number];
export const localeToFullName: Record<AppLocale, string> = {
"en-US": "English",
"ar-SA": "العربية",
"bn-BD": "বাংলা",
"fr-FR": "Français",
"hi-IN": "हिन्दी",
"ha-NG": "Hausa",
"ms-MY": "Bahasa Melayu",
"ps-AF": "پښتو",
"fa-IR": "فارسی",
"ru-RU": "русский",
"so-SO": "Soomaali",
"es-ES": "Español",
"tr-TR": "Türkçe",
"ur-PK": "اردو",
};
export const localeToDirection: Record<AppLocale, "ltr" | "rtl"> = {
"en-US": "ltr",
"ar-SA": "rtl",
"bn-BD": "ltr",
"fr-FR": "ltr",
"hi-IN": "ltr",
"ha-NG": "ltr",
"ms-MY": "ltr",
"ps-AF": "ltr",
"fa-IR": "rtl",
"ru-RU": "ltr",
"so-SO": "ltr",
"es-ES": "ltr",
"tr-TR": "ltr",
"ur-PK": "rtl",
};