La Comanda ships with full English and Spanish translations powered by i18next and react-i18next. Every user-visible string in the application — navigation labels, page titles, table headers, KPI cards, error messages, and form placeholders — is resolved through a translation key rather than hardcoded in the component. This makes it straightforward to add new locales, correct copy, or extend the translation files without touching component source code.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/JAQA20/Paradigmas-G3/llms.txt
Use this file to discover all available pages before exploring further.
Configuration
The i18n instance is initialised once insrc/i18n.ts and imported at the app entry point so it is ready before any component mounts. Both locale files are bundled statically — there are no network requests for translation data at runtime.
| Setting | Value | Effect |
|---|---|---|
lng | "es" | The app starts in Spanish on first load. |
fallbackLng | "en" | If a key is missing from the active locale, the English value is used instead of showing the raw key. |
escapeValue | false | Disables i18next’s HTML escaping — React’s JSX already handles this safely. |
resources | Inline object | Both locale files are bundled at build time; no lazy-loading or HTTP fetching occurs. |
Translation Namespaces
All keys for both locales live in the single default namespace (translation), organised into top-level section objects. The table below lists every section, its purpose, and the number of keys it contains.
| Section key | Purpose | Example key |
|---|---|---|
sidebar | Navigation sidebar labels | sidebar.dashboard, sidebar.new_order |
header | Header bar labels | header.search, header.manager |
login | Login page strings | login.access, login.select_station |
dashboard | Dashboard KPI labels and controls | dashboard.total_sales, dashboard.top_performers |
tables | Table view labels, status types, and activity strings | tables.title, tables.types.Occupied |
kitchen | Kitchen monitor labels and ticket notes | kitchen.urgent, kitchen.notes.medium_rare |
inventory | Inventory module labels and smart-recommendation copy | inventory.low_alerts, inventory.gen_order |
staff | Staff control labels, role names, and filter options | staff.active_staff, staff.on_break |
settings | Settings page labels across all four nav sections | settings.language, settings.save |
access_denied | 403 page labels and system-status fields | access_denied.title, access_denied.level_admin |
error403 | Error page strings (used by the AccessDenied page) | error403.title, error403.return |
Using Translations in Components
Every component that displays text importsuseTranslation from react-i18next and calls t() with the dotted key path. No other setup is required — the hook reads from the i18n instance initialised in i18n.ts.
"Ventas Totales Hoy"; when English is active it renders "Total Sales Today".
Switching Language
Users change the interface language from the Settings page under System Preferences → Interface Language. The settings UI renders two styled<button> elements (English / Español) that call i18n.changeLanguage() on click and highlight the active locale by comparing against i18n.language. The change takes effect immediately across every mounted component without a page reload, because react-i18next subscribes all useTranslation consumers to i18n instance events.
La Comanda does not currently persist the selected language to
localStorage — the setting resets to the default ("es") on page reload. This is a known limitation. To add persistence, call localStorage.setItem('lng', lang) alongside i18n.changeLanguage(lang), and read that value as the lng option in i18n.ts at initialisation time.Adding a Translation Key
Adding a new string to the application requires three steps.Add the key to en.json
Open
src/locales/en.json and add the new key under the appropriate section object. Create a new section object if the string belongs to a new feature area.Add the same key to es.json
Open
src/locales/es.json and add the Spanish equivalent under the same path. Omitting this step will not cause a runtime error — fallbackLng: "en" will silently serve the English value — but untranslated strings are a bug.Translation File Structure
Both locale files share the same key schema. Below is the fulldashboard section from en.json, which covers the KPI cards and chart controls on the Analytics Dashboard page:
es.json: