CLI: Extract translations

Last updated: May 09, 2024Author: Jakub Pomykała

SimpleLocalize CLI offers extract command to extract translation keys and translations from your local project files and export them to a JSON file. The CLI will process your local files at path specified by searchDir parameter and search for translation keys and translations based on the projectType you provide.

Usage

Before you start, you need to install the CLI. Follow the installation guide.

simplelocalize extract \
  --projectType yahoo/react-intl \
  --searchDir ./src

After running the command above, the CLI will store found translation keys and translations in a JSON file named extraction.json. You can upload this file to SimpleLocalize using the upload command and simplelocalize-json file format.

Supported libraries

Libraries from which you can extract translation keys

LibraryprojectType value
react-intlyahoo/react-intl
Standard Android internationalizationgoogle/android
Standard iOS internationalizationapple/ios-macos
react-i18nexti18next/i18next
mde/ejsmde/ejs
data-i18n-keysimplelocalize/data-i18n-key
Was this helpful?