+ "customInstructions": "# 1. SUPPORTED LANGUAGES AND LOCATION\n- Localize all strings into the following locale files: ca, de, en, es, fr, hi, it, ja, ko, pl, pt-BR, tr, vi, zh-CN, zh-TW\n- The VSCode extension has two main areas that require localization:\n * Core Extension: src/i18n/locales/ (extension backend)\n * WebView UI: webview-ui/src/i18n/locales/ (user interface)\n\n# 2. VOICE, STYLE AND TONE\n- Always use informal speech (e.g., \"du\" instead of \"Sie\" in German) for all translations\n- Maintain a direct and concise style that mirrors the tone of the original text\n- Carefully account for colloquialisms and idiomatic expressions in both source and target languages\n- Aim for culturally relevant and meaningful translations rather than literal translations\n- Preserve the personality and voice of the original content\n- Use natural-sounding language that feels native to speakers of the target language\n- Don't translate the word \"token\" as it means something specific in English that all languages will understand\n- Don't translate domain-specific words (especially technical terms like \"Prompt\") that are commonly used in English in the target language\n\n# 3. CORE EXTENSION LOCALIZATION (src/)\n- Located in src/i18n/locales/\n- NOT ALL strings in core source need internationalization - only user-facing messages\n- Internal error messages, debugging logs, and developer-facing messages should remain in English\n- The t() function is used with namespaces like 'core:errors.missingToolParameter'\n- Be careful when modifying interpolation variables; they must remain consistent across all translations\n- Some strings in formatResponse.ts are intentionally not internationalized since they're internal\n- When updating strings in core.json, maintain all existing interpolation variables\n- Check string usages in the codebase before making changes to ensure you're not breaking functionality\n\n# 4. WEBVIEW UI LOCALIZATION (webview-ui/src/)\n- Located in webview-ui/src/i18n/locales/\n- Uses standard React i18next patterns with the useTranslation hook\n- All user interface strings should be internationalized\n- Always use the Trans component with named components for text with embedded components\n\n<Trans> example:\n\n`\"changeSettings\": \"You can always change this at the bottom of the <settingsLink>settings</settingsLink>\",`\n\n```\n <Trans\n i18nKey=\"welcome:telemetry.changeSettings\"\n components={{\n settingsLink: <VSCodeLink href=\"#\" onClick={handleOpenSettings} />\n }}\n />\n```\n\n# 5. TECHNICAL IMPLEMENTATION\n- Use namespaces to organize translations logically\n- Handle pluralization using i18next's built-in capabilities\n- Implement proper interpolation for variables using {{variable}} syntax\n- Don't include defaultValue. The `en` translations are the fallback\n- Always use apply_diff instead of write_to_file when editing existing translation files (much faster and more reliable)\n- When using apply_diff, carefully identify the exact JSON structure to edit to avoid syntax errors\n- Placeholders (like {{variable}}) must remain exactly identical to the English source to maintain code integration and prevent syntax errors\n\n# 6. WORKFLOW AND APPROACH\n- First add or modify English strings, then ask for confirmation before translating to all other languages\n- Use this process for each localization task:\n 1. Identify where the string appears in the UI/codebase\n 2. Understand the context and purpose of the string\n 3. Update English translation first\n 4. Create appropriate translations for all other supported languages\n 5. Validate your changes with the missing translations script\n- Flag or comment if an English source string is incomplete (\"please see this...\") to avoid truncated or unclear translations\n- For UI elements, distinguish between:\n * Button labels: Use short imperative commands (\"Save\", \"Cancel\")\n * Tooltip text: Can be slightly more descriptive\n- Preserve the original perspective: If text is a user command directed at the software, ensure the translation maintains this direction, avoiding language that makes it sound like an instruction from the system to the user\n\n# 7. COMMON PITFALLS TO AVOID\n- Switching between formal and informal addressing styles - always stay informal (\"du\" not \"Sie\")\n- Translating or altering technical terms and brand names that should remain in English\n- Modifying or removing placeholders like {{variable}} - these must remain identical\n- Translating domain-specific terms that are commonly used in English in the target language\n- Changing the meaning or nuance of instructions or error messages\n- Forgetting to maintain consistent terminology throughout the translation\n\n# 8. QUALITY ASSURANCE\n- Maintain consistent terminology across all translations\n- Respect the JSON structure of translation files\n- Watch for placeholders and preserve them in translations\n- Be mindful of text length in UI elements when translating to languages that might require more characters\n- Use context-aware translations when the same string has different meanings\n- Always validate your translation work by running the missing translations script:\n ```\n node scripts/find-missing-translations.js\n ```\n- Address any missing translations identified by the script to ensure complete coverage across all locales\n\n# 9. TRANSLATOR'S CHECKLIST\n- ✓ Used informal tone consistently (\"du\" not \"Sie\")\n- ✓ Preserved all placeholders exactly as in the English source\n- ✓ Maintained consistent terminology with existing translations\n- ✓ Kept technical terms and brand names unchanged where appropriate\n- ✓ Preserved the original perspective (user→system vs system→user)\n- ✓ Adapted the text appropriately for UI context (buttons vs tooltips)",
0 commit comments