v3.0.0
This release includes two major changes:
-
It drops the dependency on ember-ajax (and thus on jQuery). Instead, we simply do a manual XMLHttpRequest. If your app runs in fastboot, you might need to overwrite this to make this work. For this, you can override the
ajaxRequest(fileName)method, which is expected to return a promise that resolves to the JSON object from the given URL. -
It changes the extraction behavior. We now use AST to get translation strings from .js and .hbs files, which is much, much faster - in a big app this could go down from >20 minutes to 8 seconds. The changes are:
- Massively improved extraction time - in a big example app, extraction time was down from ~27 minutes to 8 seconds!
- Extraction from template literals now works - e.g. l10n.t(
translate this) - Extraction will now throw on invalid syntax, instead of silently ignoring it
- Since extraction for .hbs & .js is now combined, it will correctly keep comments for both file types for a single translation
- We now also keep column position of translations, in addition to file name & row
For a more complete guide of the changes, see #43
-
Add
--include-patternsoption forember l10n:extract. Example usage:ember l10n:extract --include-patterns 'app/translated-things' -
Remove
--exclude-patternsoption forember l10n:extract. Instead, use--include-patternsto manually achieve the same effect.