OLD | NEW |
1 /* | 1 /* |
2 * This file is part of Adblock Plus <http://adblockplus.org/>, | 2 * This file is part of Adblock Plus <http://adblockplus.org/>, |
3 * Copyright (C) 2006-2013 Eyeo GmbH | 3 * Copyright (C) 2006-2013 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 |
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
12 * GNU General Public License for more details. | 12 * GNU General Public License for more details. |
13 * | 13 * |
14 * You should have received a copy of the GNU General Public License | 14 * You should have received a copy of the GNU General Public License |
15 * along with Adblock Plus. If not, see <http://www.gnu.org/licenses/>. | 15 * along with Adblock Plus. If not, see <http://www.gnu.org/licenses/>. |
16 */ | 16 */ |
17 | 17 |
18 var i18n; | 18 var i18n; |
19 if (typeof chrome != "undefined") | 19 |
20 { | 20 if (typeof ext != "undefined") |
| 21 i18n = ext.i18n; |
| 22 else if (typeof chrome != "undefined") |
21 i18n = chrome.i18n; | 23 i18n = chrome.i18n; |
22 } | |
23 else | 24 else |
24 { | 25 { |
25 // Using Firefox' approach on i18n instead | 26 // Using Firefox' approach on i18n instead |
26 | 27 |
27 // Randomize URI to work around bug 719376 | 28 // Randomize URI to work around bug 719376 |
28 var pageName = location.pathname.replace(/.*\//, '').replace(/\..*?$/, ''); | 29 var pageName = location.pathname.replace(/.*\//, '').replace(/\..*?$/, ''); |
29 var stringBundle = Services.strings.createBundle("chrome://adblockplus/locale/
" + pageName + | 30 var stringBundle = Services.strings.createBundle("chrome://adblockplus/locale/
" + pageName + |
30 ".properties?" + Math.random()); | 31 ".properties?" + Math.random()); |
31 | 32 |
32 function getI18nMessage(key) | 33 function getI18nMessage(key) |
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
137 | 138 |
138 var now = new Date(); | 139 var now = new Date(); |
139 if (d.toDateString() == now.toDateString()) | 140 if (d.toDateString() == now.toDateString()) |
140 return [timeString]; | 141 return [timeString]; |
141 else | 142 else |
142 return [timeString, d.toLocaleDateString()]; | 143 return [timeString, d.toLocaleDateString()]; |
143 } | 144 } |
144 | 145 |
145 // Fill in the strings as soon as possible | 146 // Fill in the strings as soon as possible |
146 window.addEventListener("DOMContentLoaded", loadI18nStrings, true); | 147 window.addEventListener("DOMContentLoaded", loadI18nStrings, true); |
OLD | NEW |