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);
}
}
+64
View File
@@ -0,0 +1,64 @@
export default {
"welcome": {
"title": "Welcome to Pezkuwi",
"subtitle": "Your gateway to decentralized governance",
"selectLanguage": "Select Your Language",
"continue": "Continue"
},
"auth": {
"signIn": "Sign In",
"signUp": "Sign Up",
"email": "Email",
"password": "Password",
"confirmPassword": "Confirm Password",
"forgotPassword": "Forgot Password?",
"noAccount": "Don't have an account?",
"haveAccount": "Already have an account?",
"createAccount": "Create Account",
"welcomeBack": "Welcome Back!",
"getStarted": "Get Started"
},
"dashboard": {
"title": "Dashboard",
"wallet": "Wallet",
"staking": "Staking",
"governance": "Governance",
"dex": "Exchange",
"history": "History",
"settings": "Settings",
"balance": "Balance",
"totalStaked": "Total Staked",
"rewards": "Rewards",
"activeProposals": "Active Proposals"
},
"wallet": {
"title": "Wallet",
"connect": "Connect Wallet",
"disconnect": "Disconnect",
"address": "Address",
"balance": "Balance",
"send": "Send",
"receive": "Receive",
"transaction": "Transaction",
"history": "History"
},
"settings": {
"title": "Settings",
"language": "Language",
"theme": "Theme",
"notifications": "Notifications",
"security": "Security",
"about": "About",
"logout": "Logout"
},
"common": {
"cancel": "Cancel",
"confirm": "Confirm",
"save": "Save",
"loading": "Loading...",
"error": "Error",
"success": "Success",
"retry": "Retry",
"close": "Close"
}
} as const;