This repository has been archived by the owner on Oct 15, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 21
/
Copy pathlocale.nano.js
445 lines (336 loc) · 18.1 KB
/
locale.nano.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
// ----------------------------------------------------------------------------------------------------------------- //
// Nano Core 2 - An adblocker
// Copyright (C) 2018-2019 Nano Core 2 contributors
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
// ----------------------------------------------------------------------------------------------------------------- //
// Locale definition
// Note that not every string is used
// ----------------------------------------------------------------------------------------------------------------- //
"use strict";
// ----------------------------------------------------------------------------------------------------------------- //
(() => {
// ------------------------------------------------------------------------------------------------------------- //
const mk_link = (url, name) => {
return "<a href='" + url + "'>" + name + "</a>";
};
// ------------------------------------------------------------------------------------------------------------- //
const ubo_res_doc = "https://github.com/gorhill/uBlock/wiki/Resources-Library";
const nano_res_doc = "https://github.com/NanoAdblocker/NanoCore2/blob/master/src/snippets.js";
// ------------------------------------------------------------------------------------------------------------- //
return {
// --------------------------------------------------------------------------------------------------------- //
// Dashboard
nano_d_ui_group: {
message: "User interface",
description: "Group 'User interface' of settings tab",
},
nano_d_line_wrap_e: {
message: "Soft wrap long lines in filter editor",
description: "English: Soft wrap long lines in filter editor",
},
nano_d_line_wrap_v: {
message: "Soft wrap long lines in filter viewer",
description: "English: Soft wrap long lines in filter viewer",
},
nano_d_recompile_filters: {
message: "Force recompile filters",
description: "Button in advanced settings to recompile filters",
},
nano_d_resources_links: {
message: "Nano comes with two sets of resources, " + mk_link(ubo_res_doc, "uBlock Origin Resources") + " and " + mk_link(nano_res_doc, "Nano Extra Resources") + ".",
description: "Resources reference links, 'Resources' and 'Extra Resources' should be translated",
},
// TODO: Not used
nano_d_ace_help: {
message: "Nano Filter Editor is powered by Ace and most shortcut keys works the same.",
description: "[Not Used] Explain the similarity between Nano Filter Editor and Ace in terms of shortcut keys",
},
nano_d_about_based_on: {
message: "Based on {{@data}}",
description: "English: Based on {{@data}}",
},
// --------------------------------------------------------------------------------------------------------- //
// Filter viewer
nano_v_title: {
message: "Nano — Filter Viewer",
description: "Title of the filter viewer",
},
nano_v_read_error: {
message: "Could not load content, please refresh.",
description: "Message when filter content could not be loaded",
},
// --------------------------------------------------------------------------------------------------------- //
// Popup panel
nano_p_cache_control: {
message: "cache control",
description: "The cache control strip name, can be at most 20 English characters wide",
},
nano_p_open_firewall_pane: {
message: "Toggle the overview panel",
description: "Tooltip for toggle firewall details (sometimes called overview panel) button",
},
nano_p_refresh_button: {
message: "Click to refresh this page.\n\nCtrl+click to refresh this page while bypassing cache.",
description: "English: Click to refresh this page.\n\nCtrl+click to refresh this page while bypassing cache.",
},
// Beta buttons
nano_p_force_scroll: {
message: "(beta) Enter force scroll mode (will break layout)",
description: "Tooltip for force scroll button"
},
nano_p_bug_reporter: {
message: "(beta) Open the bug reporter",
description: "Tooltip for bug reporter button"
},
// --------------------------------------------------------------------------------------------------------- //
// Whitelist linter warnings
// TODO: Are these used?
nano_l_whitelist_aborted_w: {
message: "Nano did not scan the rest of the whitelists for warnings because there are too many warnings.",
description: "Warning when too many warnings in whitelists",
},
nano_l_whitelist_suspecious_re: {
message: "This line is treated as a regular expression, is that intended?",
description: "Warning when parsed as regular expression but is unlikely the intention of user",
},
// --------------------------------------------------------------------------------------------------------- //
// Whitelist linter errors
// TODO: Are these used?
nano_l_whitelist_aborted_e: {
message: "Nano did not scan the rest of the whitelists for errors because there are too many errors.",
description: "Error when too many errors in whitelists",
},
nano_l_whitelist_invalid_hostname: {
message: "This hostname is not valid.",
description: "Error when hostname not valid",
},
nano_l_whitelist_invalid_re: {
message: "This regular expression has syntax errors.",
description: "Error when regular expression has syntax errors",
},
nano_l_whitelist_invalid_url: {
message: "This URL is not valid.",
description: "Error when a URL not valid",
},
// --------------------------------------------------------------------------------------------------------- //
// Filter linter warnings
nano_l_filter_aborted_w: {
message: "Nano did not scan the rest of the filter rules for warnings because there are too many warnings.",
description: "Warning when too many warnings in filter rules",
},
nano_l_filter_script_snippet_double_exception: {
message: "Nano discarded a negated domain because it cannot be used in a script snippet exception rule.",
description: "Warning when negated domain used with script snippet exception",
},
nano_l_filter_converted_to_exception: {
message: "Nano converted this rule to an exception rule because it only contain negated domains.",
description: "Warning when a rule is convered to exception because all negated domains",
},
nano_l_filter_negated_html_filtering: {
message: "Negated domains are not yet supported for HTML filtering.",
description: "Warning when negated domains used with HTML filtering",
},
// TODO: Not used
nano_l_filter_discarded_non_negatable_type: {
message: "Nano discarded the type option '{{type}}' because it cannot be negated.",
description: "[Not Used] English: Nano discarded the type option '{{type}}' because it cannot be negated.",
},
// TODO: Not used
nano_l_filter_expanded_mp4_option: {
message: "Nano replaced the option 'mp4' with 'media,redirect=noop-1s.mp4'.",
description: "Warning when 'mp4' is replaced",
},
nano_l_filter_unsupported_type_ignored: {
message: "Nano discarded type options that are not yet supported.",
description: "Warning when unsupported types discarded but not entire rule",
},
nano_l_filter_resource_not_found: {
message: "The resource '{{res}}' could not be found, is it spelled correctly?",
description: "Warning when resource not found",
},
nano_l_filter_resource_not_redirectable: {
message: "The resource '{{res}}' cannot be used as a redirect target.",
description: "Warning when resource not redirectable",
},
nano_l_filter_resource_not_injectable: {
message: "The resource '{{res}}' cannot be injected as a script snippet.",
description: "Warning when resource not injectable",
},
nano_l_filter_resource_alias_used: {
message: "'{{alias}}' is the alias of '{{res}}', consider using the real name instead.",
description: "Warning when resource alias used",
},
nano_l_html_filtering_not_supported: {
message: "HTML filtering is not supported by your browser.",
description: "Warning when HTML filtering is used on unsupported platforms",
},
// --------------------------------------------------------------------------------------------------------- //
// Filter linter deprecations
nano_l_filter_comment_bracket: {
message: "Using '[' to denote comment is deprecated, use '!' instead.",
description: "Deprecation when '[' used for comments",
},
nano_l_filter_inline_comment: {
message: "Inline comments are deprecated.",
description: "Deprecation when inline comments",
},
nano_l_filter_script_contains: {
message: "'##script:contains(...)' is deprecated, use '##^script:has-text(...)' instead.",
description: "Deprecation when 'script:contains' is used",
},
// TODO: Not used
nano_l_filter_mp4_option: {
message: "The use of the option 'mp4' is deprecated, write out the full options instead.",
description: "Deprecation when 'mp4'",
},
// --------------------------------------------------------------------------------------------------------- //
// Filter linter errors
nano_l_filter_aborted_e: {
message: "Nano did not scan the rest of the filter rules for errors because there are too many errors.",
description: "Error when too many errors in filter rules",
},
nano_l_filter_ag_js_injection: {
message: "Raw JavaScript injection is not allowed due to security concerns.",
description: "Error when raw JavaScript injection",
},
nano_l_filter_bad_selector: {
message: "The selector in this rule has syntax errors.",
description: "Error when selector has syntax errors",
},
nano_l_filter_too_expensive: {
message: "This rule cannot be generic.",
description: "Error when expensive rule is generic",
},
nano_l_filter_style_injection_syntax_error: {
message: "This CSS injection rule has syntax errors.",
description: "Error when CSS injection has syntax errors",
},
nano_l_filter_assets_access_violation: {
message: "Unprivileged filters may not reference privileged resources.",
description: "Error when unprivileged filter references a privileged resources",
},
nano_l_filter_localhost_entry: {
message: "This host file entry is discarded because it is localhost declaration.",
description: "Error when localhost declaration",
},
nano_l_filter_ag_element_remove: {
message: "Element remove rules with AdGuard syntax are not yet supported, use '##^' instead.",
description: "Error when AdGuard style element remove rule",
},
// TODO: Not used
nano_l_filter_negated_generichide: {
message: "The options 'generichide', 'ghide', and 'elemhide' cannot be negated.",
description: "Error when 'generichide' is negated",
},
nano_l_filter_bad_domain_option_arguments: {
message: "The option 'domain=...' has invalid arguments.",
description: "Error when 'domain=' has invalid arguments",
},
nano_l_filter_bad_denyallow_option_arguments: {
message: "The option 'denyallow=...' has invalid arguments.",
description: "Error when 'denyallow=' has invalid arguments",
},
nano_l_filter_bad_csp_option_arguments: {
message: "The option 'csp=...' has no arguments or has invalid arguments.",
description: "Error when 'csp=' has no arguments or has invalid arguments",
},
nano_l_filter_unknown_option: {
message: "The option '{{option}}' is not recognized.",
description: "English: The option '{{option}}' is not recognized.",
},
nano_l_filter_only_unsupported_type: {
message: "This filter rule selected only unsupported type options.",
description: "Error when filter rule selected only unsupported types",
},
nano_l_filter_no_type: {
message: "This filter rule explicitly selected no type options.",
description: "Error when filter rule explicitly selected no types",
},
nano_l_filter_bad_re: {
message: "This network rule has regular expression syntax errors.",
description: "Error when network rule has regular expression syntax errors",
},
nano_l_filter_too_short: {
message: "This network rule is too short.",
description: "Error when network rule is too short",
},
nano_l_filter_matcher_too_long: {
message: "The matcher of this network rule is too long.",
description: "Error when network matcher is too long",
},
nano_l_filter_generic_js_in_block: {
message: "Script injection syntax that selects all resources can only be used in exception filters.",
description: "Error when '##+js()' is used",
},
// https://github.com/uBlock-LLC/uBlock/issues/1096
nano_l_filter_intervention_smed79: {
message: "The domain anchor may not be immediately followed by '^'.",
description: "Error when the bad rule from SMed79 is discarded",
},
// --------------------------------------------------------------------------------------------------------- //
// Redirect rule warnings
// TODO: Not used
nano_r_no_type: {
message: "Nano discarded the redirect portion of this rule because it must select a type option.",
description: "Warning when redirect selected no types",
},
nano_r_too_many_types: {
message: "Nano discarded the redirect portion of this rule because it selected too many type options.",
description: "Warning when redirect selected too many types",
},
nano_r_no_resource_token: {
message: "Nano discarded the redirect portion of this rule because it has no arguments.",
description: "Warning when redirect has no arguments",
},
nano_r_no_supported_type: {
message: "Nano discarded the redirect portion of this rule because it did not select any supported type options.",
description: "Warning when redirect selected no supported type",
},
nano_r_negated_domain: {
message: "Nano discarded part of the redirect portion of this rule because negated domains cannot be used with redirect.",
description: "Warning when negated domain used with redirect",
},
nano_r_no_destination: {
message: "Nano discarded the redirect portion of this rule because it has no valid destination domain.",
description: "Warning when redirect has no destination",
},
// TODO: Think of a better warning message
nano_r_does_not_match_re: {
message: "Nano discarded the redirect portion of this rule because this network rule does not match this regular expression: {{regexp}}",
description: "Warning when redirect failed initial test, use '{{regexp}}' to denote the tester if needed",
},
nano_r_simplified_to_star: {
message: "Nano simplified the matcher of this rule to '*'.",
description: "Warning when the '*/*' workaround is simplified",
},
// Redirect rule errors
nano_r_redirect_in_exception: {
message: "Redirect rules cannot be exceptions.",
description: "Error when redirect used in exception",
},
nano_r_redirected_twice: {
message: "Redirect rules can only contain one redirect directive.",
description: "Error when two redirects in one rule",
},
// --------------------------------------------------------------------------------------------------------- //
// Known bugs warnings
nano_b_cosmetic_filter_passed_through: {
message: "This rule is rejected for now. More information: https://github.com/NanoAdblocker/NanoCore/issues/77",
description: "https://github.com/NanoAdblocker/NanoCore/issues/77",
},
// --------------------------------------------------------------------------------------------------------- //
};
})();
// ----------------------------------------------------------------------------------------------------------------- //