@@ -29,10 +29,10 @@ example-fr.json:
29
29
## Step 3. Use the localize plugin.
30
30
31
31
// In a browser where the language is set to French
32
- $("rel*=localize").localize("example")
32
+ $("[ rel*=localize] ").localize("example")
33
33
34
34
// 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" })
36
36
37
37
# Gory Details
38
38
@@ -42,7 +42,7 @@ The first argument of the localize method is the name of the language pack. You
42
42
43
43
Here's an example of loading several language packs:
44
44
45
- $("rel*=localize")
45
+ $("[ rel*=localize] ")
46
46
.localize("header")
47
47
.localize("sidebar")
48
48
.localize("footer")
@@ -70,14 +70,14 @@ You can tell the localize plugin to always skip certain languages using the skip
70
70
71
71
# using a string will skip ONLY if the language code matches exactly
72
72
# 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" })
74
74
75
75
# using a regex will skip if the regex matches
76
76
# this would prevent loading of any english language translations
77
- $("rel*=localize").localize("example", { skipLanguage: /^en/ })
77
+ $("[ rel*=localize] ").localize("example", { skipLanguage: /^en/ })
78
78
79
79
# 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"] })
81
81
82
82
## Applying the language file
83
83
@@ -115,13 +115,13 @@ If you rely on the default callback and follow the "rel" attribute conventions t
115
115
116
116
** Localize it!**
117
117
118
- $("rel*=localize").localize("application", { language: "es" })
118
+ $("[ rel*=localize] ").localize("application", { language: "es" })
119
119
120
120
## Callbacks
121
121
122
122
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.
123
123
124
- $("rel*=localize").localize("application", {
124
+ $("[ rel*=localize] ").localize("application", {
125
125
language: "es",
126
126
callback: function(data, defaultCallback){
127
127
data.title = data.title + currentBugName();
0 commit comments