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: Addressed comments Created Dec. 10, 2014, 10:37 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(uiLocale)
+ {
+ var bidiDir = /^(ar|fa|he|ug|ur)(_|$)/.test(uiLocale) ? "rtl" : "ltr";
Wladimir Palant 2014/12/11 16:52:15 I only realized now that we are looking at UI loca
Sebastian Noack 2014/12/11 17:03:05 To be honest I didn't consider that case and agree
+ var catalog = Object.create(null);
+
+ catalog["@@ui_locale"] = [uiLocale, []];
+ catalog["@@bidi_dir" ] = [bidiDir, []];
+
+ 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