Targeted Translation Updates
Control exactly what gets translated with Lingo.dev's precision targeting options.
Benefits of Selective Translation
Selectively updating translations offers several advantages:
- Speed: Focus on priority content when time is limited
- Precision: Fine-tune specific sections without affecting others
- Testing: Experiment with AI context changes on a limited scope
Available Targeting Options
Lingo.dev provides five powerful flags for selective translation:
--force
: Retranslate everything in scope, ignoring the lockfile--bucket
: Target a specific file type bucket--locale
: Focus on a specific language--key
: Update a single translation key--file
: Target specific files within your buckets
Command Reference
Complete Retranslation with --force
Force a complete retranslation of all content:
npx lingo.dev@latest i18n --force
Best used when:
- You've significantly changed AI context settings
- The lockfile might be corrupted
- You need a fresh start for all translations
Note: This option requires more processing time and API usage.
Target File Types with --bucket
Focus on a specific file type category:
npx lingo.dev@latest i18n --bucket json
Best used when:
- You've updated content in a specific area of your app
- Testing AI context changes for particular content types
- Different parts of your app have varying update frequencies
Focus on Languages with --locale
Target a specific language for translation:
npx lingo.dev@latest i18n --locale fr
Best used when:
- Launching in a new market
- Reviewing translations for a specific language
- Different languages have different priority levels
Pinpoint Updates with --key
Target a single translation key:
npx lingo.dev@latest i18n --key welcome.title
Best used when:
- You've changed just one string
- Testing AI context on a specific translation
- Fixing a single translation quickly
For nested keys, use dot notation:
npx lingo.dev@latest i18n --key header.navigation.about
File-Specific Updates with --file
Target specific files in your translation buckets:
npx lingo.dev@latest i18n --file blog.[locale].json
Best used when:
- You've updated content in specific files
- Testing AI context changes on particular files
- Different files have different update priorities
Target multiple files using patterns:
npx lingo.dev@latest i18n --file articles/
Or list files individually:
npx lingo.dev@latest i18n --file landing.[locale].json --file pricing.[locale].json
Note: This flag only works with files already defined in your buckets.
Combining Options for Maximum Control
Combine multiple flags for precise targeting:
npx lingo.dev@latest i18n --force --bucket json --locale de
This command retranslates all JSON content, but only for German.
Best Practices
- Use
--force
strategically: Reserve for major context changes or when you need a fresh start - Integrate
--bucket
with CI/CD: Automatically update translations for changed areas - Leverage
--locale
for market launches: Focus efforts on languages for new target markets - Always commit your lockfile: Keep your team in sync after cherry-picking updates
By mastering these targeting options, you gain precise control over your translation workflow, saving time and resources while maintaining quality across your localized content.