-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathni18n.config.ts
37 lines (35 loc) · 978 Bytes
/
ni18n.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
import ChainedBackend from "i18next-chained-backend"
import HttpBackend from "i18next-http-backend"
import LocalStorageBackend from "i18next-localstorage-backend"
import type { Ni18nOptions } from "ni18n"
const isBrowser = typeof window !== "undefined"
export const ni18nConfig: Ni18nOptions = {
supportedLngs: ["tr", "en", "de"],
fallbackLng: {
dev: ["tr", "en"],
},
react: {
useSuspense: false,
},
ns: ["common", "zod", "components", "dashboard", "settings"],
use: isBrowser ? [ChainedBackend] : undefined,
backend: isBrowser
? {
backends: [LocalStorageBackend, HttpBackend],
backendOptions: [
{
expirationTime: 24 * 60 * 60 * 1000,
defaultVersion: "v1",
versions: {
en: "v2",
tr: "v2",
de: "v2",
},
},
{
loadPath: "/locales/{{lng}}/{{ns}}.json",
},
],
}
: undefined,
}