add i18n (#239)
This commit is contained in:
25
src/i18n/index.ts
Normal file
25
src/i18n/index.ts
Normal file
@@ -0,0 +1,25 @@
|
||||
/*
|
||||
* Copyright (C) Contributors to the Suwayomi project
|
||||
*
|
||||
* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
|
||||
|
||||
import { use } from 'i18next';
|
||||
import { initReactI18next } from 'react-i18next';
|
||||
import resources from 'i18n/translations';
|
||||
import LanguageDetector from 'i18next-browser-languagedetector';
|
||||
|
||||
const i18n = use(initReactI18next)
|
||||
.use(LanguageDetector)
|
||||
.init({
|
||||
resources,
|
||||
|
||||
fallbackLng: 'en',
|
||||
interpolation: {
|
||||
escapeValue: false,
|
||||
},
|
||||
debug: true,
|
||||
});
|
||||
|
||||
export default i18n;
|
||||
23
src/i18n/translations.ts
Normal file
23
src/i18n/translations.ts
Normal file
@@ -0,0 +1,23 @@
|
||||
/*
|
||||
* Copyright (C) Contributors to the Suwayomi project
|
||||
*
|
||||
* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
|
||||
|
||||
const resources = {
|
||||
en: {
|
||||
translation: {
|
||||
'DefaultNavBar.navbarItems.Library': 'Library',
|
||||
'screens/Library/Library': 'Library',
|
||||
},
|
||||
},
|
||||
fr: {
|
||||
translation: {
|
||||
'DefaultNavBar.navbarItems.Library': 'fr(Library)',
|
||||
'screens/Library/Library': 'fr(Library)',
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
export default resources;
|
||||
Reference in New Issue
Block a user