Skip to content

Your First Translation

The main command is translate. It automates the entire process of finding new keys in your code, adding them to your default locale, and translating them into all other languages.

For it to work, you need to provide a default value when you use your translation function:

t('header.title', 'Default value')

Then, just run:

Terminal window
lin translate

lin will find header.title, add it to your default locale file with the value “Default value”, and then translate it to all other locales.

To translate only specific locales, list them like this:

Terminal window
lin translate es fr

To also remove unused keys from all locales, use the --prune flag:

Terminal window
lin translate -u

To make the output more minimal (for CI or scripts), use the --silent flag:

Terminal window
lin translate -S