Update help/docs pages to use i18n translations
- Update locales/index.ts to import help namespace for all languages
- Convert DocumentationPage.tsx to use useTranslation('help')
* All sections now use translation keys from help.json
* Difficulty labels, categories, and articles fully internationalized
* UI strings (titles, buttons, placeholders) use translations
- Convert HelpCenterPage.tsx to use useTranslation('help')
* Categories loaded from translations
* FAQs loaded dynamically from help.json array
* All UI strings internationalized (search, titles, contact info)
- Both pages now support Spanish, English, and Basque languages
- Maintains full backward compatibility with existing Spanish content
Result: Complete i18n implementation for /help and /help/docs routes
This commit is contained in:
@@ -17,6 +17,7 @@ import reasoningEs from './es/reasoning.json';
|
||||
import wizardsEs from './es/wizards.json';
|
||||
import subscriptionEs from './es/subscription.json';
|
||||
import purchaseOrdersEs from './es/purchase_orders.json';
|
||||
import helpEs from './es/help.json';
|
||||
|
||||
// English translations
|
||||
import commonEn from './en/common.json';
|
||||
@@ -37,6 +38,7 @@ import reasoningEn from './en/reasoning.json';
|
||||
import wizardsEn from './en/wizards.json';
|
||||
import subscriptionEn from './en/subscription.json';
|
||||
import purchaseOrdersEn from './en/purchase_orders.json';
|
||||
import helpEn from './en/help.json';
|
||||
|
||||
// Basque translations
|
||||
import commonEu from './eu/common.json';
|
||||
@@ -57,6 +59,7 @@ import reasoningEu from './eu/reasoning.json';
|
||||
import wizardsEu from './eu/wizards.json';
|
||||
import subscriptionEu from './eu/subscription.json';
|
||||
import purchaseOrdersEu from './eu/purchase_orders.json';
|
||||
import helpEu from './eu/help.json';
|
||||
|
||||
// Translation resources by language
|
||||
export const resources = {
|
||||
@@ -79,6 +82,7 @@ export const resources = {
|
||||
wizards: wizardsEs,
|
||||
subscription: subscriptionEs,
|
||||
purchase_orders: purchaseOrdersEs,
|
||||
help: helpEs,
|
||||
},
|
||||
en: {
|
||||
common: commonEn,
|
||||
@@ -99,6 +103,7 @@ export const resources = {
|
||||
wizards: wizardsEn,
|
||||
subscription: subscriptionEn,
|
||||
purchase_orders: purchaseOrdersEn,
|
||||
help: helpEn,
|
||||
},
|
||||
eu: {
|
||||
common: commonEu,
|
||||
@@ -119,6 +124,7 @@ export const resources = {
|
||||
wizards: wizardsEu,
|
||||
subscription: subscriptionEu,
|
||||
purchase_orders: purchaseOrdersEu,
|
||||
help: helpEu,
|
||||
},
|
||||
};
|
||||
|
||||
@@ -155,7 +161,7 @@ export const languageConfig = {
|
||||
};
|
||||
|
||||
// Namespaces available in translations
|
||||
export const namespaces = ['common', 'auth', 'inventory', 'foodSafety', 'suppliers', 'orders', 'recipes', 'errors', 'dashboard', 'production', 'equipment', 'landing', 'settings', 'ajustes', 'reasoning', 'wizards', 'subscription', 'purchase_orders'] as const;
|
||||
export const namespaces = ['common', 'auth', 'inventory', 'foodSafety', 'suppliers', 'orders', 'recipes', 'errors', 'dashboard', 'production', 'equipment', 'landing', 'settings', 'ajustes', 'reasoning', 'wizards', 'subscription', 'purchase_orders', 'help'] as const;
|
||||
export type Namespace = typeof namespaces[number];
|
||||
|
||||
// Helper function to get language display name
|
||||
@@ -169,7 +175,7 @@ export const isSupportedLanguage = (language: string): language is SupportedLang
|
||||
};
|
||||
|
||||
// Export individual language modules for direct imports
|
||||
export { commonEs, authEs, inventoryEs, foodSafetyEs, suppliersEs, ordersEs, recipesEs, errorsEs, equipmentEs, landingEs, settingsEs, ajustesEs, reasoningEs, wizardsEs, wizardsEn, wizardsEu };
|
||||
export { commonEs, authEs, inventoryEs, foodSafetyEs, suppliersEs, ordersEs, recipesEs, errorsEs, equipmentEs, landingEs, settingsEs, ajustesEs, reasoningEs, wizardsEs, wizardsEn, wizardsEu, helpEs, helpEn, helpEu };
|
||||
|
||||
// Default export with all translations
|
||||
export default resources;
|
||||
|
||||
Reference in New Issue
Block a user