Skip to content

Commit 21a7ffe

Browse files
committed
Return wrapped set like a proper jQuery plugin.
Fixes #10
1 parent 64a8542 commit 21a7ffe

File tree

3 files changed

+9
-1
lines changed

3 files changed

+9
-1
lines changed

build/jquery.localize.js

Lines changed: 2 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/jquery.localize.coffee

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,5 +103,7 @@ $.localize = (pkg, options = {}) ->
103103
lang = normaliseLang(if options.language then options.language else $.defaultLanguage)
104104
loadLanguage(pkg, lang, 1) unless (options.skipLanguage && lang.match(regexify(options.skipLanguage)))
105105

106+
wrappedSet
107+
106108
$.fn.localize = $.localize
107109
$.localize.data = {}

test/localize_test.coffee

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,11 @@ test "image tag src and alt substitution", ->
4040
equals t.attr("src"), "ruby_round.gif"
4141
equals t.attr("alt"), "a round ruby"
4242

43+
test "chained call", ->
44+
t = localizableTag("p", "basic", text: "basic fail")
45+
t.localize("test", @testOpts).localize("test", @testOpts)
46+
equals t.text(), "basic success"
47+
4348
moreSetup ->
4449
@t = $('
4550
<select>

0 commit comments

Comments
 (0)