Index: safari/ext/common.js |
=================================================================== |
--- a/safari/ext/common.js |
+++ b/safari/ext/common.js |
@@ -104,8 +104,19 @@ |
return candidates; |
}; |
+ var initCatalog = function(ui_locale) |
Thomas Greiner
2014/12/10 10:29:42
Style nit: I do see why you used underscores here
Sebastian Noack
2014/12/10 10:37:29
That wasn't an aware decision. It happened rather
|
+ { |
+ var bidi_dir = /^(ar|fa|he|ug|ur)_|$/.test(ui_locale) ? "rtl" : "ltr"; |
Thomas Greiner
2014/12/10 10:29:42
This regular expression will match any string due
Sebastian Noack
2014/12/10 10:37:29
Ouch, I forgot to set parentheses.
Thomas Greiner
2014/12/10 11:12:12
The corrected version still matches "ar_". By addi
Sebastian Noack
2014/12/10 11:32:06
Why should we care? We want to match "ar" and "ar_
Thomas Greiner
2014/12/10 12:06:02
I can agree with that line of argument.
|
+ var catalog = Object.create(null); |
+ |
+ catalog["@@ui_locale"] = [ui_locale, []]; |
+ catalog["@@bidi_dir" ] = [bidi_dir, []]; |
+ |
+ return catalog; |
+ }; |
+ |
var locales = getLocaleCandidates(); |
- var catalog = {__proto__: null, "@@ui_locale": [locales[0], []]}; |
+ var catalog = initCatalog(locales[0]); |
var replacePlaceholder = function(text, placeholder, content) |
{ |