mirror of
https://github.com/gorhill/uBlock.git
synced 2024-10-06 09:37:12 +02:00
fix #2344
This commit is contained in:
parent
5975832653
commit
0b4f31bd8a
@ -529,7 +529,7 @@
|
|||||||
"group": "regions",
|
"group": "regions",
|
||||||
"off": true,
|
"off": true,
|
||||||
"title": "RUS: RU AdList (Дополнительная региональная подписка)",
|
"title": "RUS: RU AdList (Дополнительная региональная подписка)",
|
||||||
"lang": "ru",
|
"lang": "be ru uk",
|
||||||
"contentURL": "https://easylist-downloads.adblockplus.org/advblock.txt",
|
"contentURL": "https://easylist-downloads.adblockplus.org/advblock.txt",
|
||||||
"supportURL": "https://forums.lanik.us/viewforum.php?f=102"
|
"supportURL": "https://forums.lanik.us/viewforum.php?f=102"
|
||||||
},
|
},
|
||||||
|
@ -430,8 +430,7 @@
|
|||||||
/******************************************************************************/
|
/******************************************************************************/
|
||||||
|
|
||||||
µBlock.autoSelectRegionalFilterLists = function(lists) {
|
µBlock.autoSelectRegionalFilterLists = function(lists) {
|
||||||
var lang = self.navigator.language.slice(0, 2),
|
var selectedListKeys = [ this.userFiltersPath ],
|
||||||
selectedListKeys = [ this.userFiltersPath ],
|
|
||||||
list;
|
list;
|
||||||
for ( var key in lists ) {
|
for ( var key in lists ) {
|
||||||
if ( lists.hasOwnProperty(key) === false ) { continue; }
|
if ( lists.hasOwnProperty(key) === false ) { continue; }
|
||||||
@ -440,7 +439,7 @@
|
|||||||
selectedListKeys.push(key);
|
selectedListKeys.push(key);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if ( list.lang === lang ) {
|
if ( this.matchCurrentLanguage(list.lang) ) {
|
||||||
selectedListKeys.push(key);
|
selectedListKeys.push(key);
|
||||||
list.off = false;
|
list.off = false;
|
||||||
}
|
}
|
||||||
@ -1135,7 +1134,7 @@
|
|||||||
if ( details.entry.content === 'filters' ) {
|
if ( details.entry.content === 'filters' ) {
|
||||||
if (
|
if (
|
||||||
details.entry.off !== true ||
|
details.entry.off !== true ||
|
||||||
self.navigator.language.startsWith(details.entry.lang)
|
this.matchCurrentLanguage(details.entry.lang)
|
||||||
) {
|
) {
|
||||||
this.saveSelectedFilterLists([ details.assetKey ], true);
|
this.saveSelectedFilterLists([ details.assetKey ], true);
|
||||||
}
|
}
|
||||||
|
@ -245,3 +245,15 @@
|
|||||||
};
|
};
|
||||||
|
|
||||||
/******************************************************************************/
|
/******************************************************************************/
|
||||||
|
|
||||||
|
// https://github.com/gorhill/uBlock/issues/2344
|
||||||
|
|
||||||
|
µBlock.matchCurrentLanguage = function(s) {
|
||||||
|
if ( typeof s !== 'string' ) { return false; }
|
||||||
|
if ( this.matchCurrentLanguage.reLang === undefined ) {
|
||||||
|
this.matchCurrentLanguage.reLang = new RegExp('\\b' + self.navigator.language.slice(0, 2) + '\\b');
|
||||||
|
}
|
||||||
|
return this.matchCurrentLanguage.reLang.test(s);
|
||||||
|
};
|
||||||
|
|
||||||
|
/******************************************************************************/
|
||||||
|
Loading…
Reference in New Issue
Block a user