ngx-translate / core

The internationalization (i18n) library for Angular
MIT License
4.5k stars 572 forks source link

setTranslation w/ merge flag is misleading. It does an extend rather than a proper merge. #328

Open camriera opened 7 years ago

camriera commented 7 years ago

I'm submitting a ... (check one with "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 with merge set, really does and extend (Object.assign) under the covers. A True merge would be more useful for those building applications where we need to override translations values from a base translation file.

Expected/desired behavior setTranslation with merge set should perform a proper merge (like lodash merge)

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?

What is the motivation / use case for changing the behavior? Ability to override nested translations

Please tell us about your environment:

ocombe commented 7 years ago

Sounds like a legit request, adding it to the to do list :-)

camriera commented 7 years ago

+1

Iverson commented 7 years ago

+1, any updates?

llamontagne commented 7 years ago

+1