🐛 Changed JSON-format for translation

This commit is contained in:
Mawoka
2022-06-17 18:24:43 +02:00
parent 4b24c3b5be
commit 3f9d136c97
+4
View File
@@ -4,6 +4,7 @@ import en from './locales/en.json';
import de from './locales/de.json'; import de from './locales/de.json';
import fr from './locales/fr.json'; import fr from './locales/fr.json';
import tr from './locales/tr.json'; import tr from './locales/tr.json';
import id from './locales/id.json';
import LanguageDetector from 'i18next-browser-languagedetector'; import LanguageDetector from 'i18next-browser-languagedetector';
import type { i18n, Resource } from 'i18next'; import type { i18n, Resource } from 'i18next';
@@ -28,6 +29,7 @@ export class I18nService {
initialize(): void { initialize(): void {
this.i18n.use(LanguageDetector).init({ this.i18n.use(LanguageDetector).init({
// lng: INITIAL_LANGUAGE, // lng: INITIAL_LANGUAGE,
compatibilityJSON: 'v3',
fallbackLng: 'en', fallbackLng: 'en',
debug: false, debug: false,
defaultNS: 'translation', defaultNS: 'translation',
@@ -36,6 +38,7 @@ export class I18nService {
escapeValue: false escapeValue: false
}, },
returnEmptyString: false, returnEmptyString: false,
simplifyPluralSuffix: true,
// detection: { // detection: {
// order: ['browser', 'querystring', 'navigator', 'localStorage', 'htmlTag'], // order: ['browser', 'querystring', 'navigator', 'localStorage', 'htmlTag'],
// lookupQuerystring: 'lng' // lookupQuerystring: 'lng'
@@ -50,6 +53,7 @@ export class I18nService {
this.i18n.addResourceBundle('de', 'translation', de); this.i18n.addResourceBundle('de', 'translation', de);
this.i18n.addResourceBundle('fr', 'translation', fr); this.i18n.addResourceBundle('fr', 'translation', fr);
this.i18n.addResourceBundle('tr', 'translation', tr); this.i18n.addResourceBundle('tr', 'translation', tr);
this.i18n.addResourceBundle('id', 'translation', id);
} }
changeLanguage(language: string): void { changeLanguage(language: string): void {