OLD | NEW |
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 Loading... |
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(); |
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 Loading... |
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 })(); |
OLD | NEW |