Skip to content

Commit d59ee1f

Browse files
author
InfinitiesLoop
committed
Documented new quality setting support.
1 parent cbe89a7 commit d59ee1f

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,14 @@ alert(jQuery.culture.name) // 'fr'
8080

8181
In any case, if no match is found, the 'default' culture is selected.
8282
</p>
83+
<p>
84+
Each culture string may also follow the pattern defined in <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.4">RFC2616 sec 14.4</a>. That is, a culture name may include a 'quality' value that indicates it preference.
85+
86+
<pre>
87+
jQuery.preferCulture("fr;q=0.4, es;q=0.5, he");
88+
</pre>
89+
In this example, 'he' is given top priority (an unspecified quality is equal to 1). If that language is not an exact match for any of the cultures available on jQuery.cultures, then 'es' is the next highest priority with 0.5, etc. If none of these match, just like with the array syntax, the search starts over and the same rules are applied to the corresponding neutral language culture for each. If still none match, the default 'en' culture is used.
90+
</p>
8391

8492
<a name="find"></a>
8593
<h2 id="find">jQuery.findClosestCulture</h2>

0 commit comments

Comments
 (0)