mirror of
https://github.com/discourse/discourse.git
synced 2025-02-17 09:02:46 +08:00
FIX: Ignore if the default localization node is not an object (#5439)
This commit is contained in:
parent
f1f2ae594c
commit
d18c42abd5
|
@ -55,7 +55,9 @@ export default {
|
|||
node = node[segs[i]];
|
||||
}
|
||||
|
||||
node[segs[segs.length-1]] = v;
|
||||
if (typeof node === "object") {
|
||||
node[segs[segs.length-1]] = v;
|
||||
}
|
||||
|
||||
});
|
||||
}
|
||||
|
|
|
@ -41,3 +41,10 @@ QUnit.test("translation overrides", function(assert) {
|
|||
assert.equal(I18n.t("composer.reply"), "WAT", "overrides existing translation in current locale");
|
||||
assert.equal(I18n.t("topic.reply.help"), "foobar", "overrides translation in default locale");
|
||||
});
|
||||
|
||||
QUnit.test("skip translation override if parent node is not an object", function(assert) {
|
||||
PreloadStore.store('translationOverrides', {"js.composer.reply":"WAT","js.composer.reply.help":"foobar"});
|
||||
LocalizationInitializer.initialize(this.registry);
|
||||
|
||||
assert.equal(I18n.t("composer.reply.help"), "[fr.composer.reply.help]");
|
||||
});
|
||||
|
|
Loading…
Reference in New Issue
Block a user