2012b0bab9
- Added default_language field to general settings state in SettingsPage - Replaced LanguageSelector component with simple select dropdown on settings page - Fixed public settings endpoint to read general_default_language from database - Language setting now properly saved when clicking Save Settings button - Setting is correctly used by gallery login page and legal pages 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
36 lines
782 B
TypeScript
36 lines
782 B
TypeScript
import i18n from 'i18next';
|
|
import { initReactI18next } from 'react-i18next';
|
|
import LanguageDetector from 'i18next-browser-languagedetector';
|
|
import HttpBackend from 'i18next-http-backend';
|
|
|
|
import enTranslations from './locales/en.json';
|
|
import deTranslations from './locales/de.json';
|
|
|
|
i18n
|
|
.use(HttpBackend)
|
|
.use(LanguageDetector)
|
|
.use(initReactI18next)
|
|
.init({
|
|
fallbackLng: 'en',
|
|
debug: false,
|
|
|
|
resources: {
|
|
en: {
|
|
translation: enTranslations,
|
|
},
|
|
de: {
|
|
translation: deTranslations,
|
|
},
|
|
},
|
|
|
|
interpolation: {
|
|
escapeValue: false,
|
|
},
|
|
|
|
detection: {
|
|
order: ['localStorage', 'cookie', 'navigator', 'htmlTag'],
|
|
caches: ['localStorage', 'cookie'],
|
|
},
|
|
});
|
|
|
|
export default i18n; |