Skip to content

Fix issue #50 #87

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

Merged
merged 3 commits into from
Sep 2, 2016
Merged
Show file tree
Hide file tree
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
Next Next commit
Add a failing unit test for #50.
  • Loading branch information
Olivier Tilloy committed Aug 26, 2016
commit 89fbac09bb4d6258fe6daed1578614b9876f038d
3 changes: 3 additions & 0 deletions test/lang/test-ast.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"basic": "basic success"
}
7 changes: 7 additions & 0 deletions test/localize_test.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,13 @@ do ($ = jQuery) ->
t.localize("test", opts)
equal t.text(), "country code success"

# Ref: https://github.com/coderifous/jquery-localize/issues/50
test "three-letter language code", ->
opts = language: "ast", pathPrefix: "lang"
t = localizableTagWithRel("p", "basic", text: "basic fail")
t.localize("test", opts)
equal t.text(), "basic success"

module "Language optimization"

test "skipping language using string match", ->
Expand Down
12 changes: 12 additions & 0 deletions test/localize_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -233,6 +233,18 @@
t.localize("test", opts);
return equal(t.text(), "country code success");
});
test("three-letter language code", function() {
var opts, t;
opts = {
language: "ast",
pathPrefix: "lang"
};
t = localizableTagWithRel("p", "basic", {
text: "basic fail"
});
t.localize("test", opts);
return equal(t.text(), "basic success");
});
module("Language optimization");
test("skipping language using string match", function() {
var opts, t;
Expand Down