Internationalization
Manage translations and locales with the Zopio CLI
Internationalization
The Zopio CLI provides robust tools for managing translations and locales in your zopio
application. This page covers how to use the CLI to add, update, and manage translations.
Directory Structure
The Zopio framework uses both next-international
and next-intl
for internationalization, which requires translations to be stored in two locations:
i18n Command
The i18n
command helps you manage translations and locales in your zopio
application.
Options
--add <locale>
- Add a new locale--remove <locale>
- Remove a locale--extract
- Extract translation keys from source files--sync
- Synchronize translation files across locales--check
- Check for missing translations--default <locale>
- Set the default locale
Examples
Supported Locales
The Zopio CLI supports the following locales out of the box:
en
- English (default)tr
- Turkishes
- Spanishde
- German
You can add support for additional locales using the i18n --add
command.
Configuration
The internationalization system is configured through two files:
i18nConfig.ts
languine.json
Using Translations in Components
The Zopio CLI generates components with internationalization support built-in:
Translation Management
The Zopio CLI provides several commands to help you manage translations:
Extract Translation Keys
This command scans your source files for translation keys and adds them to your translation files.
Synchronize Translations
This command ensures that all translation files have the same keys across all locales.
Check for Missing Translations
This command identifies missing translations in your locale files.