From 9d5921ae43fcf963503b0d3a26bce476ae1386ac Mon Sep 17 00:00:00 2001 From: ilyaigpetrov Date: Fri, 16 Aug 2019 16:35:09 +0000 Subject: [PATCH 1/5] Bump 0.0.1.36 --- .../chromium/runet-censorship-bypass/src/templates-data.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/extensions/chromium/runet-censorship-bypass/src/templates-data.js b/extensions/chromium/runet-censorship-bypass/src/templates-data.js index 65ecd98..a55ca7d 100644 --- a/extensions/chromium/runet-censorship-bypass/src/templates-data.js +++ b/extensions/chromium/runet-censorship-bypass/src/templates-data.js @@ -10,7 +10,7 @@ const pacUrls = [ ]; const commonContext = { - version: '1.35', + version: '1.36', anticensorityPacUrls: [ ...pacUrls, ], From 426793e70027296788e9a95c7de8dd3a484c2e0c Mon Sep 17 00:00:00 2001 From: ilyaigpetrov Date: Sat, 7 Sep 2019 15:28:47 +0000 Subject: [PATCH 2/5] Translate to en more of PAC choosing tab --- ...c-pac-script-with-pac-provider-api.tmpl.js | 66 +++++++++++++------ .../_locales/en/messages.tmpl.json | 39 +++++++++++ .../_locales/ru/messages.tmpl.json | 39 +++++++++++ .../options/src/components/LastUpdateDate.js | 22 +++---- 4 files changed, 136 insertions(+), 30 deletions(-) diff --git a/extensions/chromium/runet-censorship-bypass/src/extension-common/37-sync-pac-script-with-pac-provider-api.tmpl.js b/extensions/chromium/runet-censorship-bypass/src/extension-common/37-sync-pac-script-with-pac-provider-api.tmpl.js index d47a559..c637ac7 100644 --- a/extensions/chromium/runet-censorship-bypass/src/extension-common/37-sync-pac-script-with-pac-provider-api.tmpl.js +++ b/extensions/chromium/runet-censorship-bypass/src/extension-common/37-sync-pac-script-with-pac-provider-api.tmpl.js @@ -29,6 +29,8 @@ { // Private namespace starts. + const ifRu = chrome.i18n.getMessage('@@ui_locale').startsWith('ru'); + console.log('Russian?', ifRu); const mandatory = window.utils.mandatory; const throwIfError = window.utils.throwIfError; const chromified = window.utils.chromified; @@ -125,11 +127,17 @@ const pacMods = window.apis.pacKitchen.getPacMods(); if (!pacMods.filteredCustomsString) { addWarning( - \` - Не найдено СВОИХ прокси. Этот PAC-скрипт - работает только со СВОИМИ прокси - (по умолчанию будет использоваться локальный Tor). - \`, + ifRu + ? \` + Не найдено СВОИХ прокси. Этот PAC-скрипт + работает только со СВОИМИ прокси + (по умолчанию будет использоваться локальный Tor). + \` + : \` + Couldn't find OWN proxies. This PAC-script + works only with OWN proxies + (by default local Tor will be used). + \`, ); } @@ -142,8 +150,10 @@ if (ifWasEverModified) { addWarning( - 'Ваш PAC-скрипт не нуждается в обновлении. Его дата: ' + - lastModifiedStr, + (ifRu + ? 'Ваш PAC-скрипт не нуждается в обновлении. Его дата: ' + : 'Your PAC-script doesn\\'t need to be updated. It\\'s date: ' + ) + lastModifiedStr, ); const res = {lastModified: lastModifiedStr}; return cb(null, res); @@ -178,7 +188,7 @@ }, clarifyThen( - 'Не удалось скачать PAC-скрипт с адресов: [ ' + chrome.i18n.getMessage('FailedToDownloadPacScriptFromAddresses') + ': [ ' + provider.pacUrls.join(' , ') + ' ].', cb, ), @@ -199,20 +209,36 @@ // provider is this or that (distinct it from others). distinctKey: 'Antizapret', label: chrome.i18n.getMessage('Antizapret'), - desc: \`Альтернативный PAC-скрипт от стороннего разработчика. - Охватывет меньше сайтов. - Блокировка определяется по доменному имени. -
Сравнение PAC-скриптов.\`, + desc: ifRu + ? \`Основной PAC-скрипт от автора проекта «Антизапрет». + Охватывет меньше сайтов. + Блокировка определяется по доменному имени и при необходимости по IP. +
Сравнение PAC-скриптов. + \` + : \`The main PAC-script from the author of project "Antizapret"\. + Covers fewer sites. + Block is detected based on a domain name and, if necessary, on an IP. +
Comparison of PAC-scripts (ru). + \`, order: 0, pacUrls: ['https://antizapret.prostovpn.org/proxy.pac'], }, Антицензорити: { distinctKey: 'Anticensority', label: chrome.i18n.getMessage('Anticensority'), - desc: \`Основной PAC-скрипт от автора расширения. - Охватывает больше сайтов. - Блокировка определятся по доменному имени или IP адресу. -
Сравнение PAC-скриптов.\`, + desc: ifRu + ? \`Альтернативный PAC-скрипт от автора расширения. + Охватывает больше сайтов. + Блокировка определятся по доменному имени или IP адресу. + Подходит для провайдеров, блокирующих все сайты на одном IP. +
Сравнение PAC-скриптов. + \` + : \`Alternative PAC-script from the author of this extension. + Covers more sites. + Block is detected based on a domain name and on an IP address. + Better fits providers that block all sites on one IP. +
Comparison of PAC-scripts (ru). + \`, order: 1, /* @@ -225,7 +251,9 @@ onlyOwnSites: { distinctKey: 'onlyOwnSites', label: chrome.i18n.getMessage('Only_own_sites_and_only_own_proxies'), - desc: 'Проксируются только добавленные вручную сайты через СВОИ вручную добавленные прокси или через локальный Tor.', + desc: ifRu + ? 'Проксируются только добавленные вручную адреса через СВОИ вручную добавленные прокси или через локальный Tor.' + : 'Only added manually urls are proxied via your OWN manually added proxies or via Tor.', order: 99, pacUrls: [ 'data:application/x-ns-proxy-autoconfig,' + escape('function FindProxyForURL(){ return "DIRECT"; }'), @@ -258,7 +286,7 @@ const upDate = new Date(this.lastPacUpdateStamp).toLocaleString('ru-RU') .replace(/:\\d+$/, '').replace(/\\.\\d{4}/, ''); chrome.browserAction.setTitle({ - title: \`Обновлялись \${upDate} | Версия \${window.apis.version.build}\`, + title: \`\${chrome.i18n.getMessage('Updated')} \${upDate} | \${chrome.i18n.getMessage('Version')} \${window.apis.version.build}\`, }); }, @@ -353,7 +381,7 @@ if (key === null) { // No pac provider set. - return clarifyThen('Сперва выберите PAC-провайдера.', cb); + return clarifyThen(chrome.i18n.getMessage('ChoosePacProviderFirstD'), cb); } const pacProvider = this.getPacProvider(key); diff --git a/extensions/chromium/runet-censorship-bypass/src/extension-common/_locales/en/messages.tmpl.json b/extensions/chromium/runet-censorship-bypass/src/extension-common/_locales/en/messages.tmpl.json index 339d0d8..c423e08 100644 --- a/extensions/chromium/runet-censorship-bypass/src/extension-common/_locales/en/messages.tmpl.json +++ b/extensions/chromium/runet-censorship-bypass/src/extension-common/_locales/en/messages.tmpl.json @@ -17,6 +17,15 @@ "update": { "message": "update" }, + "Version": { + "message": "Version" + }, + "FailedToDownloadPacScriptFromAddresses": { + "message": "Failed to download PAC-script from addresses" + }, + "ChoosePacProviderFirstD": { + "message": "Choose PAC-provider first." + }, "ProblemsQ": { "message": "Problems?" }, @@ -58,5 +67,35 @@ }, "Donate": { "message": "Donate" + }, + "Updated": { + "message": "Updated" + }, + "ago": { + "message": "ago" + }, + "never": { + "message": "never" + }, + "ms": { + "message": "ms" + }, + "s": { + "message": "s" + }, + "min": { + "message": "min" + }, + "h": { + "message": "h" + }, + "d": { + "message": "d" + }, + "w": { + "message": "w" + }, + "m": { + "message": "m" } } diff --git a/extensions/chromium/runet-censorship-bypass/src/extension-common/_locales/ru/messages.tmpl.json b/extensions/chromium/runet-censorship-bypass/src/extension-common/_locales/ru/messages.tmpl.json index fbdc6aa..c6a28e6 100644 --- a/extensions/chromium/runet-censorship-bypass/src/extension-common/_locales/ru/messages.tmpl.json +++ b/extensions/chromium/runet-censorship-bypass/src/extension-common/_locales/ru/messages.tmpl.json @@ -17,6 +17,15 @@ "update": { "message": "обновить" }, + "Version": { + "message": "Версия" + }, + "FailedToDownloadPacScriptFromAddresses": { + "message": "Не удалось скачать PAC-скрипт с адресов" + }, + "ChoosePacProviderFirstD": { + "message": "Сперва выберите PAC-провайдера." + }, "ProblemsQ": { "message": "Проблемы?" }, @@ -58,5 +67,35 @@ }, "Donate": { "message": "Поддержать" + }, + "Updated": { + "message": "Обновлялись" + }, + "ago": { + "message": "назад" + }, + "never": { + "message": "никогда" + }, + "ms": { + "message": "мс" + }, + "s": { + "message": "с" + }, + "min": { + "message": "мин" + }, + "h": { + "message": "ч" + }, + "d": { + "message": "дн" + }, + "w": { + "message": " недель" + }, + "m": { + "message": " месяцев" } } diff --git a/extensions/chromium/runet-censorship-bypass/src/extension-common/pages/options/src/components/LastUpdateDate.js b/extensions/chromium/runet-censorship-bypass/src/extension-common/pages/options/src/components/LastUpdateDate.js index 2b2d75c..96a42b6 100644 --- a/extensions/chromium/runet-censorship-bypass/src/extension-common/pages/options/src/components/LastUpdateDate.js +++ b/extensions/chromium/runet-censorship-bypass/src/extension-common/pages/options/src/components/LastUpdateDate.js @@ -22,17 +22,17 @@ export default function getLastUpdateDate(theState) { getDate(antiCensorRu) { - let dateForUser = 'никогда'; + let dateForUser = chrome.i18n.getMessage('never'); if( antiCensorRu.lastPacUpdateStamp ) { let diff = Date.now() - antiCensorRu.lastPacUpdateStamp; - let units = 'мс'; + let units = chrome.i18n.getMessage('ms'); const gauges = [ - [1000, 'с'], - [60, 'мин'], - [60, 'ч'], - [24, 'дн'], - [7, ' недель'], - [4, ' месяцев'], + [1000, chrome.i18n.getMessage('s')], + [60, chrome.i18n.getMessage('min')], + [60, chrome.i18n.getMessage('h')], + [24, chrome.i18n.getMessage('d')], + [7, chrome.i18n.getMessage('w')], + [4, chrome.i18n.getMessage('m')], ]; for(const g of gauges) { const diffy = Math.floor(diff / g[0]); @@ -41,10 +41,10 @@ export default function getLastUpdateDate(theState) { diff = diffy; units = g[1]; } - dateForUser = diff + units + ' назад'; + dateForUser = diff + units + ' ' + chrome.i18n.getMessage('ago'); } return { - text: `${dateForUser} / ${antiCensorRu.pacUpdatePeriodInMinutes/60}ч`, + text: `${dateForUser} / ${antiCensorRu.pacUpdatePeriodInMinutes/60}${chrome.i18n.getMessage('h')}`, title: new Date(antiCensorRu.lastPacUpdateStamp).toLocaleString('ru-RU'), }; @@ -53,7 +53,7 @@ export default function getLastUpdateDate(theState) { render(props) { const date = this.getDate(props.apis.antiCensorRu); - return (
Обновлялись: { date.text }
); + return (
{chrome.i18n.getMessage('Updated')}: { date.text }
); } From 55b4ba385af27aca74f54ecf1b40d310506a18f0 Mon Sep 17 00:00:00 2001 From: ilyaigpetrov Date: Sat, 7 Sep 2019 15:53:38 +0000 Subject: [PATCH 3/5] Pac choosing tab is fully translated to en --- .../_locales/en/messages.tmpl.json | 24 +++++++++++++++++++ .../_locales/ru/messages.tmpl.json | 24 +++++++++++++++++++ .../options/src/components/PacChooser.js | 16 ++++++------- .../pages/options/src/globalCss.js | 2 ++ 4 files changed, 58 insertions(+), 8 deletions(-) diff --git a/extensions/chromium/runet-censorship-bypass/src/extension-common/_locales/en/messages.tmpl.json b/extensions/chromium/runet-censorship-bypass/src/extension-common/_locales/en/messages.tmpl.json index c423e08..542ca8e 100644 --- a/extensions/chromium/runet-censorship-bypass/src/extension-common/_locales/en/messages.tmpl.json +++ b/extensions/chromium/runet-censorship-bypass/src/extension-common/_locales/en/messages.tmpl.json @@ -17,9 +17,33 @@ "update": { "message": "update" }, + "UpdatingDDD": { + "message": "Updating..." + }, + "UpdatedD": { + "message": "Updated." + }, + "DisablingDDD": { + "message": "Disabling..." + }, + "DisabledD": { + "message": "Disabled." + }, + "InstallingDDD": { + "message": "Installing..." + }, + "PacScriptWasInstalledD": { + "message": "PAC-script was installed." + }, "Version": { "message": "Version" }, + "FullVersion": { + "message": "Full version" + }, + "VersionForSlowMachines": { + "message": "Version for slow machines" + }, "FailedToDownloadPacScriptFromAddresses": { "message": "Failed to download PAC-script from addresses" }, diff --git a/extensions/chromium/runet-censorship-bypass/src/extension-common/_locales/ru/messages.tmpl.json b/extensions/chromium/runet-censorship-bypass/src/extension-common/_locales/ru/messages.tmpl.json index c6a28e6..90363f2 100644 --- a/extensions/chromium/runet-censorship-bypass/src/extension-common/_locales/ru/messages.tmpl.json +++ b/extensions/chromium/runet-censorship-bypass/src/extension-common/_locales/ru/messages.tmpl.json @@ -17,9 +17,33 @@ "update": { "message": "обновить" }, + "UpdatingDDD": { + "message": "Обновляем..." + }, + "UpdatedD": { + "message": "Обновлено." + }, + "DisablingDDD": { + "message": "Отключение..." + }, + "DisabledD": { + "message": "Отключено." + }, + "InstallingDDD": { + "message": "Установка..." + }, + "PacScriptWasInstalledD": { + "message": "PAC-скрипт установлен." + }, "Version": { "message": "Версия" }, + "FullVersion": { + "message": "Полная версия" + }, + "VersionForSlowMachines": { + "message": "Версия для слабых машин" + }, "FailedToDownloadPacScriptFromAddresses": { "message": "Не удалось скачать PAC-скрипт с адресов" }, diff --git a/extensions/chromium/runet-censorship-bypass/src/extension-common/pages/options/src/components/PacChooser.js b/extensions/chromium/runet-censorship-bypass/src/extension-common/pages/options/src/components/PacChooser.js index b762fd9..a1cb92b 100644 --- a/extensions/chromium/runet-censorship-bypass/src/extension-common/pages/options/src/components/PacChooser.js +++ b/extensions/chromium/runet-censorship-bypass/src/extension-common/pages/options/src/components/PacChooser.js @@ -62,9 +62,9 @@ export default function getPacChooser(theState) { this.updatePac = function updatePac(onSuccess) { props.funs.conduct( - 'Обновляем...', + chrome.i18n.getMessage('UpdatingDDD'), (cb) => theState.apis.antiCensorRu.syncWithPacProviderAsync(cb), - 'Обновлено.', + chrome.i18n.getMessage('UpdatedD'), onSuccess ); }; @@ -101,17 +101,17 @@ export default function getPacChooser(theState) { } if (pacKey === 'none') { this.props.funs.conduct( - 'Отключение...', + chrome.i18n.getMessage('DisablingDDD'), (cb) => theState.apis.antiCensorRu.clearPacAsync(cb), - 'Отключено.', + chrome.i18n.getMessage('DisabledD'), () => this.setState({ chosenPacName: 'none' }), checkChosenProvider ); } else { this.props.funs.conduct( - 'Установка...', + chrome.i18n.getMessage('InstallingDDD'), (cb) => theState.apis.antiCensorRu.installPacAsync(pacKey, cb), - 'PAC-скрипт установлен.', + chrome.i18n.getMessage('PacScriptWasInstalledD'), checkChosenProvider ); } @@ -146,9 +146,9 @@ export default function getPacChooser(theState) { { props.flags.ifMini ? (🏋) + title={chrome.i18n.getMessage("FullVersion")}>🏋) : (🐌) + title={chrome.i18n.getMessage("VersionForSlowMachines")}>🐌) } diff --git a/extensions/chromium/runet-censorship-bypass/src/extension-common/pages/options/src/globalCss.js b/extensions/chromium/runet-censorship-bypass/src/extension-common/pages/options/src/globalCss.js index 589e3eb..010fb4d 100644 --- a/extensions/chromium/runet-censorship-bypass/src/extension-common/pages/options/src/globalCss.js +++ b/extensions/chromium/runet-censorship-bypass/src/extension-common/pages/options/src/globalCss.js @@ -32,9 +32,11 @@ export default function append(document, { flags }) { a:hover { text-decoration: underline; } + /* label { user-select: none; } + */ div, section, header, ul, ol { margin: 0; padding: 0; From 85edbf75b2834da7882af78c7e3c4a20a09193cd Mon Sep 17 00:00:00 2001 From: ilyaigpetrov Date: Sat, 7 Sep 2019 16:12:54 +0000 Subject: [PATCH 4/5] Translate to en more of exceptions editor tab --- .../_locales/en/messages.tmpl.json | 15 +++++++++++++++ .../_locales/ru/messages.tmpl.json | 15 +++++++++++++++ .../pages/options/src/components/ExcEditor.js | 10 +++++----- 3 files changed, 35 insertions(+), 5 deletions(-) diff --git a/extensions/chromium/runet-censorship-bypass/src/extension-common/_locales/en/messages.tmpl.json b/extensions/chromium/runet-censorship-bypass/src/extension-common/_locales/en/messages.tmpl.json index 542ca8e..c2951a1 100644 --- a/extensions/chromium/runet-censorship-bypass/src/extension-common/_locales/en/messages.tmpl.json +++ b/extensions/chromium/runet-censorship-bypass/src/extension-common/_locales/en/messages.tmpl.json @@ -121,5 +121,20 @@ }, "m": { "message": "m" + }, + "ProxyTheDomainNameBelowQ": { + "message": "Proxy the domain name below?" + }, + "auto": { + "message": "auto" + }, + "yes": { + "message": "yes" + }, + "no": { + "message": "no" + }, + "noOwnProxiesError": { + "message": "Proxying of OWN sites is possible only via OWN proxies. No own proxies found that satisfy your requirements." } } diff --git a/extensions/chromium/runet-censorship-bypass/src/extension-common/_locales/ru/messages.tmpl.json b/extensions/chromium/runet-censorship-bypass/src/extension-common/_locales/ru/messages.tmpl.json index 90363f2..15f8bb3 100644 --- a/extensions/chromium/runet-censorship-bypass/src/extension-common/_locales/ru/messages.tmpl.json +++ b/extensions/chromium/runet-censorship-bypass/src/extension-common/_locales/ru/messages.tmpl.json @@ -121,5 +121,20 @@ }, "m": { "message": " месяцев" + }, + "ProxyTheDomainNameBelowQ": { + "message": "Проксировать указанное доменное имя?" + }, + "auto": { + "message": "авто" + }, + "yes": { + "message": "да" + }, + "no": { + "message": "нет" + }, + "noOwnProxiesError": { + "message": "Проксировать СВОИ сайты можно только при наличии СВОИХ прокси. Нет своих прокси, удовлетворяющих вашим требованиям." } } diff --git a/extensions/chromium/runet-censorship-bypass/src/extension-common/pages/options/src/components/ExcEditor.js b/extensions/chromium/runet-censorship-bypass/src/extension-common/pages/options/src/components/ExcEditor.js index 4bf2dbe..42aa8d4 100644 --- a/extensions/chromium/runet-censorship-bypass/src/extension-common/pages/options/src/components/ExcEditor.js +++ b/extensions/chromium/runet-censorship-bypass/src/extension-common/pages/options/src/components/ExcEditor.js @@ -137,7 +137,7 @@ export default function getExcEditor(theState) { case 'this-no': if (ifYesClicked && !pacMods.filteredCustomsString) { this.props.funs.showErrors( new TypeError( - 'Проксировать СВОИ сайты можно только при наличии СВОИХ прокси. Нет своих прокси, удовлетворяющих вашим требованиям.' + chrome.i18n.getMessage('noOwnProxiesError'), )); return false; } @@ -293,7 +293,7 @@ export default function getExcEditor(theState) { return (
-
Проксировать указанный сайт?
+
{chrome.i18n.getMessage('ProxyTheDomainNameBelowQ')}
*.{' '} + style="position: relative; top: 0.15em;"> {chrome.i18n.getMessage('auto')}
  • {' '}
  • - {' '}
  • + {' '}
    ); From a6fd4d44f14080e91596aec3ac544a7b13d6fc5e Mon Sep 17 00:00:00 2001 From: ilyaigpetrov Date: Sat, 7 Sep 2019 16:36:51 +0000 Subject: [PATCH 5/5] Bump 0.0.1.37 --- .../chromium/runet-censorship-bypass/src/templates-data.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/extensions/chromium/runet-censorship-bypass/src/templates-data.js b/extensions/chromium/runet-censorship-bypass/src/templates-data.js index a55ca7d..2d26456 100644 --- a/extensions/chromium/runet-censorship-bypass/src/templates-data.js +++ b/extensions/chromium/runet-censorship-bypass/src/templates-data.js @@ -10,7 +10,7 @@ const pacUrls = [ ]; const commonContext = { - version: '1.36', + version: '1.37', anticensorityPacUrls: [ ...pacUrls, ],