actually load translations
This commit is contained in:
parent
2b6f54e34e
commit
cb2951808e
2
external/translations
vendored
2
external/translations
vendored
|
@ -1 +1 @@
|
|||
Subproject commit 6282f629c885d4c8e12957d3ab5453c9a52a9a3a
|
||||
Subproject commit 5dc905a2bbf9c82c7a75ffcdc03dd8a8e403eca5
|
|
@ -372,6 +372,9 @@ importers:
|
|||
i18next-browser-languagedetector:
|
||||
specifier: ^7.1.0
|
||||
version: 7.1.0
|
||||
i18next-http-backend:
|
||||
specifier: ^2.2.1
|
||||
version: 2.2.1
|
||||
lib:
|
||||
specifier: workspace:*
|
||||
version: link:../lib
|
||||
|
@ -3301,6 +3304,14 @@ packages:
|
|||
resolution: {integrity: sha512-dcKFX3jn0MpIaXjisoRvexIJVEKzaq7z2rZKxf+MSr9TkdmHmsU4m2lcLojrj/FHl8mk5VxMmYA+ftRkP/3oKQ==}
|
||||
dev: true
|
||||
|
||||
/cross-fetch@3.1.6:
|
||||
resolution: {integrity: sha512-riRvo06crlE8HiqOwIpQhxwdOk4fOeR7FVM/wXoxchFEqMNUjvbs3bfo4OTgMEMHzppd4DxFBDbyySj8Cv781g==}
|
||||
dependencies:
|
||||
node-fetch: 2.6.12
|
||||
transitivePeerDependencies:
|
||||
- encoding
|
||||
dev: false
|
||||
|
||||
/cross-spawn@7.0.3:
|
||||
resolution: {integrity: sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==}
|
||||
engines: {node: '>= 8'}
|
||||
|
@ -4640,6 +4651,14 @@ packages:
|
|||
'@babel/runtime': 7.22.3
|
||||
dev: false
|
||||
|
||||
/i18next-http-backend@2.2.1:
|
||||
resolution: {integrity: sha512-ZXIdn/8NJIBJ0X4hzXfc3STYxKrCKh1fYjji9HPyIpEJfvTvy8/ZlTl8RuTizzCPj2ZcWrfaecyOMKs6bQ7u5A==}
|
||||
dependencies:
|
||||
cross-fetch: 3.1.6
|
||||
transitivePeerDependencies:
|
||||
- encoding
|
||||
dev: false
|
||||
|
||||
/i18next-resources-to-backend@1.1.4:
|
||||
resolution: {integrity: sha512-hMyr9AOmIea17AOaVe1srNxK/l3mbk81P7Uf3fdcjlw3ehZy3UNTd0OP3EEi6yu4J02kf9jzhCcjokz6AFlEOg==}
|
||||
dependencies:
|
||||
|
|
|
@ -17,6 +17,7 @@
|
|||
"eslint-config-next": "13.4.10",
|
||||
"i18next": "^22.5.0",
|
||||
"i18next-browser-languagedetector": "^7.1.0",
|
||||
"i18next-http-backend": "^2.2.1",
|
||||
"lib": "workspace:*",
|
||||
"localforage": "^1.10.0",
|
||||
"next": "13.4.10",
|
||||
|
|
1
web/public/translations
Symbolic link
1
web/public/translations
Symbolic link
|
@ -0,0 +1 @@
|
|||
../../external/translations/
|
|
@ -1,22 +1,21 @@
|
|||
import i18n from "i18next";
|
||||
import { initReactI18next } from "react-i18next";
|
||||
import LanguageDetector from "i18next-browser-languagedetector";
|
||||
import HttpBackend from "i18next-http-backend";
|
||||
|
||||
i18n.use(LanguageDetector)
|
||||
.use(initReactI18next)
|
||||
.use(HttpBackend)
|
||||
.init({
|
||||
debug: true,
|
||||
backend: {
|
||||
loadPath: `/translations/{{ns}}/{{lng}}.json`,
|
||||
},
|
||||
ns: "web",
|
||||
debug: false,
|
||||
fallbackLng: "en",
|
||||
interpolation: {
|
||||
escapeValue: false, // React does this for us
|
||||
},
|
||||
resources: {
|
||||
en: {
|
||||
translation: {
|
||||
deez: "Deez {{amogus}} nuts",
|
||||
},
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
export default i18n;
|
||||
|
|
Loading…
Reference in a new issue