From a0995c6f8024ef8b15601d98c6d22e8af55053c2 Mon Sep 17 00:00:00 2001 From: Ayaka Mikazuki Date: Wed, 22 Mar 2023 16:15:11 +0930 Subject: [PATCH] Fix nb-NO translation --- public/locales/{nb-NO => nb}/about.json | 0 public/locales/{nb-NO => nb}/api.json | 0 public/locales/{nb-NO => nb}/main.json | 0 public/locales/{nb-NO => nb}/model.json | 0 src/i18n.ts | 6 ++++-- 5 files changed, 4 insertions(+), 2 deletions(-) rename public/locales/{nb-NO => nb}/about.json (100%) rename public/locales/{nb-NO => nb}/api.json (100%) rename public/locales/{nb-NO => nb}/main.json (100%) rename public/locales/{nb-NO => nb}/model.json (100%) diff --git a/public/locales/nb-NO/about.json b/public/locales/nb/about.json similarity index 100% rename from public/locales/nb-NO/about.json rename to public/locales/nb/about.json diff --git a/public/locales/nb-NO/api.json b/public/locales/nb/api.json similarity index 100% rename from public/locales/nb-NO/api.json rename to public/locales/nb/api.json diff --git a/public/locales/nb-NO/main.json b/public/locales/nb/main.json similarity index 100% rename from public/locales/nb-NO/main.json rename to public/locales/nb/main.json diff --git a/public/locales/nb-NO/model.json b/public/locales/nb/model.json similarity index 100% rename from public/locales/nb-NO/model.json rename to public/locales/nb/model.json diff --git a/src/i18n.ts b/src/i18n.ts index c032fda..ad20970 100644 --- a/src/i18n.ts +++ b/src/i18n.ts @@ -4,14 +4,16 @@ import { initReactI18next } from 'react-i18next'; import Backend from 'i18next-http-backend'; import LanguageDetector from 'i18next-browser-languagedetector'; -export const i18nLanguages = ['da', 'en', 'nb-NO', 'zh-CN', 'zh-HK', 'zh-TW']; +export const i18nLanguages = ['da', 'en', 'nb', 'zh-CN', 'zh-HK', 'zh-TW']; i18n .use(Backend) .use(LanguageDetector) .use(initReactI18next) .init({ - fallbackLng: 'en', + fallbackLng: { + default: ['en'], + }, ns: ['main', 'api', 'about', 'model'], defaultNS: 'main', });