feat(i18n): add internationalization support with English and German translations
- Integrated i18next for language detection and translation management. - Added translation files for English and German languages. - Implemented translation keys for notifications, reminders, and common UI elements. - Updated main application entry point to include i18n initialization. - Styled language selection dropdown in settings. - Enhanced package dependencies to include i18next and react-i18next.
This commit is contained in:
@@ -0,0 +1,30 @@
|
||||
import i18n from 'i18next';
|
||||
import { initReactI18next } from 'react-i18next';
|
||||
import LanguageDetector from 'i18next-browser-languagedetector';
|
||||
|
||||
import en from './en.json';
|
||||
import de from './de.json';
|
||||
|
||||
const resources = {
|
||||
en: { translation: en },
|
||||
de: { translation: de },
|
||||
};
|
||||
|
||||
i18n
|
||||
.use(LanguageDetector)
|
||||
.use(initReactI18next)
|
||||
.init({
|
||||
resources,
|
||||
fallbackLng: 'en',
|
||||
supportedLngs: ['en', 'de'],
|
||||
interpolation: {
|
||||
escapeValue: false, // React already escapes
|
||||
},
|
||||
detection: {
|
||||
order: ['localStorage', 'navigator'],
|
||||
caches: ['localStorage'],
|
||||
lookupLocalStorage: 'medassist-language',
|
||||
},
|
||||
});
|
||||
|
||||
export default i18n;
|
||||
Reference in New Issue
Block a user