mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-01-26 10:59:53 +00:00
1.6 KiB
1.6 KiB
Add Missing i18n Translations
Task: Add English translations for all new localized strings
Step 1: Identify new translation keys
Find all translation keys that were added in the current branch's changes. These keys appear as arguments to translation functions: t(), st(), $t(), or similar i18n functions.
Step 2: Add translations to English locale file
For each new translation key found, add the corresponding English text to the file src/locales/en/main.json.
Key-to-JSON mapping rules:
- Translation keys use dot notation to represent nested JSON structure
- Convert dot notation to nested JSON objects when adding to the locale file
- Example: The key
g.user.namemaps to:{ "g": { "user": { "name": "User Name" } } }
Important notes:
- Only modify the English locale file (
src/locales/en/main.json) - Do not modify other locale files - translations for other languages are automatically generated by the
i18n.yamlworkflow - Exception for manual translations: Only add translations to non-English locale files if:
- You have specific domain knowledge that would produce a more accurate translation than the automated system
- The automated translation would likely be incorrect due to technical terminology or context-specific meaning
Example workflow:
- If you added
t('settings.advanced.enable')in a Vue component - Add to
src/locales/en/main.json:{ "settings": { "advanced": { "enable": "Enable advanced settings" } } }