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: Used Object.create(null) Created Dec. 9, 2014, 7:28 p.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,22 @@
return candidates;
};
+ var initCatalog = function(ui_locale)
+ {
+ var bidi_dir = (ui_locale == "ar" ||
+ ui_locale == "fa" ||
+ ui_locale == "he" ||
+ ui_locale == "ug" ||
+ ui_locale == "ur") ? "rtl" : "ltr";
+
+ 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