Releases: Cropster/ember-l10n
v5.1.0
v5.0.0
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'sbeforeModel
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
v4.3.0
v4.2.0
v4.1.0
v4.0.0
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
v3.2.0
- Use
@babel/parser
for extraction instead ofesprima
. This allows to extract from native classes, as well as from TypeScript files. - Ensure
ember-ajax
is not installed when installingember-l10n
(this was a leftover in the blueprint) - Ensure
/translations
directory is created on first extraction run
v3.1.0
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)