Skip to content

CLI: Extracting translations

Francesco Novy edited this page Nov 20, 2018 · 1 revision

The extractor extracts message ids from the JS and HBS files in your Ember project. It generates the corresponding PO files for translation. Later, you can convert the translated POs into JSON files to be used for client side translation within your Ember app. Please note: Make sure turning off the development server while extracting, otherwise process slows down due to livereload!

To extract all strings in your app, run the following command in your app's root directory:

ember l10n:extract

To see all available command line options for the extractor script please run:

ember l10n:extract -h

Usage tips

Once you have extracted message ids with ember l10n:extract, which creates a domain messages.pot file, you can generate PO-files for other languages by using -g option without having to run extraction again like so:

  • ember l10n:extract -g -l de (creates german PO file from POT file)

If you have excluded some files from prior extractions with -x and want to merge them with your messages.pot you can do:

  • ember l10n:extract -g -l en (merge english PO file)
  • ember l10n:extract -g -l de (merge german PO file)