Skip to content

Releases: Cropster/ember-l10n

v5.1.0

26 Nov 09:10
Compare
Choose a tag to compare
  • Remove obsolete messages from en.po when extracting (#88)

v5.0.0

17 Nov 14:22
Compare
Choose a tag to compare

This release refactors the addon to Ember Octane.
Mostly, everything stays the same, but the way you configure the addon changes, which results in breaking changes and needs attention.
You can find details here: #83

Breaking changes

Changed configuration

Instead of extending the service and putting configuration there, you now configure this addon fully through the config/environment.js file:

ENV['ember-l10n'] = {
  // This is required
  locales: ['en', 'de'],

  // These are optional (defaults listed)
  defaultLocale: 'en',
  autoInitialize: false,
  defaultPluralForm: 'nplurals=2; plural=(n != 1);',
  jsonPath: '/assets/locales'
}

Other notable changes

  • Use Glimmer component for <GetText>- this is an internal change, the usage did not change at all.
  • Avoid using observers for the helpers - this is an internal change, we now manually register callbacks with the service for when the locale changes. Functionally, nothing changes here.
  • Make autoInitialize default to false. In most scenarios you want to manually set the locale in the application route's beforeModel hook or similar, in order to ensure that the locale file is loaded before the application is shown.
  • The deprecated ember-l10n/test-helpers.js file is removed. It is not needed anymore for quite some time.

You might also need to adjust something in your tests, if you relied on overwriting some properties of the l10n-service there. You can do so now like this:

class ExtendedL10nService extends L10nService {
  _loadConfig() {
    let config = {
      locales: ['de', 'en', 'ko'],
      autoInitialize: false,
      defaultLocale: 'de',
    };

    return super._loadConfig(config);
  }

  _getWindow() {
    return {};
  }
}

v4.3.1

25 Feb 09:28
Compare
Choose a tag to compare
  • Fix app re-exports (embroider complained about them)

v4.3.0

25 Feb 09:27
Compare
Choose a tag to compare
  • Ensure ember-l10n works with Prember.

v4.2.0

25 Feb 09:29
Compare
Choose a tag to compare
  • Update dependencies
  • Update babel-parser config to allow newer JS features

v4.1.0

03 Feb 13:08
Compare
Choose a tag to compare
  • Ensure it works with FastBoot (#60)
  • Auto-configure the fingerprinting setting to ensure ember-l10n always works (the user is informed about any changes in the console)

v4.0.0

28 Oct 10:26
Compare
Choose a tag to compare

This release removes the dependency on ember-cli-ifa.

Updating from 3.x

If you only had ember-cli-ifa installed for this addon, you can safely remove it from the list of your dependencies, as well as all configuration for it.

How does fingerprinting work now?

It works as before, only that we automatically pick up if it should be fingerprinted based on the ember-cli-build.js settings - no need to configure anything else. You only need to make sure that .json files are fingerprinted - we also warn (at build time) when that is not the case.

Are there any other major changes?

Mostly, this should be a drop-in update. The only breaking change is that jsonPath on the l10n service does not work anymore. Instead, you can configure that in the config/environment.js now (if necessary).

v3.2.1

03 Sep 12:41
Compare
Choose a tag to compare
  • Ensure it handles absolute URL prepends

v3.2.0

19 Aug 10:35
Compare
Choose a tag to compare
  • Use @babel/parser for extraction instead of esprima. This allows to extract from native classes, as well as from TypeScript files.
  • Ensure ember-ajax is not installed when installing ember-l10n (this was a leftover in the blueprint)
  • Ensure /translations directory is created on first extraction run

v3.1.0

21 Jan 07:49
Compare
Choose a tag to compare

This release tackles JSON file size reduction:

  • Improve validation: It will skip untranslated items for validation, making the output more concise
  • It will show the number of untranslated items
  • Add tests for validation
  • Ensure untranslated items are removed from the generated JSON to reduce the JSON size
  • Ensure unchanged items are removed from the generated JSON to reduce the JSON size (for the default language)
  • Ensure the order of items in the generated JSON is always consistent by sorting it by message id
  • Remove the header item from the translations (the translations[''][''] item)