Fix frontend: resolve imports, add missing functions, configure Vite properly

This commit is contained in:
2025-11-15 11:10:31 +03:00
parent 3c402422fb
commit 59d0135a16
10 changed files with 316 additions and 17 deletions
+14 -9
View File
@@ -7,12 +7,12 @@
export { translations as comprehensiveTranslations, supportedLocales } from './translations';
// Import all translation JSON files for i18next compatibility
import en from './locales/en.json';
import tr from './locales/tr.json';
import kmr from './locales/kmr.json';
import ckb from './locales/ckb.json';
import ar from './locales/ar.json';
import fa from './locales/fa.json';
import en from './locales/en.json?url';
import tr from './locales/tr.json?url';
import kmr from './locales/kmr.json?url';
import ckb from './locales/ckb.json?url';
import ar from './locales/ar.json?url';
import fa from './locales/fa.json?url';
/**
* Language configuration with RTL support
@@ -47,9 +47,9 @@ export const DEFAULT_LANGUAGE = 'en';
export const LANGUAGE_STORAGE_KEY = '@pezkuwi_language';
/**
* Translation resources (JSON format for i18next)
* Translation resources (JSON URLs for dynamic loading)
*/
export const translations = {
export const translationUrls = {
en,
tr,
kmr,
@@ -58,6 +58,11 @@ export const translations = {
fa,
};
/**
* Translation resources (empty - load dynamically)
*/
export const translations = {};
/**
* Check if a language is RTL
* @param languageCode - Language code (e.g., 'ar', 'ckb', 'fa')
@@ -75,4 +80,4 @@ export function isRTL(languageCode: string): boolean {
*/
export function getLanguageConfig(languageCode: string): LanguageConfig | undefined {
return LANGUAGES.find(l => l.code === languageCode);
}
}