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

Side by Side Diff: safari/ext/common.js

Issue 29338190: Issue 3697 - Fall back to i18n.getUILanguage if @ui_locale isn't supported (Closed)
Patch Set: Remove Safari redundancy and Firefox specific codepath Created March 17, 2016, 5:38 a.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff | Download patch
« lib/utils.js ('K') | « lib/utils.js ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * This file is part of Adblock Plus <https://adblockplus.org/>, 2 * This file is part of Adblock Plus <https://adblockplus.org/>,
3 * Copyright (C) 2006-2016 Eyeo GmbH 3 * Copyright (C) 2006-2016 Eyeo GmbH
4 * 4 *
5 * Adblock Plus is free software: you can redistribute it and/or modify 5 * Adblock Plus is free software: you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License version 3 as 6 * it under the terms of the GNU General Public License version 3 as
7 * published by the Free Software Foundation. 7 * published by the Free Software Foundation.
8 * 8 *
9 * Adblock Plus is distributed in the hope that it will be useful, 9 * Adblock Plus is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after
119 candidates.push(language); 119 candidates.push(language);
120 120
121 if (candidates.indexOf(defaultLocale) == -1) 121 if (candidates.indexOf(defaultLocale) == -1)
122 candidates.push(defaultLocale); 122 candidates.push(defaultLocale);
123 123
124 return candidates; 124 return candidates;
125 }; 125 };
126 126
127 var initCatalog = function(uiLocale) 127 var initCatalog = function(uiLocale)
128 { 128 {
129 var bidiDir = /^(ar|fa|he|ug|ur)(_|$)/.test(uiLocale) ? "rtl" : "ltr"; 129 var bidiDir = Utils.readingDirection();
Sebastian Noack 2016/03/17 11:31:56 The idea was to not support @bidi_dir here. But si
130 var catalog = Object.create(null); 130 var catalog = Object.create(null);
131 131
132 catalog["@@ui_locale"] = [uiLocale, []]; 132 catalog["@@ui_locale"] = [uiLocale, []];
133 catalog["@@bidi_dir" ] = [bidiDir, []]; 133 catalog["@@bidi_dir" ] = [bidiDir, []];
134 134
135 return catalog; 135 return catalog;
136 }; 136 };
137 137
138 var locales = getLocaleCandidates(); 138 var locales = getLocaleCandidates();
139 var catalog = initCatalog(locales[0]); 139 var catalog = initCatalog(locales[0]);
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after
214 }; 214 };
215 215
216 216
217 /* Utils */ 217 /* Utils */
218 218
219 ext.getURL = function(path) 219 ext.getURL = function(path)
220 { 220 {
221 return safari.extension.baseURI + path; 221 return safari.extension.baseURI + path;
222 }; 222 };
223 })(); 223 })();
OLDNEW
« lib/utils.js ('K') | « lib/utils.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld