Language Commands
Language commands manage the multilingual configuration of your FORGE project — adding and removing locales, setting the default language, and synchronizing translation strings across the backend and frontend.
forge lang:add
Add a new language to the project.
Usage
forge lang:add <CODE> [OPTIONS]Options
| Option | Type | Default | Description |
|---|---|---|---|
CODE | string | — | ISO 639-1 language code (e.g. ar, fr, de). |
--name | string | Auto-detected | English name of the language. |
--native | string | Auto-detected | Native name of the language (e.g. العربية for Arabic). |
--direction | string | ltr | Text direction: ltr (left-to-right) or rtl (right-to-left). |
--default | flag | false | Set this language as the project default. |
Examples
# Add Arabic with RTL support
forge lang:add ar --direction=rtl
# Add French as the new default language
forge lang:add fr --defaultWhen a language is added, FORGE updates forge.yaml, generates translation stubs for existing keys, and updates the database seeder for the languages table.
TIP
FORGE auto-detects the language name, native name, and direction for common ISO 639-1 codes. You only need to specify these options for custom or uncommon locales.
forge lang:remove
Remove a language from the project.
Usage
forge lang:remove <CODE>Example
forge lang:remove frWARNING
Removing a language does not delete existing translation data from the database. Run forge translations:sync --no-prune after removal if you want to preserve orphaned translation rows, or omit the flag to let the sync clean them up.
forge lang:list
Display all configured languages and their settings.
Usage
forge lang:listExample Output
┌──────┬──────────┬───────────┬───────────┬─────────┐
│ Code │ Name │ Native │ Direction │ Default │
├──────┼──────────┼───────────┼───────────┼─────────┤
│ en │ English │ English │ ltr │ Yes │
│ ar │ Arabic │ العربية │ rtl │ No │
│ fr │ French │ Français │ ltr │ No │
└──────┴──────────┴───────────┴───────────┴─────────┘forge lang:default
Change the default language for the project.
Usage
forge lang:default <CODE>Example
forge lang:default arThis updates forge.yaml, regenerates the language seeder, and adjusts the default locale configuration in both the API and frontend apps.
forge lang:supported
Display all languages that FORGE can recognize automatically (code, name, native name, and direction). Useful for discovering valid language codes before adding them to your project.
Usage
forge lang:supportedExample Output
┌──────┬──────────────┬──────────────┬───────────┐
│ Code │ Name │ Native │ Direction │
├──────┼──────────────┼──────────────┼───────────┤
│ ar │ Arabic │ العربية │ rtl │
│ de │ German │ Deutsch │ ltr │
│ en │ English │ English │ ltr │
│ es │ Spanish │ Español │ ltr │
│ fr │ French │ Français │ ltr │
│ ... │ ... │ ... │ ... │
└──────┴──────────────┴──────────────┴───────────┘
Total: 25 languages supportedTIP
When you add a language using a supported code, FORGE auto-fills the name, native name, and direction. You only need to specify these manually for custom or unsupported locales.
Translation Commands
Translation commands manage the key-value translation strings used by the API response layer and the Next.js frontend.
forge translations:sync
Synchronize translation files across all configured languages. New keys are added with empty values; optionally, keys that no longer exist in the source are pruned.
forge translations:sync [OPTIONS]| Option | Type | Default | Description |
|---|---|---|---|
--no-prune | flag | false | Keep translation keys that are no longer present in the source language. |
Example
forge translations:syncSyncing translations...
en: 142 keys (source)
ar: 138 keys → 142 keys (+4 added)
fr: 135 keys → 142 keys (+7 added)
Sync complete.forge translations:export
Export translations to a file for external translators or translation management systems.
forge translations:export [OPTIONS]| Option | Type | Default | Description |
|---|---|---|---|
--output | string | translations/ | Output directory or file path. |
Example
forge translations:export --output=./exports/Generates JSON files per language:
exports/
en.json
ar.json
fr.jsonforge translations:import
Import translations from external files back into the project.
forge translations:import [OPTIONS]| Option | Type | Default | Description |
|---|---|---|---|
--input | string | — | Path to the directory or file containing translations. |
--force | flag | false | Overwrite existing translation values. Without this flag, only empty values are populated. |
Example
forge translations:import --input=./exports/ --forceWARNING
Using --force overwrites all existing translations for the imported languages. Make sure you have a backup or version control before running this.
Workflow Example
A complete workflow for adding a new language to an existing project:
# 1. Add the language
forge lang:add de --name=German --native=Deutsch
# 2. Sync translation keys (stubs with empty values are created)
forge translations:sync
# 3. Export for your translation team
forge translations:export --output=./to-translate/
# 4. After translators return the files, import them
forge translations:import --input=./translated/ --force
# 5. Update the database
forge seed --class translationsSee Also
- Project Commands — configure languages during
forge new - Generator Commands —
--translatableflag for models - Database Commands — seed translation data