Learn how to generate multi-language images in seconds with Bannerly!See Bannerly.io

CLI: Extract keys

Last modified: May 11, 2021Author:ย Jakub Pomykaล‚a

Extract translation keys from your project files. Choose 'projectType' and invoke 'extract' command. The CLI will upload found translation keys to the translation editor. The CLI will process your local files for given path ('searchDir' parameter) and find all used translation keys. Every found translation key will be added to the translation editor.

extract translations

๐Ÿ’ฟ Installation

Install SimpleLocalize CLI

curl -s https://get.simplelocalize.io/install | bash

Problems with CLI? See troubleshooting section.

๐Ÿ‘จโ€๐Ÿ’ป Usage

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

๐Ÿ“– Supported libraries

Libraries from which you can extract translation keys

Library projectType value Ready?
react-intl yahoo/react-intl โœ…
Standard Android internationalization google/android โœ…
Standard iOS internationalization apple/ios-macos โœ…
react-i18next i18next/i18next โœ…
mde/ejs mde/ejs โœ…
ember-intl ember-intl/ember-intl [ ]
jekyll-multiple-languages-plugin Anthony-Gaudino/jekyll-multiple-languages-plugin [ ]
dust-intl yahoo/dust-intl [ ]
handlebars-intl yahoo/handlebars-intl [ ]

Do you already have extracted translation keys to file? Great! Use Localization CLI Tool to upload translations to the translation editor.

๐Ÿ‘ฉโ€๐Ÿซ How message extraction works?

For example to translate frontend application in ReactJS you can use 3rd party library like yahoo/react-intl:

Example yahoo/react-intl usage in React app code:

<FormattedMessage id="LOGIN"/>

Translation key LOGIN will be found by localization CLI tool.

simplelocalize extract --apiKey API_KEY --projectType PROJECT_TYPE --searchDir ./src

CLI extraction

๐ŸŽ‰ Done! CLI will find i18n keys, and push them to translation editor.