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", "message":"Malware domains",
"description":"English: Malware domains" "description":"English: Malware domains"
}, },
"3pGroupSocial":{ "3pGroupAnnoyances":{
"message":"Social", "message":"Annoyances",
"description":"English: Social" "description":"The header identifying the filter lists in the category 'annoyances'"
}, },
"3pGroupMultipurpose":{ "3pGroupMultipurpose":{
"message":"Multipurpose", "message":"Multipurpose",

View file

@ -69,7 +69,8 @@ var renderFilterLists = function(soft) {
listEntryTemplate = uDom('#templates .listEntry'), listEntryTemplate = uDom('#templates .listEntry'),
listStatsTemplate = vAPI.i18n('3pListsOfBlockedHostsPerListStats'), listStatsTemplate = vAPI.i18n('3pListsOfBlockedHostsPerListStats'),
renderElapsedTimeToString = vAPI.i18n.renderElapsedTimeToString, 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 // Assemble a pretty list name if possible
var listNameFromListKey = function(listKey) { var listNameFromListKey = function(listKey) {
@ -170,7 +171,17 @@ var renderFilterLists = function(soft) {
var liGroup = document.querySelector('#lists > .groupEntry[data-groupkey="' + groupKey + '"]'); var liGroup = document.querySelector('#lists > .groupEntry[data-groupkey="' + groupKey + '"]');
if ( liGroup === null ) { if ( liGroup === null ) {
liGroup = listGroupTemplate.clone().nodeAt(0); 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 !== '' ) { if ( groupName !== '' ) {
liGroup.querySelector('.geName').textContent = groupName; liGroup.querySelector('.geName').textContent = groupName;
} }