Find unused translations in your Ember.js projects
npx ember-intl-analyzer
ember-intl-analyzer can be configured by creating a config/ember-intl-analyzer.js
file in your app:
export default {
whitelist: [
/^countries\./,
/^currency\./,
/^validations\.errors\./,
/^[^.]+\.warnings\.[^.]+$/,
],
};
If you use dynamic translations keys like this:
this.intl.t(`countries.${code}`)
then ember-intl-analyzer can not easily understand what translation keys are being used here. In that case it will ignore the dynamic translation key and show the corresponding translations as unused.
To prevent that from happening you can configure a whitelist
, which accepts an
array of regular expressions that will be checked when looking for unused
translations.
If your application has a lot of unused translations you can run the command with
the --fix
to remove them. Remember to double check your translations as dynamic
translations need to be whitelisted or they will be removed!
There are a number of things that we do not support yet. Have a look at the Issues before using this project.
- ember-intl – Internationalization addon for Ember.js
This projects is developed by and © simplabs GmbH and contributors. It is released under the MIT License.