Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: allow '{n}' as placeholder for translated strings #5581

Merged
merged 2 commits into from
Jun 6, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
test: update test
akoreman committed Jun 6, 2024
commit ba06cd559d6a928bf6d4f3cb062a256d3b44f817
4 changes: 2 additions & 2 deletions src/config_test.js
Original file line number Diff line number Diff line change
@@ -54,7 +54,7 @@ module.exports = {
config.setMessages({
foo: "hello world of $1",
test_key: "hello world for test key",
test_with_curly_brackets: "hello world $0 of {1} and $2"
test_with_curly_brackets: "hello world $0 of {1} and $2 to the {3} degree"
});
assert.equal(nls("untranslated_key","bar $1"), "bar $1");
assert.equal(nls("untranslated_key", "bar"), "bar");
@@ -63,7 +63,7 @@ module.exports = {
assert.equal(nls("untranslated_key", "$0B is $1$$", [0.11, 22]), "0.11B is 22$");
assert.equal(nls("untranslated_key_but_translated_default_string", "foo", {1: "goo"}), "hello world of goo");
assert.equal(nls("test_key", "this text should not appear"), "hello world for test key");
assert.equal(nls("test_with_curly_brackets", "hello world $0 of {1} and $2", ["foo", "bar", "yay"]), "hello world foo of bar and yay");
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");
},
"test: define options" : function() {
var o = {};
Loading
Oops, something went wrong.