You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[X] bug report => check the FAQ and search github for a similar issue or PR before submitting
[ ] support request => check the FAQ and search github for a similar issue before submitting
[X] feature request
Current behavior
setTranslation emits the new added translations if being merged, resulting in MissingTranslation errors of already existing translations.
Expected/desired behavior
setTranslations emits the merged object of all the translations instead of the new translations.
Reproduction of the problem
If the current behavior is a bug or you can illustrate your feature request better with an example, please provide the steps to reproduce and if possible a minimal demo of the problem via https://plnkr.co or similar (you can use this template as a starting point: http://plnkr.co/edit/tpl:btpW3l0jr5beJVjohy1Q).
What is the expected behavior?
setTranslations emits the merged object of all the translations instead of the new translations.
What is the motivation / use case for changing the behavior?
Adding new translations dynamicly to the list using setTranslations(lang, translations, true) triggers the MissingTranslationHandler for translations that are already existing because only the newly added translations are emitted
Possible solution:
this.onTranslationChange.emit({translations: translations, lang: lang});
Browser: [all | Chrome XX | Firefox XX | IE XX | Safari XX | Mobile Chrome XX | Android X.X Web Browser | iOS XX Safari | iOS XX UIWebView | iOS XX WKWebView ]
Language: [all | TypeScript X.X | ES6/7 | ES5]
The text was updated successfully, but these errors were encountered:
I'm submitting a ... (check one with "x")
Current behavior
setTranslation emits the new added translations if being merged, resulting in MissingTranslation errors of already existing translations.
Expected/desired behavior
setTranslations emits the merged object of all the translations instead of the new translations.
Reproduction of the problem
If the current behavior is a bug or you can illustrate your feature request better with an example, please provide the steps to reproduce and if possible a minimal demo of the problem via https://plnkr.co or similar (you can use this template as a starting point: http://plnkr.co/edit/tpl:btpW3l0jr5beJVjohy1Q).
What is the expected behavior?
setTranslations emits the merged object of all the translations instead of the new translations.
What is the motivation / use case for changing the behavior?
Adding new translations dynamicly to the list using setTranslations(lang, translations, true) triggers the MissingTranslationHandler for translations that are already existing because only the newly added translations are emitted
Possible solution:
this.onTranslationChange.emit({translations: translations, lang: lang});
becomes:
this.onTranslationChange.emit({translations: this.translations[lang], lang: lang});
Please tell us about your environment:
ng2-translate version: 4.2.0
Angular version: 2.2.1
Browser: [all | Chrome XX | Firefox XX | IE XX | Safari XX | Mobile Chrome XX | Android X.X Web Browser | iOS XX Safari | iOS XX UIWebView | iOS XX WKWebView ]
Language: [all | TypeScript X.X | ES6/7 | ES5]
The text was updated successfully, but these errors were encountered: