diff --git a/package.json b/package.json index 6ab44e78..9700fff6 100644 --- a/package.json +++ b/package.json @@ -33,7 +33,7 @@ "clsx": "1.1.1", "fake-indexeddb": "3.1.7", "firebase": "8.3.3", - "i18next-browser-languagedetector": "6.1.0", + "i18next-browser-languagedetector": "6.1.2", "idb-keyval": "6.0.3", "image-blob-reduce": "3.0.1", "lodash.throttle": "4.1.1", diff --git a/src/excalidraw-app/index.tsx b/src/excalidraw-app/index.tsx index ac0429c8..98c4b64e 100644 --- a/src/excalidraw-app/index.tsx +++ b/src/excalidraw-app/index.tsx @@ -273,7 +273,10 @@ const PlusLinkJSX = ( const ExcalidrawWrapper = () => { const [errorMessage, setErrorMessage] = useState(""); - const currentLangCode = languageDetector.detect() || defaultLang.code; + let currentLangCode = languageDetector.detect() || defaultLang.code; + if (Array.isArray(currentLangCode)) { + currentLangCode = currentLangCode[0]; + } const [langCode, setLangCode] = useState(currentLangCode); // initial state diff --git a/yarn.lock b/yarn.lock index 8b425030..5fb710b1 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1134,6 +1134,13 @@ dependencies: regenerator-runtime "^0.13.4" +"@babel/runtime@^7.14.6": + version "7.16.0" + resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.16.0.tgz#e27b977f2e2088ba24748bf99b5e1dece64e4f0b" + integrity sha512-Nht8L0O8YCktmsDV6FqFue7vQLRx3Hb0B37lS5y0jDRqRxlBG4wIJHnf9/bgSE2UyipKFA01YtS+npRdTWBUyw== + dependencies: + regenerator-runtime "^0.13.4" + "@babel/template@^7.10.4", "@babel/template@^7.12.13", "@babel/template@^7.15.4", "@babel/template@^7.3.3": version "7.15.4" resolved "https://registry.npmjs.org/@babel/template/-/template-7.15.4.tgz" @@ -7664,12 +7671,12 @@ husky@7.0.4: resolved "https://registry.yarnpkg.com/husky/-/husky-7.0.4.tgz#242048245dc49c8fb1bf0cc7cfb98dd722531535" integrity sha512-vbaCKN2QLtP/vD4yvs6iz6hBEo6wkSzs8HpRah1Z6aGmF2KW5PdYuAd7uX5a+OyBZHBhd+TFLqgjUgytQr4RvQ== -i18next-browser-languagedetector@6.1.0: - version "6.1.0" - resolved "https://registry.npmjs.org/i18next-browser-languagedetector/-/i18next-browser-languagedetector-6.1.0.tgz" - integrity sha512-NXbr/qPqkg6VyUwPrzmVOAafqIk1zdjzhYVxZWoSi338XEGmuOeroEglLdR8nJUJcf5BfOSHva80tqCPwXFTFQ== +i18next-browser-languagedetector@6.1.2: + version "6.1.2" + resolved "https://registry.yarnpkg.com/i18next-browser-languagedetector/-/i18next-browser-languagedetector-6.1.2.tgz#68565a28b929cbc98ab6a56826ef2faf0e927ff8" + integrity sha512-YDzIGHhMRvr7M+c8B3EQUKyiMBhfqox4o1qkFvt4QXuu5V2cxf74+NCr+VEkUuU0y+RwcupA238eeolW1Yn80g== dependencies: - "@babel/runtime" "^7.5.5" + "@babel/runtime" "^7.14.6" iconv-lite@0.4.24, iconv-lite@^0.4.24: version "0.4.24"