Merge pull request #443 from mawoka-myblock/frontend-dependency-update

This commit is contained in:
Marlon
2025-09-21 12:43:14 +02:00
committed by GitHub
164 changed files with 7848 additions and 5241 deletions
+3 -2
View File
@@ -45,7 +45,7 @@ export class I18nService {
initialize(): void {
this.i18n.use(LanguageDetector).init({
// lng: INITIAL_LANGUAGE,
compatibilityJSON: 'v3',
compatibilityJSON: 'v4',
fallbackLng: 'en',
debug: false,
defaultNS: 'translation',
@@ -61,7 +61,8 @@ export class I18nService {
detection: {
order: ['querystring', 'cookie', 'localStorage', 'navigator'],
lookupQuerystring: 'lng',
lookupLocalStorage: 'language'
lookupLocalStorage: 'language',
lookupSessionStorage: true
}
});
this.i18n.addResourceBundle('en', 'translation', en);
+7 -3
View File
@@ -22,15 +22,19 @@ export const getLocalization = () => {
return getContext<I18nContext>(CONTEXT_KEY);
};
export const initLocalizationContext = () => {
export const initLocalizationContext = (start_lanugage: string): { i18n: I18nService } => {
// Initialize our services
const i18n = new I18nService();
const tranlator = new I18NextTranslationService(i18n);
let locale: any;
if (start_lanugage) {
locale = start_lanugage;
}
tranlator.locale.set(locale);
// skipcq: JS-0357
setLocalization({
t: tranlator.translate,
currentLanguage: tranlator.locale
currentLanguage: locale
});
return {