Skip to content

Commit

Permalink
feat(ui-i18n.js): Allow replacing/customizing specific existing local…
Browse files Browse the repository at this point in the history
…e strings when using add.

Use `merge` instead of `extend`. Extending will *replace* the *entire* existing object with the new one. Merging will *add* new strings into existing objects, thereby preserving any strings that are set elsewhere in code.
  • Loading branch information
prettycode authored and mportuga committed Apr 28, 2018
1 parent abfceda commit d6d820f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/js/i18n/ui-i18n.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@
if (!this._langs[lower]) {
this._langs[lower] = {};
}
angular.extend(this._langs[lower], strings);
angular.merge(this._langs[lower], strings);
},
getAllLangs: function () {
var langs = [];
Expand Down Expand Up @@ -301,4 +301,4 @@
} );


})();
})();

0 comments on commit d6d820f

Please sign in to comment.