How Pluto localization works
mainPluto uses the i18next library to manage UI translations via standard JSON files. Each language has its own JSON file in the frontend/lang/ directory.
Key Concepts
- Fallback: If a translation is missing in the selected language, Pluto falls back to English.
- Interpolation: Strings can include placeholders like
{{variable}}(e.g.,"Welcome to {{pluto_logo}}"). You must preserve the exact placeholder syntax in your translation, though you can change its position. - Pluralization: To handle different plural forms, use the following suffixes on your keys:
_zero_one_two_few_many_other
Example for pluralization:
"t_new_messages_zero": "You have no new messages 🥺",
"t_new_messages_one": "You have {{count}} new message",
"t_new_messages_other": "You have {{count}} new messages"