From ec51e6c910e6f24b5949c352353af1d57bb0513f Mon Sep 17 00:00:00 2001 From: Zibi Braniecki Date: Thu, 5 Apr 2018 14:14:51 +0200 Subject: [PATCH] Bug 1451992 - Migrate Preferences::Subdialogs::Connection to Fluent. r=gijs,gandalf MozReview-Commit-ID: 6N4dE8V37l --- browser/components/preferences/connection.xul | 75 ++- .../preferences/in-content/main.xul | 40 +- .../preferences/in-content/preferences.xul | 5 +- browser/components/preferences/jar.mn | 2 +- .../en-US/browser/preferences/connection.ftl | 83 ++++ .../chrome/browser/preferences/connection.dtd | 49 -- .../en-US/chrome/browser/preferences/main.dtd | 1 - browser/locales/jar.mn | 2 - .../bug_1451992_preferences_connection.py | 467 ++++++++++++++++++ 9 files changed, 605 insertions(+), 119 deletions(-) create mode 100644 browser/locales/en-US/browser/preferences/connection.ftl delete mode 100644 browser/locales/en-US/chrome/browser/preferences/connection.dtd delete mode 100644 browser/locales/en-US/chrome/browser/preferences/main.dtd create mode 100644 python/l10n/fluent_migrations/bug_1451992_preferences_connection.py diff --git a/browser/components/preferences/connection.xul b/browser/components/preferences/connection.xul index 596fb0c2bd70..d41e25d44266 100644 --- a/browser/components/preferences/connection.xul +++ b/browser/components/preferences/connection.xul @@ -4,41 +4,30 @@ - License, v. 2.0. If a copy of the MPL was not distributed with this - file, You can obtain one at http://mozilla.org/MPL/2.0/. --> - - %preferencesDTD; - - %connectionDTD; - - %mainDTD; -]> - -#ifdef XP_MACOSX - style="width: &window.macWidth2; !important;"> -#else - style="width: &window.width2; !important;"> -#endif + + diff --git a/browser/components/preferences/jar.mn b/browser/components/preferences/jar.mn index 32954277a901..10dfeaec4ba6 100644 --- a/browser/components/preferences/jar.mn +++ b/browser/components/preferences/jar.mn @@ -12,7 +12,7 @@ browser.jar: content/browser/preferences/clearSiteData.xul * content/browser/preferences/colors.xul content/browser/preferences/colors.js -* content/browser/preferences/connection.xul + content/browser/preferences/connection.xul content/browser/preferences/connection.js content/browser/preferences/fonts.xul content/browser/preferences/fonts.js diff --git a/browser/locales/en-US/browser/preferences/connection.ftl b/browser/locales/en-US/browser/preferences/connection.ftl new file mode 100644 index 000000000000..f1b62e2adb7d --- /dev/null +++ b/browser/locales/en-US/browser/preferences/connection.ftl @@ -0,0 +1,83 @@ +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at http://mozilla.org/MPL/2.0/. + +connection-window = + .title = Connection Settings + .style = + { PLATFORM() -> + [macos] width: 44em + *[other] width: 49em + } + +connection-close-key = + .key = w + +connection-disable-extension = + .label = Disable Extension + +connection-proxy-configure = Configure Proxy Access to the Internet + +connection-proxy-option-no = + .label = No proxy + .accesskey = y +connection-proxy-option-system = + .label = Use system proxy settings + .accesskey = U +connection-proxy-option-auto = + .label = Auto-detect proxy settings for this network + .accesskey = w +connection-proxy-option-manual = + .label = Manual proxy configuration + .accesskey = M + +connection-proxy-http = HTTP Proxy + .accesskey = x +connection-proxy-http-port = Port + .accesskey = P +connection-proxy-http-share = + .label = Use this proxy server for all protocols + .accesskey = s + +connection-proxy-ssl = SSL Proxy + .accesskey = L +connection-proxy-ssl-port = Port + .accesskey = o + +connection-proxy-ftp = FTP Proxy + .accesskey = F +connection-proxy-ftp-port = Port + .accesskey = r + +connection-proxy-socks = SOCKS Host + .accesskey = C +connection-proxy-socks-port = Port + .accesskey = t + +connection-proxy-socks4 = + .label = SOCKS v4 + .accesskey = K +connection-proxy-socks5 = + .label = SOCKS v5 + .accesskey = v +connection-proxy-noproxy = No Proxy for + .accesskey = N + +connection-proxy-noproxy-desc = Example: .mozilla.org, .net.nz, 192.168.1.0/24 + +connection-proxy-autotype = + .label = Automatic proxy configuration URL + .accesskey = A + +connection-proxy-reload = + .label = Reload + .accesskey = e + +connection-proxy-autologin = + .label = Do not prompt for authentication if password is saved + .accesskey = i + .tooltip = This option silently authenticates you to proxies when you have saved credentials for them. You will be prompted if authentication fails. + +connection-proxy-socks-remote-dns = + .label = Proxy DNS when using SOCKS v5 + .accesskey = D diff --git a/browser/locales/en-US/chrome/browser/preferences/connection.dtd b/browser/locales/en-US/chrome/browser/preferences/connection.dtd deleted file mode 100644 index b57ee5d627c0..000000000000 --- a/browser/locales/en-US/chrome/browser/preferences/connection.dtd +++ /dev/null @@ -1,49 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/browser/locales/en-US/chrome/browser/preferences/main.dtd b/browser/locales/en-US/chrome/browser/preferences/main.dtd deleted file mode 100644 index e438ec2b1569..000000000000 --- a/browser/locales/en-US/chrome/browser/preferences/main.dtd +++ /dev/null @@ -1 +0,0 @@ - diff --git a/browser/locales/jar.mn b/browser/locales/jar.mn index f8aee3cf267a..7e2d47e0ab2e 100644 --- a/browser/locales/jar.mn +++ b/browser/locales/jar.mn @@ -56,11 +56,9 @@ locale/browser/migration/migration.dtd (%chrome/browser/migration/migration.dtd) locale/browser/migration/migration.properties (%chrome/browser/migration/migration.properties) locale/browser/preferences/clearSiteData.properties (%chrome/browser/preferences/clearSiteData.properties) - locale/browser/preferences/connection.dtd (%chrome/browser/preferences/connection.dtd) locale/browser/preferences/content.dtd (%chrome/browser/preferences/content.dtd) locale/browser/preferences/fonts.dtd (%chrome/browser/preferences/fonts.dtd) locale/browser/preferences/languages.dtd (%chrome/browser/preferences/languages.dtd) - locale/browser/preferences/main.dtd (%chrome/browser/preferences/main.dtd) locale/browser/preferences/permissions.dtd (%chrome/browser/preferences/permissions.dtd) locale/browser/preferences/preferences.properties (%chrome/browser/preferences/preferences.properties) locale/browser/preferences/privacy.dtd (%chrome/browser/preferences/privacy.dtd) diff --git a/python/l10n/fluent_migrations/bug_1451992_preferences_connection.py b/python/l10n/fluent_migrations/bug_1451992_preferences_connection.py new file mode 100644 index 000000000000..f6fc6afe72be --- /dev/null +++ b/python/l10n/fluent_migrations/bug_1451992_preferences_connection.py @@ -0,0 +1,467 @@ +# coding=utf8 + +# Any copyright is dedicated to the Public Domain. +# http://creativecommons.org/publicdomain/zero/1.0/ + +from __future__ import absolute_import +import fluent.syntax.ast as FTL +from fluent.migrate.helpers import MESSAGE_REFERENCE +from fluent.migrate import COPY, CONCAT, REPLACE + +def migrate(ctx): + """Bug 1451992 - Migrate Preferences::Subdialogs::Connection to Fluent, part {index}.""" + + ctx.add_transforms( + 'browser/browser/preferences/connection.ftl', + 'browser/browser/preferences/connection.ftl', + [ + FTL.Message( + id=FTL.Identifier('connection-window'), + attributes=[ + FTL.Attribute( + FTL.Identifier('title'), + COPY( + 'browser/chrome/browser/preferences/connection.dtd', + 'connectionsDialog.title' + ) + ), + FTL.Attribute( + FTL.Identifier('style'), + FTL.Pattern( + elements=[ + FTL.Placeable( + expression=FTL.SelectExpression( + expression=FTL.CallExpression( + callee=FTL.Function('PLATFORM') + ), + variants=[ + FTL.Variant( + key=FTL.VariantName('macos'), + default=False, + value=CONCAT( + FTL.TextElement('width: '), + COPY( + 'browser/chrome/browser/preferences/connection.dtd', + 'window.macWidth2' + ) + ) + ), + FTL.Variant( + key=FTL.VariantName('other'), + default=True, + value=CONCAT( + FTL.TextElement('width: '), + COPY( + 'browser/chrome/browser/preferences/connection.dtd', + 'window.width2' + ) + ) + ) + ] + ) + ) + ] + ) + ) + ] + ), + FTL.Message( + id=FTL.Identifier('connection-close-key'), + attributes=[ + FTL.Attribute( + FTL.Identifier('key'), + COPY( + 'toolkit/chrome/global/preferences.dtd', + 'windowClose.key' + ) + ) + ] + ), + FTL.Message( + id=FTL.Identifier('connection-disable-extension'), + attributes=[ + FTL.Attribute( + FTL.Identifier('label'), + COPY( + 'browser/chrome/browser/preferences/main.dtd', + 'disableExtension.label' + ) + ) + ] + ), + FTL.Message( + id=FTL.Identifier('connection-proxy-configure'), + value=COPY( + 'browser/chrome/browser/preferences/connection.dtd', + 'proxyTitle.label2' + ) + ), + FTL.Message( + id=FTL.Identifier('connection-proxy-option-no'), + attributes=[ + FTL.Attribute( + FTL.Identifier('label'), + COPY( + 'browser/chrome/browser/preferences/connection.dtd', + 'noProxyTypeRadio.label' + ) + ), + FTL.Attribute( + FTL.Identifier('accesskey'), + COPY( + 'browser/chrome/browser/preferences/connection.dtd', + 'noProxyTypeRadio.accesskey' + ) + ) + ] + ), + FTL.Message( + id=FTL.Identifier('connection-proxy-option-system'), + attributes=[ + FTL.Attribute( + FTL.Identifier('label'), + COPY( + 'browser/chrome/browser/preferences/connection.dtd', + 'systemTypeRadio.label' + ) + ), + FTL.Attribute( + FTL.Identifier('accesskey'), + COPY( + 'browser/chrome/browser/preferences/connection.dtd', + 'systemTypeRadio.accesskey' + ) + ) + ] + ), + FTL.Message( + id=FTL.Identifier('connection-proxy-option-auto'), + attributes=[ + FTL.Attribute( + FTL.Identifier('label'), + COPY( + 'browser/chrome/browser/preferences/connection.dtd', + 'WPADTypeRadio.label' + ) + ), + FTL.Attribute( + FTL.Identifier('accesskey'), + COPY( + 'browser/chrome/browser/preferences/connection.dtd', + 'WPADTypeRadio.accesskey' + ) + ) + ] + ), + FTL.Message( + id=FTL.Identifier('connection-proxy-option-manual'), + attributes=[ + FTL.Attribute( + FTL.Identifier('label'), + COPY( + 'browser/chrome/browser/preferences/connection.dtd', + 'manualTypeRadio2.label' + ) + ), + FTL.Attribute( + FTL.Identifier('accesskey'), + COPY( + 'browser/chrome/browser/preferences/connection.dtd', + 'manualTypeRadio2.accesskey' + ) + ) + ] + ), + FTL.Message( + id=FTL.Identifier('connection-proxy-http'), + value=COPY( + 'browser/chrome/browser/preferences/connection.dtd', + 'http2.label' + ), + attributes=[ + FTL.Attribute( + FTL.Identifier('accesskey'), + COPY( + 'browser/chrome/browser/preferences/connection.dtd', + 'http2.accesskey' + ) + ) + ] + ), + FTL.Message( + id=FTL.Identifier('connection-proxy-http-port'), + value=COPY( + 'browser/chrome/browser/preferences/connection.dtd', + 'port2.label' + ), + attributes=[ + FTL.Attribute( + FTL.Identifier('accesskey'), + COPY( + 'browser/chrome/browser/preferences/connection.dtd', + 'HTTPport.accesskey' + ) + ) + ] + ), + FTL.Message( + id=FTL.Identifier('connection-proxy-http-share'), + attributes=[ + FTL.Attribute( + FTL.Identifier('label'), + COPY( + 'browser/chrome/browser/preferences/connection.dtd', + 'shareproxy.label' + ) + ), + FTL.Attribute( + FTL.Identifier('accesskey'), + COPY( + 'browser/chrome/browser/preferences/connection.dtd', + 'shareproxy.accesskey' + ) + ) + ] + ), + FTL.Message( + id=FTL.Identifier('connection-proxy-ssl'), + value=COPY( + 'browser/chrome/browser/preferences/connection.dtd', + 'ssl2.label' + ), + attributes=[ + FTL.Attribute( + FTL.Identifier('accesskey'), + COPY( + 'browser/chrome/browser/preferences/connection.dtd', + 'ssl2.accesskey' + ) + ) + ] + ), + FTL.Message( + id=FTL.Identifier('connection-proxy-ssl-port'), + value=COPY( + 'browser/chrome/browser/preferences/connection.dtd', + 'port2.label' + ), + attributes=[ + FTL.Attribute( + FTL.Identifier('accesskey'), + COPY( + 'browser/chrome/browser/preferences/connection.dtd', + 'SSLport.accesskey' + ) + ) + ] + ), + FTL.Message( + id=FTL.Identifier('connection-proxy-ftp'), + value=COPY( + 'browser/chrome/browser/preferences/connection.dtd', + 'ftp2.label' + ), + attributes=[ + FTL.Attribute( + FTL.Identifier('accesskey'), + COPY( + 'browser/chrome/browser/preferences/connection.dtd', + 'ftp2.accesskey' + ) + ) + ] + ), + FTL.Message( + id=FTL.Identifier('connection-proxy-ftp-port'), + value=COPY( + 'browser/chrome/browser/preferences/connection.dtd', + 'port2.label' + ), + attributes=[ + FTL.Attribute( + FTL.Identifier('accesskey'), + COPY( + 'browser/chrome/browser/preferences/connection.dtd', + 'FTPport.accesskey' + ) + ) + ] + ), + FTL.Message( + id=FTL.Identifier('connection-proxy-socks'), + value=COPY( + 'browser/chrome/browser/preferences/connection.dtd', + 'socks2.label' + ), + attributes=[ + FTL.Attribute( + FTL.Identifier('accesskey'), + COPY( + 'browser/chrome/browser/preferences/connection.dtd', + 'socks2.accesskey' + ) + ) + ] + ), + FTL.Message( + id=FTL.Identifier('connection-proxy-socks-port'), + value=COPY( + 'browser/chrome/browser/preferences/connection.dtd', + 'port2.label' + ), + attributes=[ + FTL.Attribute( + FTL.Identifier('accesskey'), + COPY( + 'browser/chrome/browser/preferences/connection.dtd', + 'SOCKSport.accesskey' + ) + ) + ] + ), + FTL.Message( + id=FTL.Identifier('connection-proxy-socks4'), + attributes=[ + FTL.Attribute( + FTL.Identifier('label'), + COPY( + 'browser/chrome/browser/preferences/connection.dtd', + 'socks4.label' + ) + ), + FTL.Attribute( + FTL.Identifier('accesskey'), + COPY( + 'browser/chrome/browser/preferences/connection.dtd', + 'socks4.accesskey' + ) + ) + ] + ), + FTL.Message( + id=FTL.Identifier('connection-proxy-socks5'), + attributes=[ + FTL.Attribute( + FTL.Identifier('label'), + COPY( + 'browser/chrome/browser/preferences/connection.dtd', + 'socks5.label' + ) + ), + FTL.Attribute( + FTL.Identifier('accesskey'), + COPY( + 'browser/chrome/browser/preferences/connection.dtd', + 'socks5.accesskey' + ) + ) + ] + ), + FTL.Message( + id=FTL.Identifier('connection-proxy-noproxy'), + value=COPY( + 'browser/chrome/browser/preferences/connection.dtd', + 'noproxy2.label' + ), + attributes=[ + FTL.Attribute( + FTL.Identifier('accesskey'), + COPY( + 'browser/chrome/browser/preferences/connection.dtd', + 'noproxy2.accesskey' + ) + ) + ] + ), + FTL.Message( + id=FTL.Identifier('connection-proxy-noproxy-desc'), + value=COPY( + 'browser/chrome/browser/preferences/connection.dtd', + 'noproxyExplain.label' + ) + ), + FTL.Message( + id=FTL.Identifier('connection-proxy-autotype'), + attributes=[ + FTL.Attribute( + FTL.Identifier('label'), + COPY( + 'browser/chrome/browser/preferences/connection.dtd', + 'autoTypeRadio2.label' + ) + ), + FTL.Attribute( + FTL.Identifier('accesskey'), + COPY( + 'browser/chrome/browser/preferences/connection.dtd', + 'autoTypeRadio2.accesskey' + ) + ) + ] + ), + FTL.Message( + id=FTL.Identifier('connection-proxy-reload'), + attributes=[ + FTL.Attribute( + FTL.Identifier('label'), + COPY( + 'browser/chrome/browser/preferences/connection.dtd', + 'reload.label' + ) + ), + FTL.Attribute( + FTL.Identifier('accesskey'), + COPY( + 'browser/chrome/browser/preferences/connection.dtd', + 'reload.accesskey' + ) + ) + ] + ), + FTL.Message( + id=FTL.Identifier('connection-proxy-autologin'), + attributes=[ + FTL.Attribute( + FTL.Identifier('label'), + COPY( + 'browser/chrome/browser/preferences/connection.dtd', + 'autologinproxy.label' + ) + ), + FTL.Attribute( + FTL.Identifier('accesskey'), + COPY( + 'browser/chrome/browser/preferences/connection.dtd', + 'autologinproxy.accesskey' + ) + ), + FTL.Attribute( + FTL.Identifier('tooltip'), + COPY( + 'browser/chrome/browser/preferences/connection.dtd', + 'autologinproxy.tooltip' + ) + ) + ] + ), + FTL.Message( + id=FTL.Identifier('connection-proxy-socks-remote-dns'), + attributes=[ + FTL.Attribute( + FTL.Identifier('label'), + COPY( + 'browser/chrome/browser/preferences/connection.dtd', + 'socksRemoteDNS.label2' + ) + ), + FTL.Attribute( + FTL.Identifier('accesskey'), + COPY( + 'browser/chrome/browser/preferences/connection.dtd', + 'socksRemoteDNS.accesskey' + ) + ) + ] + ) + ] + )