Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Unified Diff: safari/ext/common.js

Issue 5404244093960192: Issue 1678 - Added bidi support for Safari (Closed)
Patch Set: Ignore region Created Dec. 10, 2014, 8:16 a.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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)
{
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld