Files
pwap/web/src/i18n/config.ts
T
pezkuwichain 2df29a6395 fix: i18n translations not loading - use local .ts files
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
2025-11-17 08:26:27 +03:00

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;