From 7b9b934b9dab5582944060558b23b624308ff93c Mon Sep 17 00:00:00 2001 From: gorhill Date: Mon, 23 Jun 2014 20:03:41 -0400 Subject: [PATCH] lnaguage stuff --- _locales/de/messages.json | 14 ++++++++++++++ _locales/en/messages.json | 16 +++++++++++++++- _locales/fr/messages.json | 18 ++++++++++++++++-- _locales/ru/messages.json | 14 ++++++++++++++ _locales/zh_CN/messages.json | 14 ++++++++++++++ js/i18n.js | 25 +++++++++++-------------- js/storage.js | 2 ++ popup.html | 11 ++++++----- 8 files changed, 92 insertions(+), 22 deletions(-) diff --git a/_locales/de/messages.json b/_locales/de/messages.json index 6b36759c5..e9751b777 100644 --- a/_locales/de/messages.json +++ b/_locales/de/messages.json @@ -21,6 +21,20 @@ }, + "popupBlockedRequestPrompt": { + "message": "requests blocked", + "description": "English: requests blocked" + }, + "popupBlockedOnThisPagePrompt": { + "message": "on this page", + "description": "English: on this page" + }, + "popupBlockedSinceInstallPrompt": { + "message": "since install", + "description": "English: since install" + }, + + "3pListsOfBlockedHostsPrompt2" : { "message": "{{ubiquitousBlacklistCount}} eindeutig blockierte Hostnamen aus:", "description": "English: {{ubiquitousBlacklistCount}} distinct blocked hostnames from:" diff --git a/_locales/en/messages.json b/_locales/en/messages.json index 1bc6bdd9e..854e23622 100644 --- a/_locales/en/messages.json +++ b/_locales/en/messages.json @@ -21,9 +21,23 @@ }, + "popupBlockedRequestPrompt": { + "message": "requests blocked", + "description": "English: requests blocked" + }, + "popupBlockedOnThisPagePrompt": { + "message": "on this page", + "description": "English: on this page" + }, + "popupBlockedSinceInstallPrompt": { + "message": "since install", + "description": "English: since install" + }, + + "3pListsOfBlockedHostsPrompt2" : { "message": "{{ubiquitousBlacklistCount}} network filters from:", - "description": "English: {{ubiquitousBlacklistCount}} distinct blocked hostnames from:" + "description": "English: {{ubiquitousBlacklistCount}} network filters from:" }, "3pListsOfBlockedHostsPerListStats" : { "message": "{{used}} used out of {{total}}", diff --git a/_locales/fr/messages.json b/_locales/fr/messages.json index 456d002a6..f955e6104 100644 --- a/_locales/fr/messages.json +++ b/_locales/fr/messages.json @@ -21,9 +21,23 @@ }, + "popupBlockedRequestPrompt": { + "message": "requêtes bloquées", + "description": "English: requests blocked" + }, + "popupBlockedOnThisPagePrompt": { + "message": "sur cette page", + "description": "English: on this page" + }, + "popupBlockedSinceInstallPrompt": { + "message": "depuis toujours", + "description": "English: since install" + }, + + "3pListsOfBlockedHostsPrompt2" : { - "message": "{{ubiquitousBlacklistCount}} hôtes actuellement bloqués :", - "description": "English: {{ubiquitousBlacklistCount}} distinct blocked hostnames from:" + "message": "{{ubiquitousBlacklistCount}} filtres actuellement en action :", + "description": "English: {{ubiquitousBlacklistCount}} network filters from:" }, "3pListsOfBlockedHostsPerListStats" : { "message": "{{used}} utilisés sur un total de {{total}}", diff --git a/_locales/ru/messages.json b/_locales/ru/messages.json index a6ef13076..6f400f081 100644 --- a/_locales/ru/messages.json +++ b/_locales/ru/messages.json @@ -21,6 +21,20 @@ }, + "popupBlockedRequestPrompt": { + "message": "requests blocked", + "description": "English: requests blocked" + }, + "popupBlockedOnThisPagePrompt": { + "message": "on this page", + "description": "English: on this page" + }, + "popupBlockedSinceInstallPrompt": { + "message": "since install", + "description": "English: since install" + }, + + "3pListsOfBlockedHostsPrompt2" : { "message": "{{ubiquitousBlacklistCount}} блокируется хостов, помимо:", "description": "English: {{ubiquitousBlacklistCount}} distinct blocked hostnames from:" diff --git a/_locales/zh_CN/messages.json b/_locales/zh_CN/messages.json index 9ae7f2e9a..78cff649c 100644 --- a/_locales/zh_CN/messages.json +++ b/_locales/zh_CN/messages.json @@ -21,6 +21,20 @@ }, + "popupBlockedRequestPrompt": { + "message": "requests blocked", + "description": "English: requests blocked" + }, + "popupBlockedOnThisPagePrompt": { + "message": "on this page", + "description": "English: on this page" + }, + "popupBlockedSinceInstallPrompt": { + "message": "since install", + "description": "English: since install" + }, + + "3pListsOfBlockedHostsPrompt2" : { "message": "共{{ubiquitousBlacklistCount}}个不同的屏蔽站点名,来自:", "description": "English: {{ubiquitousBlacklistCount}} distinct blocked hostnames from:" diff --git a/js/i18n.js b/js/i18n.js index c7d48bcd4..e664e949a 100644 --- a/js/i18n.js +++ b/js/i18n.js @@ -22,19 +22,16 @@ // Helper to deal with the i18n'ing of HTML files. // jQuery must be present at this point. -$(function() { - $('[data-i18n]').each(function() { - var me = $(this); - var key = me.data('i18n'); - me.html(chrome.i18n.getMessage(key)); - }); - // copy text of

if any to document title - document.title = $('h1').first().text(); +window.addEventListener('load', function() { + var i; + var fillin = function(elem) { + var key = elem.getAttribute("data-i18n"); + elem.innerHTML = chrome.i18n.getMessage(key); + } - // Tool tips - $('[data-i18n-tip]').each(function() { - var me = $(this); - var key = me.data('i18nTip'); - me.attr('data-tip', chrome.i18n.getMessage(key)); - }); + var elems = document.querySelectorAll('[data-i18n]'); + i = elems.length; + while ( i-- ) { + fillin(elems[i]); + } }); diff --git a/js/storage.js b/js/storage.js index 5dc5c3d3d..673a8fe43 100644 --- a/js/storage.js +++ b/js/storage.js @@ -284,6 +284,8 @@ if ( reAdblockFilter.test(line) ) { if ( abpFilters !== null ) { if ( abpFilters.add(line) ) { + thisListCount++; + thisListUsedCount++; continue; } } diff --git a/popup.html b/popup.html index d469ef7f1..62b1ba7a6 100644 --- a/popup.html +++ b/popup.html @@ -49,8 +49,8 @@ p { color: #ccc; } #options { - margin-bottom: 0; - font-size: smaller; + margin: 16px 0 0 0; + font-size: 12px; } .dim { color: #aaa; @@ -64,14 +64,15 @@ p {

µBlock

-

requests blocked

-

on this page

+

+

?

-

since install

+

?

Options

+