CLI
Babely provides a CLI to help you translate your application.
Commands Overview
Translate
The translate command is used to translate your application.
npx @babely/cli@latest translate
Init
The init command is used to initialize a new Babely project.
npx @babely/cli@latest init
Auth
The auth command is used to authenticate with Babely.
npx @babely/cli@latest auth
Sync
The sync command is used to sync your application with Babely.
npx @babely/cli@latest sync
Locale Add
The locale command is used to manage your application's locales.
npx @babely/cli@latest locale add pt,fr
Locale Remove
The locale remove command is used to remove a locale from your application.
npx @babely/cli@latest locale remove pt,fr
Overrides
The overrides command is used to manage translation overrides for your Babely Dashboard. Overrides allow you to customize specific translations from the Dashboard.
The overrides pull command is used to pull the latest overrides from the Babely Dashboard
npx @babely/cli@latest overrides pull
Overrides for source locale
Sometimes you may want to get overrides for the source locale. For example, as a developer you might add translations in en.json but want to have spell checks, overrides and maintain consistent tone with other languages. You can enable this by adding your source locale to the target locales as follows:
{ "locale": { "source": "en", "targets": [ "sv", "en" <- Add your source locale here ] }, "files": { "json": { "include": [ "src/locales/[locale]/*.json" ] } } }
Delete translations
The translations delete command is used to delete all target translation files and remote translations from your project. This is useful when you want to start fresh or remove all translations.
npx @babely/cli@latest translations delete