Skip to content

v3.0.0

Choose a tag to compare

@mydea mydea released this 28 Nov 12:26
· 109 commits to master since this release

This release includes two major changes:

  1. 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.

  2. 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

  1. Add --include-patterns option for ember l10n:extract. Example usage: ember l10n:extract --include-patterns 'app/translated-things'

  2. Remove --exclude-patterns option for ember l10n:extract. Instead, use --include-patterns to manually achieve the same effect.