Skip to content
Snippets Groups Projects
Commit 0091df2b authored by Vincent Petry's avatar Vincent Petry
Browse files

Improved JS L10N bundle merging + tests

parent 78570a5f
No related branches found
No related tags found
No related merge requests found
......@@ -78,9 +78,7 @@ OC.L10N = {
}
} else {
// Theme overwriting the default language
_.each(bundle, function(translation, key) {
self._bundles[appName][key] = translation
});
_.extend(self._bundles[appName], bundle);
}
},
......
......@@ -52,6 +52,14 @@ describe('OC.L10N tests', function() {
t(TEST_APP, 'Hello {name}', {name: '<strong>Steve</strong>'}, null, {escape: false})
).toEqual('Hello <strong>Steve</strong>');
});
it('keeps old texts when registering existing bundle', function() {
OC.L10N.register(TEST_APP, {
'sunny': 'sonnig',
'new': 'neu'
});
expect(t(TEST_APP, 'sunny')).toEqual('sonnig');
expect(t(TEST_APP, 'new')).toEqual('neu');
});
});
describe('plurals', function() {
function checkPlurals() {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment