Skip to content

Commit 8565ed4

Browse files
committed
jQuery selector needs brackets
1 parent 44d424d commit 8565ed4

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

README.markdown

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,10 @@ example-fr.json:
2929
## Step 3. Use the localize plugin.
3030

3131
// In a browser where the language is set to French
32-
$("rel*=localize").localize("example")
32+
$("[rel*=localize]").localize("example")
3333

3434
// You can also override the language detection, and pass in a language code
35-
$("rel*=localize").localize("example", { language: "fr" })
35+
$("[rel*=localize]").localize("example", { language: "fr" })
3636

3737
# Gory Details
3838

@@ -42,7 +42,7 @@ The first argument of the localize method is the name of the language pack. You
4242

4343
Here's an example of loading several language packs:
4444

45-
$("rel*=localize")
45+
$("[rel*=localize]")
4646
.localize("header")
4747
.localize("sidebar")
4848
.localize("footer")
@@ -70,14 +70,14 @@ You can tell the localize plugin to always skip certain languages using the skip
7070

7171
# using a string will skip ONLY if the language code matches exactly
7272
# this would prevent loading only if the language was "en-US"
73-
$("rel*=localize").localize("example", { skipLanguage: "en-US" })
73+
$("[rel*=localize]").localize("example", { skipLanguage: "en-US" })
7474

7575
# using a regex will skip if the regex matches
7676
# this would prevent loading of any english language translations
77-
$("rel*=localize").localize("example", { skipLanguage: /^en/ })
77+
$("[rel*=localize]").localize("example", { skipLanguage: /^en/ })
7878

7979
# using an array of strings will skip if any of the strings matches exactly
80-
$("rel*=localize").localize("example", { skipLanguage: ["en", "en-US"] })
80+
$("[rel*=localize]").localize("example", { skipLanguage: ["en", "en-US"] })
8181

8282
## Applying the language file
8383

@@ -115,13 +115,13 @@ If you rely on the default callback and follow the "rel" attribute conventions t
115115

116116
**Localize it!**
117117

118-
$("rel*=localize").localize("application", { language: "es" })
118+
$("[rel*=localize]").localize("application", { language: "es" })
119119

120120
## Callbacks
121121

122122
You can provide a callback if you want to augment or replace the default callback provided by the plugin. Your callback should take at least 1 argument: the language data (contents of your json file). It can optionally accept a second argument, which is a reference to the default callback function. This is handy if you still want the default behavior, but also need to do something else with the language data.
123123

124-
$("rel*=localize").localize("application", {
124+
$("[rel*=localize]").localize("application", {
125125
language: "es",
126126
callback: function(data, defaultCallback){
127127
data.title = data.title + currentBugName();

0 commit comments

Comments
 (0)