mirror of
https://github.com/pezkuwichain/pwap.git
synced 2026-04-27 06:57:55 +00:00
2df29a6395
Problem: Translation keys were displayed as raw text (e.g. 'delegation.title')
Cause: Import path '@pezkuwi/i18n' referenced comprehensiveTranslations which lacked delegation keys
Solution: Import local .ts translation files directly instead of shared package
Changes:
- Updated src/i18n/config.ts to import from ./locales/*.ts
- Fixed delegation page translations
- All i18n keys now properly translate
Status: ✅ All translations working
47 lines
1.3 KiB
TypeScript
47 lines
1.3 KiB
TypeScript
import i18n from 'i18next';
|
|
import { initReactI18next } from 'react-i18next';
|
|
import LanguageDetector from 'i18next-browser-languagedetector';
|
|
|
|
// Import LOCAL .ts translations
|
|
import en from './locales/en';
|
|
import tr from './locales/tr';
|
|
import kmr from './locales/kmr';
|
|
import ar from './locales/ar';
|
|
import fa from './locales/fa';
|
|
|
|
export const languages = {
|
|
en: { name: 'English', flag: '🇬🇧', dir: 'ltr' },
|
|
tr: { name: 'Türkçe', flag: '🇹🇷', dir: 'ltr' },
|
|
'ku-kurmanji': { name: 'Kurdî (Kurmancî)', flag: '☀️', dir: 'ltr' },
|
|
'ku-sorani': { name: 'کوردی (سۆرانی)', flag: '☀️', dir: 'rtl' },
|
|
ar: { name: 'العربية', flag: '🇸🇦', dir: 'rtl' },
|
|
fa: { name: 'فارسی', flag: '🇮🇷', dir: 'rtl' }
|
|
};
|
|
|
|
const resources = {
|
|
en: { translation: en },
|
|
tr: { translation: tr },
|
|
'ku-kurmanji': { translation: kmr },
|
|
'ku-sorani': { translation: kmr },
|
|
ar: { translation: ar },
|
|
fa: { translation: fa }
|
|
};
|
|
|
|
i18n
|
|
.use(LanguageDetector)
|
|
.use(initReactI18next)
|
|
.init({
|
|
resources,
|
|
fallbackLng: 'en',
|
|
debug: false,
|
|
interpolation: {
|
|
escapeValue: false
|
|
},
|
|
detection: {
|
|
order: ['localStorage', 'navigator', 'htmlTag'],
|
|
caches: ['localStorage']
|
|
}
|
|
});
|
|
|
|
export default i18n;
|