I find myself in a case where I want to dynamically override some translations value based on some criteria.
I thought I could do this by asynchronously loading the new translations parts and then call intl.addTranslations(), but instead of overriding and merging the incoming parts it redefines the whole translation object.
For example, in the base translation file, I have
'key': {
'sub-key-one' : 'some_value_one',
'sub-key-two' : 'some_value_two'
}
and wanted to override with:
'key': {
'sub-key-one' : 'some_new_value_one',
}
Does that make sense ?
You're after doing a deep merge between the translations being added and existing translations. I think we can support this. Happy to review a PR or will work on it in the coming weeks (lots of my plate at the moment).
I'll start on this soon, will be included in the 3.0.0-beta tag (master).
@sly7-7 this is now part of 3.0.0-beta.3. Be mindful of the breaking changes within 3.0.0.
https://github.com/ember-intl/ember-intl/commits/master
I will include a migration document before I release stable.
Most helpful comment
@sly7-7 this is now part of 3.0.0-beta.3. Be mindful of the breaking changes within 3.0.0.
https://github.com/ember-intl/ember-intl/commits/master
I will include a migration document before I release stable.