Skip to content

Commit e7c2c64

Browse files
author
Olivier Tilloy
committed
Add a failing unit test for #47.
1 parent e86aee7 commit e7c2c64

File tree

3 files changed

+22
-0
lines changed

3 files changed

+22
-0
lines changed

test/lang/test-zh-CN.json

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"basic": "basic success"
3+
}

test/localize_test.coffee

+7
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,13 @@ do ($ = jQuery) ->
156156
t.localize("test", opts)
157157
equal t.text(), "basic success"
158158

159+
# Ref: https://github.com/coderifous/jquery-localize/issues/47
160+
test "language-country code with no language-only file", ->
161+
opts = language: "zh-CN", pathPrefix: "lang"
162+
t = localizableTagWithRel("p", "basic", text: "basic fail")
163+
t.localize("test", opts)
164+
equal t.text(), "basic success"
165+
159166
module "Language optimization"
160167

161168
test "skipping language using string match", ->

test/localize_test.js

+12
Original file line numberDiff line numberDiff line change
@@ -245,6 +245,18 @@
245245
t.localize("test", opts);
246246
return equal(t.text(), "basic success");
247247
});
248+
test("language-country code with no language-only file", function() {
249+
var opts, t;
250+
opts = {
251+
language: "zh-CN",
252+
pathPrefix: "lang"
253+
};
254+
t = localizableTagWithRel("p", "basic", {
255+
text: "basic fail"
256+
});
257+
t.localize("test", opts);
258+
return equal(t.text(), "basic success");
259+
});
248260
module("Language optimization");
249261
test("skipping language using string match", function() {
250262
var opts, t;

0 commit comments

Comments
 (0)