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
assert.equal(nls("untranslated_key","$0B is $1$$",[0.11,22]),"0.11B is 22$");
64
63
assert.equal(nls("untranslated_key_but_translated_default_string","foo",{1: "goo"}),"hello world of goo");
65
64
assert.equal(nls("test_key","this text should not appear"),"hello world for test key");
66
-
assert.equal(nls("test_with_curly_brackets","hello world $0 of {1} and $2 to the {3} degree",["foo","bar","yay","third"]),"hello world foo of bar and yay to the third degree");
65
+
},
66
+
"test: nls setting nlsPlaceholders": function(){
67
+
varnls=config.nls;
68
+
69
+
// Should default to using dollar signs
70
+
config.setMessages({
71
+
test_with_curly_brackets: "hello world $0 of {0} and $1 to the {1} degree"
72
+
});
73
+
assert.equal(nls("test_with_curly_brackets","hello world $0 of {1} and $1 to the {1} degree",["bar","third"]),"hello world bar of {0} and third to the {1} degree");
74
+
75
+
config.setMessages({
76
+
test_with_curly_brackets: "hello world $0 of {0} and $1 to the {1} degree"
77
+
},{placeholders: "curlyBrackets"});
78
+
assert.equal(nls("test_with_curly_brackets","hello world $0 of {1} and $1 to the {1} degree",["bar","third"]),"hello world $0 of bar and $1 to the third degree");
79
+
80
+
config.setMessages({
81
+
test_with_curly_brackets: "hello world $0 of {0} and $1 to the {1} degree"
82
+
},{placeholders: "dollarSigns"});
83
+
assert.equal(nls("test_with_curly_brackets","hello world $0 of {1} and $1 to the {1} degree",["bar","third"]),"hello world bar of {0} and third to the {1} degree");
0 commit comments