rename "Social" filter list category to "Annoyances"

This commit is contained in:
gorhill 2017-09-10 13:02:04 -04:00
parent 355dbc00ba
commit c641cadea9
No known key found for this signature in database
GPG Key ID: 25E1490B761470C2
2 changed files with 16 additions and 5 deletions

View File

@ -319,9 +319,9 @@
"message":"Malware domains",
"description":"English: Malware domains"
},
"3pGroupSocial":{
"message":"Social",
"description":"English: Social"
"3pGroupAnnoyances":{
"message":"Annoyances",
"description":"The header identifying the filter lists in the category 'annoyances'"
},
"3pGroupMultipurpose":{
"message":"Multipurpose",

View File

@ -69,7 +69,8 @@ var renderFilterLists = function(soft) {
listEntryTemplate = uDom('#templates .listEntry'),
listStatsTemplate = vAPI.i18n('3pListsOfBlockedHostsPerListStats'),
renderElapsedTimeToString = vAPI.i18n.renderElapsedTimeToString,
hideUnusedLists = document.body.classList.contains('hideUnused');
hideUnusedLists = document.body.classList.contains('hideUnused'),
groupNames = new Map();
// Assemble a pretty list name if possible
var listNameFromListKey = function(listKey) {
@ -170,7 +171,17 @@ var renderFilterLists = function(soft) {
var liGroup = document.querySelector('#lists > .groupEntry[data-groupkey="' + groupKey + '"]');
if ( liGroup === null ) {
liGroup = listGroupTemplate.clone().nodeAt(0);
var groupName = vAPI.i18n('3pGroup' + groupKey.charAt(0).toUpperCase() + groupKey.slice(1));
var groupName = groupNames.get(groupKey);
if ( groupName === undefined ) {
groupName = vAPI.i18n('3pGroup' + groupKey.charAt(0).toUpperCase() + groupKey.slice(1));
// Category "Social" is being renamed "Annoyances": ensure
// smooth transition.
// TODO: remove when majority of users are post-1.14.8 uBO.
if ( groupName === '' && groupKey === 'social' ) {
groupName = vAPI.i18n('3pGroupAnnoyances');
}
groupNames.set(groupKey, groupName);
}
if ( groupName !== '' ) {
liGroup.querySelector('.geName').textContent = groupName;
}