diff --git a/package.json b/package.json index 53feef34e3..cf8639774f 100644 --- a/package.json +++ b/package.json @@ -89,7 +89,7 @@ "date-fns": "^2.30.0", "downshift": "^3.2.2", "eslint": "^8.57.0", - "i18next": "^23.5.1", + "i18next": "^23.11.2", "jest": "^29.7.0", "jest-environment-jsdom": "^29.7.0", "lerna": "^7.1.4", @@ -103,7 +103,7 @@ "react-device-detect": "^2.2.3", "react-dom": "^18.3.0", "react-helmet-async": "^1.3.0", - "react-i18next": "^13.3.0", + "react-i18next": "^14.1.1", "react-router-dom": "^6.3.0", "sass": "^1.62.0", "sass-loader": "^13.2.2", diff --git a/packages/article-converter/package.json b/packages/article-converter/package.json index 4de1279632..54d35851b6 100644 --- a/packages/article-converter/package.json +++ b/packages/article-converter/package.json @@ -41,7 +41,7 @@ "i18next": ">= 23.0.0", "react": ">= 16.8.0", "react-dom": ">= 16.8.0", - "react-i18next": "^13.3.0", + "react-i18next": "^14.0.0", "react-router-dom": ">= 6.0.0" }, "publishConfig": { diff --git a/packages/button/package.json b/packages/button/package.json index f3477720f4..4c3bc21e91 100644 --- a/packages/button/package.json +++ b/packages/button/package.json @@ -36,7 +36,7 @@ "@emotion/styled": "^11.10.4", "react": ">= 16.8.0", "react-dom": ">= 16.8.0", - "react-i18next": "^13.3.0" + "react-i18next": "^14.0.0" }, "publishConfig": { "access": "public" diff --git a/packages/ndla-accordion/package.json b/packages/ndla-accordion/package.json index a59dccd025..83e6875b5f 100644 --- a/packages/ndla-accordion/package.json +++ b/packages/ndla-accordion/package.json @@ -35,7 +35,7 @@ "@emotion/styled": "^11.10.4", "react": ">= 16.8.0", "react-dom": ">= 16.8.0", - "react-i18next": "^13.3.0" + "react-i18next": "^14.0.0" }, "publishConfig": { "access": "public" diff --git a/packages/ndla-code/package.json b/packages/ndla-code/package.json index c3f1419e17..9c86d29194 100644 --- a/packages/ndla-code/package.json +++ b/packages/ndla-code/package.json @@ -39,7 +39,7 @@ "@emotion/styled": "^11.10.4", "react": ">= 16.8.0", "react-dom": ">= 16.8.0", - "react-i18next": "^13.3.0" + "react-i18next": "^14.0.0" }, "devDependencies": { "@ndla/types-embed": "^4.1.6" diff --git a/packages/ndla-forms/package.json b/packages/ndla-forms/package.json index ea954829e0..36717cc4c0 100644 --- a/packages/ndla-forms/package.json +++ b/packages/ndla-forms/package.json @@ -42,7 +42,7 @@ "@emotion/styled": "^11.10.4", "react": ">= 16.8.0", "react-dom": ">= 16.8.0", - "react-i18next": "^13.3.0" + "react-i18next": "^14.0.0" }, "publishConfig": { "access": "public" diff --git a/packages/ndla-howto/package.json b/packages/ndla-howto/package.json index 2d7748791d..74c6e89717 100644 --- a/packages/ndla-howto/package.json +++ b/packages/ndla-howto/package.json @@ -41,7 +41,7 @@ "i18next": ">= 23.0.0", "react": ">= 16.8.0", "react-dom": ">= 16.8.0", - "react-i18next": ">= 13.0.0", + "react-i18next": ">= 14.0.0", "react-router-dom": ">= 6.0.0" }, "publishConfig": { diff --git a/packages/ndla-image-search/package.json b/packages/ndla-image-search/package.json index 7aa49e76df..7c253cd01d 100644 --- a/packages/ndla-image-search/package.json +++ b/packages/ndla-image-search/package.json @@ -44,7 +44,7 @@ "i18next": ">= 23.0.0", "react": ">= 16.8.0", "react-dom": ">= 16.8.0", - "react-i18next": ">= 13.0.0", + "react-i18next": ">= 14.0.0", "react-router-dom": ">= 6.0.0" }, "publishConfig": { diff --git a/packages/ndla-modal/package.json b/packages/ndla-modal/package.json index 9fb63c3036..90d16c186c 100644 --- a/packages/ndla-modal/package.json +++ b/packages/ndla-modal/package.json @@ -34,7 +34,7 @@ "@emotion/styled": "^11.10.4", "react": ">= 16.8.0", "react-dom": ">= 16.8.0", - "react-i18next": "^13.3.0" + "react-i18next": "^14.0.0" }, "publishConfig": { "access": "public" diff --git a/packages/ndla-notion/package.json b/packages/ndla-notion/package.json index 07c952ca01..5e11a45eeb 100644 --- a/packages/ndla-notion/package.json +++ b/packages/ndla-notion/package.json @@ -34,7 +34,7 @@ "@emotion/react": "^11.10.4", "@emotion/styled": "^11.10.4", "react": ">= 16.8.0", - "react-i18next": "^13.3.0" + "react-i18next": "^14.0.0" }, "publishConfig": { "access": "public" diff --git a/packages/ndla-ui/package.json b/packages/ndla-ui/package.json index e248ccda74..1886ec74ef 100644 --- a/packages/ndla-ui/package.json +++ b/packages/ndla-ui/package.json @@ -54,7 +54,6 @@ "@radix-ui/react-slider": "^1.1.2", "date-fns": "^2.30.0", "html-react-parser": "^5.1.8", - "i18next-browser-languagedetector": "^7.1.0", "lodash.throttle": "^4.1.1", "react-bem-helper": "1.4.1", "react-device-detect": "^2.2.3", @@ -67,7 +66,7 @@ "i18next": "^23.5.1", "react": ">= 16.8.0", "react-dom": ">= 16.8.0", - "react-i18next": "^13.3.0", + "react-i18next": "^14.0.0", "react-router-dom": "> 6.0.0" }, "devDependencies": { diff --git a/packages/ndla-ui/src/i18n/i18n.ts b/packages/ndla-ui/src/i18n/i18n.ts index 5cb14be9cc..31443426f9 100644 --- a/packages/ndla-ui/src/i18n/i18n.ts +++ b/packages/ndla-ui/src/i18n/i18n.ts @@ -7,7 +7,6 @@ */ import i18n from "i18next"; -import LanguageDetector from "i18next-browser-languagedetector"; import { initReactI18next } from "react-i18next"; import messagesEN from "../locale/messages-en"; import messagesNB from "../locale/messages-nb"; @@ -15,18 +14,11 @@ import messagesNN from "../locale/messages-nn"; import messagesSE from "../locale/messages-se"; import messagesSMA from "../locale/messages-sma"; -const DETECTION_OPTIONS = { - order: ["path", "localStorage", "htmlTag"], - caches: ["localStorage"], - lookupLocalStorage: "i18nextLng", -}; - export const supportedTranslationLanguages = ["nb", "nn", "en", "se", "sma"] as const; -const i18nInstance = i18n.use(initReactI18next).use(LanguageDetector); +const i18nInstance = i18n.use(initReactI18next); i18nInstance.init({ compatibilityJSON: "v3", - detection: DETECTION_OPTIONS, fallbackLng: "nb", supportedLngs: supportedTranslationLanguages, resources: { diff --git a/packages/select/package.json b/packages/select/package.json index 2270eaa60e..a12b3ee465 100644 --- a/packages/select/package.json +++ b/packages/select/package.json @@ -34,7 +34,7 @@ "@emotion/react": "^11.10.4", "@emotion/styled": "^11.10.4", "react": ">= 16.8.0", - "react-i18next": "^13.3.0" + "react-i18next": "^14.0.0" }, "publishConfig": { "access": "public" diff --git a/packages/tooltip/package.json b/packages/tooltip/package.json index 9dcc8e7fde..40293c6d65 100644 --- a/packages/tooltip/package.json +++ b/packages/tooltip/package.json @@ -34,7 +34,7 @@ "@emotion/styled": "^11.10.4", "react": ">= 16.8.0", "react-dom": ">= 16.8.0", - "react-i18next": "^13.3.0" + "react-i18next": "^14.0.0" }, "publishConfig": { "access": "public" diff --git a/yarn.lock b/yarn.lock index 952a7e454d..2a7f580744 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1549,12 +1549,12 @@ __metadata: languageName: node linkType: hard -"@babel/runtime@npm:^7.12.0, @babel/runtime@npm:^7.12.5, @babel/runtime@npm:^7.13.10, @babel/runtime@npm:^7.17.8, @babel/runtime@npm:^7.18.3, @babel/runtime@npm:^7.19.4, @babel/runtime@npm:^7.21.0, @babel/runtime@npm:^7.22.5, @babel/runtime@npm:^7.23.2, @babel/runtime@npm:^7.4.5, @babel/runtime@npm:^7.5.5, @babel/runtime@npm:^7.7.6, @babel/runtime@npm:^7.8.4, @babel/runtime@npm:^7.8.7, @babel/runtime@npm:^7.9.2": - version: 7.23.5 - resolution: "@babel/runtime@npm:7.23.5" +"@babel/runtime@npm:^7.12.0, @babel/runtime@npm:^7.12.5, @babel/runtime@npm:^7.13.10, @babel/runtime@npm:^7.17.8, @babel/runtime@npm:^7.18.3, @babel/runtime@npm:^7.21.0, @babel/runtime@npm:^7.23.2, @babel/runtime@npm:^7.23.9, @babel/runtime@npm:^7.4.5, @babel/runtime@npm:^7.5.5, @babel/runtime@npm:^7.7.6, @babel/runtime@npm:^7.8.4, @babel/runtime@npm:^7.8.7, @babel/runtime@npm:^7.9.2": + version: 7.24.4 + resolution: "@babel/runtime@npm:7.24.4" dependencies: regenerator-runtime: "npm:^0.14.0" - checksum: 10c0/ca679cc91bb7e424bc2db87bb58cc3b06ade916b9adb21fbbdc43e54cdaacb3eea201ceba2a0464b11d2eb65b9fe6a6ffcf4d7521fa52994f19be96f1af14788 + checksum: 10c0/785aff96a3aa8ff97f90958e1e8a7b1d47f793b204b47c6455eaadc3f694f48c97cd5c0a921fe3596d818e71f18106610a164fb0f1c71fd68c622a58269d537c languageName: node linkType: hard @@ -2585,7 +2585,7 @@ __metadata: "@emotion/styled": ^11.10.4 react: ">= 16.8.0" react-dom: ">= 16.8.0" - react-i18next: ^13.3.0 + react-i18next: ^14.0.0 languageName: unknown linkType: soft @@ -2604,7 +2604,7 @@ __metadata: i18next: ">= 23.0.0" react: ">= 16.8.0" react-dom: ">= 16.8.0" - react-i18next: ^13.3.0 + react-i18next: ^14.0.0 react-router-dom: ">= 6.0.0" languageName: unknown linkType: soft @@ -2637,7 +2637,7 @@ __metadata: "@emotion/styled": ^11.10.4 react: ">= 16.8.0" react-dom: ">= 16.8.0" - react-i18next: ^13.3.0 + react-i18next: ^14.0.0 languageName: unknown linkType: soft @@ -2669,7 +2669,7 @@ __metadata: "@emotion/styled": ^11.10.4 react: ">= 16.8.0" react-dom: ">= 16.8.0" - react-i18next: ^13.3.0 + react-i18next: ^14.0.0 languageName: unknown linkType: soft @@ -2726,7 +2726,7 @@ __metadata: "@emotion/styled": ^11.10.4 react: ">= 16.8.0" react-dom: ">= 16.8.0" - react-i18next: ^13.3.0 + react-i18next: ^14.0.0 languageName: unknown linkType: soft @@ -2761,7 +2761,7 @@ __metadata: i18next: ">= 23.0.0" react: ">= 16.8.0" react-dom: ">= 16.8.0" - react-i18next: ">= 13.0.0" + react-i18next: ">= 14.0.0" react-router-dom: ">= 6.0.0" languageName: unknown linkType: soft @@ -2797,7 +2797,7 @@ __metadata: i18next: ">= 23.0.0" react: ">= 16.8.0" react-dom: ">= 16.8.0" - react-i18next: ">= 13.0.0" + react-i18next: ">= 14.0.0" react-router-dom: ">= 6.0.0" languageName: unknown linkType: soft @@ -2820,7 +2820,7 @@ __metadata: "@emotion/styled": ^11.10.4 react: ">= 16.8.0" react-dom: ">= 16.8.0" - react-i18next: ^13.3.0 + react-i18next: ^14.0.0 languageName: unknown linkType: soft @@ -2836,7 +2836,7 @@ __metadata: "@emotion/react": ^11.10.4 "@emotion/styled": ^11.10.4 react: ">= 16.8.0" - react-i18next: ^13.3.0 + react-i18next: ^14.0.0 languageName: unknown linkType: soft @@ -2892,7 +2892,7 @@ __metadata: "@emotion/react": ^11.10.4 "@emotion/styled": ^11.10.4 react: ">= 16.8.0" - react-i18next: ^13.3.0 + react-i18next: ^14.0.0 languageName: unknown linkType: soft @@ -2934,7 +2934,7 @@ __metadata: "@emotion/styled": ^11.10.4 react: ">= 16.8.0" react-dom: ">= 16.8.0" - react-i18next: ^13.3.0 + react-i18next: ^14.0.0 languageName: unknown linkType: soft @@ -3016,7 +3016,6 @@ __metadata: css-loader: "npm:^6.7.3" date-fns: "npm:^2.30.0" html-react-parser: "npm:^5.1.8" - i18next-browser-languagedetector: "npm:^7.1.0" lodash.throttle: "npm:^4.1.1" mini-css-extract-plugin: "npm:^2.7.5" react-bem-helper: "npm:1.4.1" @@ -3032,7 +3031,7 @@ __metadata: i18next: ^23.5.1 react: ">= 16.8.0" react-dom: ">= 16.8.0" - react-i18next: ^13.3.0 + react-i18next: ^14.0.0 react-router-dom: "> 6.0.0" languageName: unknown linkType: soft @@ -10771,7 +10770,7 @@ __metadata: date-fns: "npm:^2.30.0" downshift: "npm:^3.2.2" eslint: "npm:^8.57.0" - i18next: "npm:^23.5.1" + i18next: "npm:^23.11.2" jest: "npm:^29.7.0" jest-environment-jsdom: "npm:^29.7.0" lerna: "npm:^7.1.4" @@ -10785,7 +10784,7 @@ __metadata: react-device-detect: "npm:^2.2.3" react-dom: "npm:^18.3.0" react-helmet-async: "npm:^1.3.0" - react-i18next: "npm:^13.3.0" + react-i18next: "npm:^14.1.1" react-router-dom: "npm:^6.3.0" sass: "npm:^1.62.0" sass-loader: "npm:^13.2.2" @@ -11715,21 +11714,12 @@ __metadata: languageName: node linkType: hard -"i18next-browser-languagedetector@npm:^7.1.0": - version: 7.1.0 - resolution: "i18next-browser-languagedetector@npm:7.1.0" - dependencies: - "@babel/runtime": "npm:^7.19.4" - checksum: 10c0/d7cd0ea0ad6047e786de665d67b41cbb0940a2983eb2c53dd85a5d71f88e170550bba8de45728470a2b5f88060bed2c79f330aff9806dd50ef58ade0ec7b8ca3 - languageName: node - linkType: hard - -"i18next@npm:^23.5.1": - version: 23.5.1 - resolution: "i18next@npm:23.5.1" +"i18next@npm:^23.11.2": + version: 23.11.2 + resolution: "i18next@npm:23.11.2" dependencies: - "@babel/runtime": "npm:^7.22.5" - checksum: 10c0/af49c399a90505ae26c1a022d06c4a11c4adcde6524b31c315dcaa43443c85892adef6de934b2af737abbdd2ffa66449d2854f135af8691223a8bb4ffaf6e1af + "@babel/runtime": "npm:^7.23.2" + checksum: 10c0/1d33cc53eaa9e078534f8cf7fb2b79be5ec4314555ad1dafc5a5ff367b79ed1a735e9d17452f7bcc11777344e90613ebcf44ebc823e63c1036a6c26c35db014a languageName: node linkType: hard @@ -16021,11 +16011,11 @@ __metadata: languageName: node linkType: hard -"react-i18next@npm:^13.3.0": - version: 13.3.0 - resolution: "react-i18next@npm:13.3.0" +"react-i18next@npm:^14.1.1": + version: 14.1.1 + resolution: "react-i18next@npm:14.1.1" dependencies: - "@babel/runtime": "npm:^7.22.5" + "@babel/runtime": "npm:^7.23.9" html-parse-stringify: "npm:^3.0.1" peerDependencies: i18next: ">= 23.2.3" @@ -16035,7 +16025,7 @@ __metadata: optional: true react-native: optional: true - checksum: 10c0/8c03ea4432fabb1cb3dc53fa7d04f8197600ada98a2c111ac8adf31baf3d0c23a0c1ee944d65c7c5b45deeabe52f625aed72d1bf2e60571ef6f22fd8e0391c81 + checksum: 10c0/d6da148d5dd1635f57d7a85bdd5c6e1f1404982112358a5efa9f6f47d505a00e4650237d5fc94b4381dcb336c134d500268a7157e06e2b2f0293a2bcd7ec2812 languageName: node linkType: hard