mirror of
https://github.com/zoriya/Kyoo.git
synced 2025-07-09 03:04:20 -04:00
Add react native translation
This commit is contained in:
parent
5b78146db9
commit
869c1fbe51
@ -25,6 +25,26 @@ import { NavbarTitle } from "@kyoo/ui";
|
|||||||
import { useState } from "react";
|
import { useState } from "react";
|
||||||
import { QueryClientProvider } from "@tanstack/react-query";
|
import { QueryClientProvider } from "@tanstack/react-query";
|
||||||
import { createQueryClient } from "@kyoo/models";
|
import { createQueryClient } from "@kyoo/models";
|
||||||
|
import i18next from "i18next";
|
||||||
|
import { initReactI18next } from "react-i18next";
|
||||||
|
import { getLocales } from "expo-localization";
|
||||||
|
import "intl-pluralrules";
|
||||||
|
|
||||||
|
// TODO: use a backend to load jsons.
|
||||||
|
import en from "../../../translations/en.json";
|
||||||
|
import fr from "../../../translations/fr.json";
|
||||||
|
|
||||||
|
i18next.use(initReactI18next).init({
|
||||||
|
interpolation: {
|
||||||
|
escapeValue: false,
|
||||||
|
},
|
||||||
|
fallbackLng: "en",
|
||||||
|
lng: getLocales()[0].languageCode,
|
||||||
|
resources: {
|
||||||
|
en: { translation: en },
|
||||||
|
fr: { translation: fr },
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
const ThemedStack = () => {
|
const ThemedStack = () => {
|
||||||
const theme = useTheme();
|
const theme = useTheme();
|
||||||
|
@ -15,9 +15,11 @@
|
|||||||
"expo-constants": "~14.0.2",
|
"expo-constants": "~14.0.2",
|
||||||
"expo-linear-gradient": "~12.0.1",
|
"expo-linear-gradient": "~12.0.1",
|
||||||
"expo-linking": "~3.2.3",
|
"expo-linking": "~3.2.3",
|
||||||
|
"expo-localization": "~14.0.0",
|
||||||
"expo-router": "^0.0.36",
|
"expo-router": "^0.0.36",
|
||||||
"expo-status-bar": "~1.4.2",
|
"expo-status-bar": "~1.4.2",
|
||||||
"i18next": "^22.0.6",
|
"i18next": "^22.0.6",
|
||||||
|
"intl-pluralrules": "^1.3.1",
|
||||||
"moti": "^0.21.0",
|
"moti": "^0.21.0",
|
||||||
"react": "18.1.0",
|
"react": "18.1.0",
|
||||||
"react-dom": "18.1.0",
|
"react-dom": "18.1.0",
|
||||||
|
@ -33,7 +33,6 @@ export const withTranslations = (
|
|||||||
) => {
|
) => {
|
||||||
const i18n = i18next.createInstance();
|
const i18n = i18next.createInstance();
|
||||||
const commonOptions: InitOptions = {
|
const commonOptions: InitOptions = {
|
||||||
debug: true,
|
|
||||||
interpolation: {
|
interpolation: {
|
||||||
escapeValue: false,
|
escapeValue: false,
|
||||||
},
|
},
|
||||||
|
@ -6354,6 +6354,17 @@ __metadata:
|
|||||||
languageName: node
|
languageName: node
|
||||||
linkType: hard
|
linkType: hard
|
||||||
|
|
||||||
|
"expo-localization@npm:~14.0.0":
|
||||||
|
version: 14.0.0
|
||||||
|
resolution: "expo-localization@npm:14.0.0"
|
||||||
|
dependencies:
|
||||||
|
rtl-detect: ^1.0.2
|
||||||
|
peerDependencies:
|
||||||
|
expo: "*"
|
||||||
|
checksum: b1107fec3ce98386b21a1ed3adad279559cc24d07403ff32e4253e337f1018a115b265d471f374f76515c3ca6b0b73e132eff7783f51bd248908da3ca3c269a6
|
||||||
|
languageName: node
|
||||||
|
linkType: hard
|
||||||
|
|
||||||
"expo-modules-autolinking@npm:*, expo-modules-autolinking@npm:1.0.0":
|
"expo-modules-autolinking@npm:*, expo-modules-autolinking@npm:1.0.0":
|
||||||
version: 1.0.0
|
version: 1.0.0
|
||||||
resolution: "expo-modules-autolinking@npm:1.0.0"
|
resolution: "expo-modules-autolinking@npm:1.0.0"
|
||||||
@ -7615,6 +7626,13 @@ __metadata:
|
|||||||
languageName: node
|
languageName: node
|
||||||
linkType: hard
|
linkType: hard
|
||||||
|
|
||||||
|
"intl-pluralrules@npm:^1.3.1":
|
||||||
|
version: 1.3.1
|
||||||
|
resolution: "intl-pluralrules@npm:1.3.1"
|
||||||
|
checksum: b22c2373b6b658e5a361d9d1e9a3d4478862a79a9723b910d29745ff6b5b78d8e1e10c47f344bd3835219b77d2f6cfd58388c1bab3b5daf4df72555e02342b40
|
||||||
|
languageName: node
|
||||||
|
linkType: hard
|
||||||
|
|
||||||
"invariant@npm:^2.2.4":
|
"invariant@npm:^2.2.4":
|
||||||
version: 2.2.4
|
version: 2.2.4
|
||||||
resolution: "invariant@npm:2.2.4"
|
resolution: "invariant@npm:2.2.4"
|
||||||
@ -9625,9 +9643,11 @@ __metadata:
|
|||||||
expo-constants: ~14.0.2
|
expo-constants: ~14.0.2
|
||||||
expo-linear-gradient: ~12.0.1
|
expo-linear-gradient: ~12.0.1
|
||||||
expo-linking: ~3.2.3
|
expo-linking: ~3.2.3
|
||||||
|
expo-localization: ~14.0.0
|
||||||
expo-router: ^0.0.36
|
expo-router: ^0.0.36
|
||||||
expo-status-bar: ~1.4.2
|
expo-status-bar: ~1.4.2
|
||||||
i18next: ^22.0.6
|
i18next: ^22.0.6
|
||||||
|
intl-pluralrules: ^1.3.1
|
||||||
moti: ^0.21.0
|
moti: ^0.21.0
|
||||||
react: 18.1.0
|
react: 18.1.0
|
||||||
react-dom: 18.1.0
|
react-dom: 18.1.0
|
||||||
@ -11527,6 +11547,13 @@ __metadata:
|
|||||||
languageName: node
|
languageName: node
|
||||||
linkType: hard
|
linkType: hard
|
||||||
|
|
||||||
|
"rtl-detect@npm:^1.0.2":
|
||||||
|
version: 1.0.4
|
||||||
|
resolution: "rtl-detect@npm:1.0.4"
|
||||||
|
checksum: d562535baa0db62f57f0a1d4676297bff72fd6b94e88f0f0900d5c3e810ab512c5c4cadffd3e05fbe8d9c74310c919afa3ea8c1001c244e5555e8eef12d02d6f
|
||||||
|
languageName: node
|
||||||
|
linkType: hard
|
||||||
|
|
||||||
"run-parallel@npm:^1.1.9":
|
"run-parallel@npm:^1.1.9":
|
||||||
version: 1.2.0
|
version: 1.2.0
|
||||||
resolution: "run-parallel@npm:1.2.0"
|
resolution: "run-parallel@npm:1.2.0"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user