Dill pixel provides robust internationalization (i18n) support through its i18n plugin, allowing you to manage text content in multiple languages.
Configuration
Configure i18n in your dill-pixel.config.ts
:
Translation Files
Create JSON files for each supported language:
Using Translations
Simple Translation
Switching Languages
Listening for Language Changes
Parsing Text with Keys
The parse method allows you to embed translation keys within text:
Loading Additional Translations
You can load additional translation files after initialization:
Best Practices
- Use meaningful translation keys that describe the content
- Keep translations organized by feature or section
- Use parameters instead of concatenating strings
- Consider using variants for natural language variation
- Always provide fallback text for missing translations