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: Created Dec. 9, 2014, 6 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,24 @@
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";
+
+ return {
+ __proto__: null,
+
+ "@@ui_locale": [ui_locale, []],
+ "@@bidi_dir": [bidi_dir, []]
+ };
Wladimir Palant 2014/12/09 18:59:09 Nit: Please consider using Object.create(null) ins
Sebastian Noack 2014/12/09 19:30:16 I haven't seen through your policy for unrelated c
Wladimir Palant 2014/12/09 19:55:37 The policy is very simple - fix the code when you
+ };
+
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