2025-08-28 10:41:04 +02:00
|
|
|
// Spanish translations
|
|
|
|
|
import commonEs from './es/common.json';
|
|
|
|
|
import authEs from './es/auth.json';
|
|
|
|
|
import inventoryEs from './es/inventory.json';
|
2025-09-18 23:32:53 +02:00
|
|
|
import foodSafetyEs from './es/foodSafety.json';
|
|
|
|
|
import suppliersEs from './es/suppliers.json';
|
2025-09-19 11:44:38 +02:00
|
|
|
import ordersEs from './es/orders.json';
|
2025-09-19 16:03:24 +02:00
|
|
|
import recipesEs from './es/recipes.json';
|
2025-08-28 10:41:04 +02:00
|
|
|
import errorsEs from './es/errors.json';
|
2025-09-22 11:04:03 +02:00
|
|
|
import dashboardEs from './es/dashboard.json';
|
|
|
|
|
import productionEs from './es/production.json';
|
|
|
|
|
|
|
|
|
|
// English translations
|
|
|
|
|
import commonEn from './en/common.json';
|
|
|
|
|
import recipesEn from './en/recipes.json';
|
|
|
|
|
import dashboardEn from './en/dashboard.json';
|
|
|
|
|
import productionEn from './en/production.json';
|
|
|
|
|
|
|
|
|
|
// Basque translations
|
|
|
|
|
import commonEu from './eu/common.json';
|
|
|
|
|
import dashboardEu from './eu/dashboard.json';
|
|
|
|
|
import productionEu from './eu/production.json';
|
2025-08-28 10:41:04 +02:00
|
|
|
|
|
|
|
|
// Translation resources by language
|
|
|
|
|
export const resources = {
|
|
|
|
|
es: {
|
|
|
|
|
common: commonEs,
|
|
|
|
|
auth: authEs,
|
|
|
|
|
inventory: inventoryEs,
|
2025-09-18 23:32:53 +02:00
|
|
|
foodSafety: foodSafetyEs,
|
|
|
|
|
suppliers: suppliersEs,
|
2025-09-19 11:44:38 +02:00
|
|
|
orders: ordersEs,
|
2025-09-19 16:03:24 +02:00
|
|
|
recipes: recipesEs,
|
2025-08-28 10:41:04 +02:00
|
|
|
errors: errorsEs,
|
2025-09-22 11:04:03 +02:00
|
|
|
dashboard: dashboardEs,
|
|
|
|
|
production: productionEs,
|
|
|
|
|
},
|
|
|
|
|
en: {
|
|
|
|
|
common: commonEn,
|
|
|
|
|
recipes: recipesEn,
|
|
|
|
|
dashboard: dashboardEn,
|
|
|
|
|
production: productionEn,
|
|
|
|
|
},
|
|
|
|
|
eu: {
|
|
|
|
|
common: commonEu,
|
|
|
|
|
dashboard: dashboardEu,
|
|
|
|
|
production: productionEu,
|
2025-08-28 10:41:04 +02:00
|
|
|
},
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
// Supported languages
|
2025-09-22 11:04:03 +02:00
|
|
|
export const supportedLanguages = ['es', 'en', 'eu'] as const;
|
2025-08-28 10:41:04 +02:00
|
|
|
export type SupportedLanguage = typeof supportedLanguages[number];
|
|
|
|
|
|
|
|
|
|
// Default language
|
|
|
|
|
export const defaultLanguage: SupportedLanguage = 'es';
|
|
|
|
|
|
|
|
|
|
// Language configuration
|
|
|
|
|
export const languageConfig = {
|
|
|
|
|
es: {
|
|
|
|
|
name: 'Español',
|
|
|
|
|
nativeName: 'Español',
|
|
|
|
|
code: 'es',
|
|
|
|
|
flag: '🇪🇸',
|
|
|
|
|
rtl: false,
|
|
|
|
|
},
|
2025-09-22 11:04:03 +02:00
|
|
|
en: {
|
|
|
|
|
name: 'English',
|
|
|
|
|
nativeName: 'English',
|
|
|
|
|
code: 'en',
|
|
|
|
|
flag: '🇺🇸',
|
|
|
|
|
rtl: false,
|
|
|
|
|
},
|
|
|
|
|
eu: {
|
|
|
|
|
name: 'Euskera',
|
|
|
|
|
nativeName: 'Euskera',
|
|
|
|
|
code: 'eu',
|
|
|
|
|
flag: '🏴',
|
|
|
|
|
rtl: false,
|
|
|
|
|
},
|
2025-08-28 10:41:04 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
// Namespaces available in translations
|
2025-09-22 11:04:03 +02:00
|
|
|
export const namespaces = ['common', 'auth', 'inventory', 'foodSafety', 'suppliers', 'orders', 'recipes', 'errors', 'dashboard', 'production'] as const;
|
2025-08-28 10:41:04 +02:00
|
|
|
export type Namespace = typeof namespaces[number];
|
|
|
|
|
|
|
|
|
|
// Helper function to get language display name
|
|
|
|
|
export const getLanguageDisplayName = (language: SupportedLanguage): string => {
|
|
|
|
|
return languageConfig[language]?.nativeName || language;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
// Helper function to check if language is supported
|
|
|
|
|
export const isSupportedLanguage = (language: string): language is SupportedLanguage => {
|
|
|
|
|
return supportedLanguages.includes(language as SupportedLanguage);
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
// Export individual language modules for direct imports
|
2025-09-19 16:03:24 +02:00
|
|
|
export { commonEs, authEs, inventoryEs, foodSafetyEs, suppliersEs, ordersEs, recipesEs, errorsEs };
|
2025-08-28 10:41:04 +02:00
|
|
|
|
|
|
|
|
// Default export with all translations
|
|
|
|
|
export default resources;
|