diff --git a/.coveragerc b/.coveragerc index 32b3657dc0..08906cb916 100644 --- a/.coveragerc +++ b/.coveragerc @@ -18,8 +18,6 @@ omit = tests/* venv/* wsgi/* - # There are no unit tests for this dir, and it is slated for removal anyway: - lib/fluent_migrations* [report] exclude_lines = diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 55f7e890f0..1759eae8c6 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -42,9 +42,6 @@ update-l10n: - "l10n/**/*" refs: - master - except: - changes: - - "lib/fluent_migrations/**/*" script: - bin/open-ftl-pr.sh retry: 2 diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index b54c1f3238..56c742017c 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -8,7 +8,6 @@ exclude: > | static | bedrock/externalfiles/files_cache | git-repos - | lib/fluent_migrations ) repos: # Note: hooks that add content must run before ones which check formatting, lint, etc diff --git a/bedrock/base/templates/base-protocol.html b/bedrock/base/templates/base-protocol.html index 48fad0eb1c..b5090bc1ae 100644 --- a/bedrock/base/templates/base-protocol.html +++ b/bedrock/base/templates/base-protocol.html @@ -4,7 +4,6 @@ file, You can obtain one at https://mozilla.org/MPL/2.0/. #} -{% set_lang_files "main" %} {# Note the "windows" class, without javascript platform-specific assets default to windows #} diff --git a/bedrock/base/views.py b/bedrock/base/views.py index dd1770ea1a..2f011fce6d 100644 --- a/bedrock/base/views.py +++ b/bedrock/base/views.py @@ -57,14 +57,8 @@ S3_BASE_URL = "https://s3-{}.amazonaws.com/{}".format( def get_l10n_repo_info(): - repo = git.GitRepo(settings.LOCALES_PATH, settings.LOCALES_REPO) fluent_repo = git.GitRepo(settings.FLUENT_REPO_PATH, settings.FLUENT_REPO_URL) return ( - { - "latest_ref": repo.current_hash, - "last_updated": repo.last_updated, - "repo_url": repo.clean_remote_url, - }, { "latest_ref": fluent_repo.current_hash, "last_updated": fluent_repo.last_updated, diff --git a/bedrock/firefox/templates/firefox/set-as-default/landing.html b/bedrock/firefox/templates/firefox/set-as-default/landing.html index dc2ad41f83..5b257511d1 100644 --- a/bedrock/firefox/templates/firefox/set-as-default/landing.html +++ b/bedrock/firefox/templates/firefox/set-as-default/landing.html @@ -34,7 +34,6 @@ {% endcall %} {% endblock %} diff --git a/bedrock/firefox/templates/firefox/welcome/page1.html b/bedrock/firefox/templates/firefox/welcome/page1.html index 8b24d442f7..e819ef513e 100644 --- a/bedrock/firefox/templates/firefox/welcome/page1.html +++ b/bedrock/firefox/templates/firefox/welcome/page1.html @@ -19,13 +19,8 @@ {% set _utm_campaign = 'welcome-1-monitor' %} {% set _cta_type = 'lifecycle-monitor' %} -{% if l10n_has_tag('monitor_title_30102019') %} - {% set hero_title = ftl('welcome-page1-stay-ahead-of-hackers-check') %} - {% set _utm_content = 'stay-ahead-hackers' %} -{% else %} - {% set hero_title = ftl('welcome-page1-youre-on-track-to-stay-protected') %} - {% set _utm_content = 'on-track-protected' %} -{% endif %} +{% set hero_title = ftl('welcome-page1-stay-ahead-of-hackers-check') %} +{% set _utm_content = 'stay-ahead-hackers' %} {% block content_intro %} {% call hero( diff --git a/bedrock/firefox/views.py b/bedrock/firefox/views.py index b8e5f41719..765eeb5e28 100644 --- a/bedrock/firefox/views.py +++ b/bedrock/firefox/views.py @@ -41,8 +41,7 @@ from bedrock.newsletter.forms import NewsletterFooterForm from bedrock.products.forms import VPNWaitlistForm from bedrock.releasenotes import version_re from lib import l10n_utils -from lib.l10n_utils import L10nTemplateView -from lib.l10n_utils.dotlang import get_translations_native_names +from lib.l10n_utils import L10nTemplateView, get_translations_native_names from lib.l10n_utils.fluent import ftl, ftl_file_is_active UA_REGEXP = re.compile(r"Firefox/(%s)" % version_re) diff --git a/bedrock/foundation/templates/foundation/annualreport/2011.html b/bedrock/foundation/templates/foundation/annualreport/2011.html index afcc46cf8b..05cb2b3729 100644 --- a/bedrock/foundation/templates/foundation/annualreport/2011.html +++ b/bedrock/foundation/templates/foundation/annualreport/2011.html @@ -6,8 +6,6 @@ {% extends "base-article.html" %} -{% add_lang_files "foundation/annualreport/2011faq" %} - {% block page_title %}{{ _('The State of Mozilla: 2011 Annual Report') }}{% endblock %} {% block body_id %}annual-2011{% endblock %} {% block body_class %}mzp-t-mozilla{% endblock %} diff --git a/bedrock/foundation/templates/foundation/annualreport/2011faq.html b/bedrock/foundation/templates/foundation/annualreport/2011faq.html index 019920dbcc..65a3be5aaa 100644 --- a/bedrock/foundation/templates/foundation/annualreport/2011faq.html +++ b/bedrock/foundation/templates/foundation/annualreport/2011faq.html @@ -6,8 +6,6 @@ {% extends "base-article.html" %} -{% add_lang_files "foundation/annualreport/2011" %} - {% block page_title %}{{ _('The State of Mozilla: 2011 Annual Report') }} | {{ _('Frequently Asked Questions') }}{% endblock %} {% block body_id %}annual-2011{% endblock %} {% block body_class %}mzp-t-mozilla{% endblock %} diff --git a/bedrock/foundation/templates/foundation/annualreport/2012/faq.html b/bedrock/foundation/templates/foundation/annualreport/2012/faq.html index ce27402785..84b2e8a9e6 100644 --- a/bedrock/foundation/templates/foundation/annualreport/2012/faq.html +++ b/bedrock/foundation/templates/foundation/annualreport/2012/faq.html @@ -6,8 +6,6 @@ {% extends "base-protocol-mozilla.html" %} -{% add_lang_files "foundation/annualreport/2012/index" %} - {% block page_title %}{{ _('The State of Mozilla: 2012 Annual Report') }} | {{ _('Frequently Asked Questions') }}{% endblock %} {% block body_id %}annual-2012{% endblock %} diff --git a/bedrock/foundation/templates/foundation/annualreport/2013/faq.html b/bedrock/foundation/templates/foundation/annualreport/2013/faq.html index c6abd75023..0d2eecefa8 100644 --- a/bedrock/foundation/templates/foundation/annualreport/2013/faq.html +++ b/bedrock/foundation/templates/foundation/annualreport/2013/faq.html @@ -6,8 +6,6 @@ {% extends "base-protocol-mozilla.html" %} -{% add_lang_files "foundation/annualreport/2013/index" %} - {% block page_title %}{{ _('The State of Mozilla: 2013 Annual Report') }} | {{ _('Frequently Asked Questions') }}{% endblock %} {% block body_id %}annual-2013{% endblock %} diff --git a/bedrock/foundation/templates/foundation/annualreport/2014/faq.html b/bedrock/foundation/templates/foundation/annualreport/2014/faq.html index 0445ad14b8..0e09c38770 100644 --- a/bedrock/foundation/templates/foundation/annualreport/2014/faq.html +++ b/bedrock/foundation/templates/foundation/annualreport/2014/faq.html @@ -6,8 +6,6 @@ {% extends "base-protocol-mozilla.html" %} -{% add_lang_files "foundation/annualreport/2014/index" %} - {% block page_title %}{{ _('The State of Mozilla: 2014 Annual Report') }} | {{ _('Frequently Asked Questions') }}{% endblock %} {% block body_id %}annual-2014{% endblock %} diff --git a/bedrock/foundation/templates/foundation/annualreport/2015/faq.html b/bedrock/foundation/templates/foundation/annualreport/2015/faq.html index 8883a23f6f..802029be61 100644 --- a/bedrock/foundation/templates/foundation/annualreport/2015/faq.html +++ b/bedrock/foundation/templates/foundation/annualreport/2015/faq.html @@ -6,8 +6,6 @@ {% extends "base-protocol-mozilla.html" %} -{% add_lang_files "foundation/annualreport/2015/index" %} - {% block page_title %}{{ _('The State of Mozilla: 2015 Annual Report') }} | {{ _('Frequently Asked Questions') }}{% endblock %} {% block body_id %}annual-2015{% endblock %} diff --git a/bedrock/foundation/templates/foundation/annualreport/2017/index.html b/bedrock/foundation/templates/foundation/annualreport/2017/index.html index 9313f6f5e5..3a05c8d70a 100644 --- a/bedrock/foundation/templates/foundation/annualreport/2017/index.html +++ b/bedrock/foundation/templates/foundation/annualreport/2017/index.html @@ -307,20 +307,9 @@ {% set lockwise='https://testpilot.firefox.com/experiments/firefox-lockbox/' %} {% set lockbox=lockwise %} - {% if l10n_has_tag('lockwise_update_201906') %} - {% trans vpn=vpn, lockwise=lockwise %} - The overhaul of our core browser has given Mozilla Corporation the ability to begin the exploration of new user engagement and revenue models derived from Firefox to meet these ambitious goals. Specifically in 2018 we began testing in Firefox a new paid virtual private network (VPN) service and a password manager called Lockwise which is currently being offered for free. Over time, with deep engagement with our users, we expect to offer premium solutions. - {% endtrans %} - {% else %} - {% trans vpn=vpn, lockbox=lockbox %} - The overhaul of our core browser has given Mozilla Corporation the ability to begin the exploration - of new user engagement and revenue models derived from Firefox to meet these ambitious goals. - Specifically in 2018 we began testing in Firefox a new paid virtual private network - (VPN) service and a password manager called Lockbox - which is currently being offered for free. Over time, with deep engagement with our users, we expect - to offer premium solutions. - {% endtrans %} - {% endif %} + {% trans vpn=vpn, lockwise=lockwise %} + The overhaul of our core browser has given Mozilla Corporation the ability to begin the exploration of new user engagement and revenue models derived from Firefox to meet these ambitious goals. Specifically in 2018 we began testing in Firefox a new paid virtual private network (VPN) service and a password manager called Lockwise which is currently being offered for free. Over time, with deep engagement with our users, we expect to offer premium solutions. + {% endtrans %}

{% trans sponsored='https://blog.mozilla.org/futurereleases/2018/04/30/a-privacy-conscious-approach-to-sponsored-content/' %} diff --git a/bedrock/foundation/templates/foundation/base.html b/bedrock/foundation/templates/foundation/base.html index c3e21d400a..4c3494da24 100644 --- a/bedrock/foundation/templates/foundation/base.html +++ b/bedrock/foundation/templates/foundation/base.html @@ -4,7 +4,6 @@ file, You can obtain one at https://mozilla.org/MPL/2.0/. #} -{% set_lang_files "foundation/index" %} {% extends "base-article.html" %} {% block page_title_suffix %}{% endblock %} diff --git a/bedrock/foundation/templates/foundation/trademarks/policy.html b/bedrock/foundation/templates/foundation/trademarks/policy.html index 7d53da09cd..cf0e51ca46 100644 --- a/bedrock/foundation/templates/foundation/trademarks/policy.html +++ b/bedrock/foundation/templates/foundation/trademarks/policy.html @@ -118,9 +118,7 @@ - {% if l10n_has_tag('trademarks-policy-0918') %}

{{ _(' For example, you cannot name your add-on “Firefox NewGadget Extension”. However, it would be acceptable to name your add-on "NewGadget Extension for Firefox”.') }}

- {% endif %}

{{ _('Social Media Guidelines') }}

diff --git a/bedrock/mozorg/templates/mozorg/about-base.html b/bedrock/mozorg/templates/mozorg/about-base.html index f8b40bdcd4..27b5ef448b 100644 --- a/bedrock/mozorg/templates/mozorg/about-base.html +++ b/bedrock/mozorg/templates/mozorg/about-base.html @@ -4,7 +4,6 @@ file, You can obtain one at https://mozilla.org/MPL/2.0/. #} -{%- set_lang_files "main" -%} {% extends "base-article.html" %} {% set navigation_bar = [ diff --git a/bedrock/mozorg/templates/mozorg/about/manifesto.html b/bedrock/mozorg/templates/mozorg/about/manifesto.html index 3fd854dd88..15419fa00c 100644 --- a/bedrock/mozorg/templates/mozorg/about/manifesto.html +++ b/bedrock/mozorg/templates/mozorg/about/manifesto.html @@ -8,8 +8,6 @@ {% extends "base-protocol-mozilla.html" %} -{% set_lang_files "mozorg/about/manifesto" %} - {% from 'macros.html' import twitter_share_url with context %} {% block page_title %}{{ ftl('manifesto-details-the-mozilla-manifesto') }}{% endblock %} diff --git a/bedrock/newsletter/tests/test_footer_form.py b/bedrock/newsletter/tests/test_footer_form.py index 5e5390316b..45e5084229 100644 --- a/bedrock/newsletter/tests/test_footer_form.py +++ b/bedrock/newsletter/tests/test_footer_form.py @@ -12,7 +12,6 @@ from bedrock.mozorg.tests import TestCase @patch("bedrock.newsletter.forms.get_lang_choices", lambda *x: [["en", "English"], ["fr", "French"], ["pt", "Portuguese"]]) -@patch("lib.l10n_utils.translations_for_template", lambda *x: ["en-US", "fr", "pt-BR", "af"]) class TestNewsletterFooter(TestCase): def setUp(self): self.view_name = "newsletter.subscribe" diff --git a/bedrock/settings/base.py b/bedrock/settings/base.py index 4cd7775425..bca8bf864d 100644 --- a/bedrock/settings/base.py +++ b/bedrock/settings/base.py @@ -224,14 +224,9 @@ PROD_LANGUAGES = ( "zu", ) -LOCALES_PATH = DATA_PATH / "locale" -default_locales_repo = "www.mozilla.org" if DEV else "bedrock-l10n" -default_locales_repo = "https://github.com/mozilla-l10n/{}".format(default_locales_repo) -LOCALES_REPO = config("LOCALES_REPO", default=default_locales_repo) GITHUB_REPO = "https://github.com/mozilla/bedrock" # Global L10n files. -DOTLANG_FILES = ["main"] FLUENT_DEFAULT_FILES = [ "banners/firefox-app-store", "banners/fundraising", @@ -268,8 +263,6 @@ FLUENT_PATHS = [ # remote FTL files from l10n team FLUENT_REPO_PATH, ] -FLUENT_MIGRATIONS = "lib.fluent_migrations" -FLUENT_MIGRATIONS_PATH = ROOT_PATH / "lib" / "fluent_migrations" # templates to exclude from having an "edit this page" link in the footer # these are typically ones for which most of the content is in the DB @@ -502,22 +495,6 @@ PROJECT_MODULE = "bedrock" ROOT_URLCONF = "bedrock.urls" -# Tells the extract script what files to look for L10n in and what function -# handles the extraction. -PUENTE = { - "BASE_DIR": ROOT, - "PROJECT": "Bedrock", - "MSGID_BUGS_ADDRESS": "https://bugzilla.mozilla.org/enter_bug.cgi?product=www.mozilla.org&component=L10N", - "DOMAIN_METHODS": { - "django": [ - ("bedrock/**.py", "lib.l10n_utils.extract.extract_python"), - ("bedrock/**/templates/**.html", "lib.l10n_utils.extract.extract_jinja2"), - ("bedrock/**/templates/**.js", "lib.l10n_utils.extract.extract_jinja2"), - ("bedrock/**/templates/**.jsonp", "lib.l10n_utils.extract.extract_jinja2"), - ], - }, -} - def get_app_name(hostname): """ @@ -573,7 +550,6 @@ INSTALLED_APPS = ( # Third-party apps, patches, fixes "commonware.response.cookies", # L10n - "puente", # for ./manage.py extract "product_details", # third-party apps "django_jinja_markdown", @@ -652,12 +628,9 @@ WATCHMAN_CHECKS = ( "watchman.checks.databases", ) -LOCALE_PATHS = (str(LOCALES_PATH),) - TEMPLATES = [ { "BACKEND": "django_jinja.backend.Jinja2", - "DIRS": LOCALE_PATHS, "APP_DIRS": True, "OPTIONS": { "match_extension": None, @@ -690,8 +663,6 @@ TEMPLATES = [ "django_jinja.builtins.extensions.StaticFilesExtension", "django_jinja.builtins.extensions.DjangoFiltersExtension", "lib.l10n_utils.template.i18n", - "lib.l10n_utils.template.l10n_blocks", - "lib.l10n_utils.template.lang_blocks", "django_jinja_markdown.extensions.MarkdownExtension", ], }, diff --git a/bin/compile-mo.sh b/bin/compile-mo.sh deleted file mode 100755 index 88f2ea16bf..0000000000 --- a/bin/compile-mo.sh +++ /dev/null @@ -1,32 +0,0 @@ -#!/bin/bash -# 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 https://mozilla.org/MPL/2.0/. - - -TARGET=$1 -LOCKFILE="/tmp/compile-mo-${2}.lock" - -function usage() { - echo "syntax:" - echo " compile-mo.sh locale-dir/ [unique]" - echo "unique is an optional string that will be used as the name of the lockfile" - exit 1 -} - -# check if file and dir are there -if [[ ($# -gt 2) || (! -d "$TARGET") ]]; then usage; fi - -# check if the lockfile exists -if [ -e $LOCKFILE ]; then - echo "$LOCKFILE present, exiting" - exit 99 -fi - -touch $LOCKFILE -for lang in `find $TARGET -type f -name "*.po"`; do - dir=`dirname $lang` - stem=`basename $lang .po` - msgfmt -o ${dir}/${stem}.mo $lang -done -rm $LOCKFILE diff --git a/docs/fluent-conversion.rst b/docs/fluent-conversion.rst deleted file mode 100644 index 35c29e7a39..0000000000 --- a/docs/fluent-conversion.rst +++ /dev/null @@ -1,210 +0,0 @@ -.. 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 https://mozilla.org/MPL/2.0/. - -.. _fluent: - -====================== -L10n Fluent Conversion -====================== - -There are some tools that exist now but are only useful during our conversion -from .lang to .ftl files. This document will cover the usage of these. - -If you've got a translated page you'd like to convert as-is to the Fluent system -then you can follow this procedure to get a big head start. - -The key concept in converting a page to Fluent is a recipe. The recipe is a -piece of python code that can programmatically generate a Fluent file. It can -use existing Fluent files as templates, and .lang localizations as data sources. - -All the functionality is provided by the ``fluent`` management command via -subcommands for each phase. - -Create a recipe from a template -=============================== - -The first step is to create the recipe. Let's say you want to convert -``bedrock/mozorg/templates/mozorg/mission.html``, then you'll run - - -.. code-block:: bash - - $ make run-shell - -.. code-block:: bash - - $ ./manage.py fluent recipe bedrock/mozorg/templates/mozorg/mission.html - -This will parse all of the calls to ``_()`` and the ``trans`` blocks, process the strings in the -same way the old string extraction process did, and create new Fluent string IDs. -It will generate the recipe in ``lib/fluent_migrations/mozorg/mission.py``. The recipe name is based -on the template name after ``templates``. - -Sanitize recipe -=============== - -The recipe creates migrations for each localizable string in the template, -with some possibly bad string IDs. At this point, you want to change -the IDs to be conforming with the best practices laid out in the l10n docs. -The existing recipe will already have the template name as prefix, though. - -You can also choose to remove strings from the conversion, if you just -want to convert a subset of the strings. - -The migrations will automatically add ``REPLACE()`` helpers when it detects -that any of the strings in ``brands.ftl`` are in the text. Make sure these -are correct, and remove any of them that shouldn't be used. If you need -to add any that it missed they should look like the following: - -.. code-block:: python - - ctx.add_transforms( - "firefox/switch.ftl", - "firefox/switch.ftl", - [ - FTL.Message( - id=FTL.Identifier("switch-switching-to-firefox-is-fast"), - value=REPLACE( - "firefox/switch.lang", - "Switching to Firefox is fast, easy and risk-free, because Firefox imports your bookmarks, autofills, passwords and preferences from Chrome.", - { - "Firefox": TERM_REFERENCE("brand-name-firefox"), - "Chrome": TERM_REFERENCE("brand-name-chrome") - } - ) - ), - ] - ) - -Once you're happy with the recipe, you can create the Fluent files and the template. - -Convert a .lang file to English .ftl -==================================== - -The next step is to convert an existing english .lang file into an equivalent -.ftl file in the ``en`` folder of the ``l10n`` directory in bedrock. Let's -continue with the example of ``mission.html``; you would run: - -.. code-block:: bash - - $ make run-shell - -.. code-block:: bash - - $ ./manage.py fluent ftl bedrock/mozorg/templates/mozorg/mission.html - -This should create ``l10n/en/mozorg/mission.ftl`` which has all of the strings -in the order in which they appear in the template. - -You want to sanitize this Fluent file by adding license headers, file comments -with staging URLs, as well as comments individual strings or groups of strings. - -It's a good idea to add the new Fluent file to a project config, and validate -it for errors like duplicated IDs. - -.. code-block:: bash - - $ moz-l10n-lint l10n/l10n-pontoon.toml - -.. code-block:: bash - - $ moz-l10n-lint l10n/l10n-vendor.toml - -Convert the template -==================== - -With the recipe created in the first step, you'll do the following -(assuming your docker shell is still running): - -.. code-block:: bash - - $ ./manage.py fluent template bedrock/mozorg/templates/mozorg/mission.html - -This will reparse the template much in the same way it did when creating the recipe. -It will inspect the recipe to see which legacy strings map to which ID, that you've -chosen when you sanitized the recipe. It will then take this mapping of IDs and replace all of the old calls with new calls to ``ftl()``. -If there are any issues you should see warnings printed to your screen, but always inspect the new -template and give the page a test run to make sure all is working as expected. - -Convert the View or URL ------------------------ - -To get it working on the site you do have to do a bit more. The above step creates a new template -with a ``_ftl.html`` suffix instead of overwriting the old one so that you can compare them before -removing the old one. You can then either delete the old one and rename the new one with the original -name, or keep them both for a while if you may need to quickly switch back. You then need to specify -which .ftl file to use by passing it (or them) to the ``l10n_utils.render`` function in the view, -or the ``page()`` function in urls.py. See the :ref:`specifying_fluent_files` section for more details. - -.. code-block:: python - - # urls.py - urlpatterns = [ - page('mission', 'mozorg/mission.html', ftl_files=['mozorg/mission']), - ] - - # views.py - def mission_view(request): - return l10n_utils.render(request, 'mozorg/mission.html', ftl_files=['mozorg/mission']) - -.. note:: - - If you are using the ``page()`` helper and switch to the new template name that will also change - the name of the URL referenced by calls to ``url`` and ``reverse`` around the site. To avoid this - you can pass the original name to the page function, e.g. ``url_name='mozorg.mission'``. - -Port the translations -===================== - -The remaining step is to port all of the existing translation in the .lang files over to .ftl -files in our fluent files repo. - -.. code-block:: bash - - $ ./manage.py fluent ftl bedrock/mozorg/templates/mozorg/mission.html de it - -.. code-block:: bash - - $ ./manage.py fluent ftl lib/fluent_migrations/mozorg/mission.py de it - -This is the same command we used to create the original ``en`` Fluent file. -As you can see, you can specify both the template path here as well as the -recipe path. - -Before you run this, make sure to update the local clones of your l10n repositories. - -This command will use the Fluent file you edited as template, read the legacy translations -from ``locale`` and write the generated Fluent files for each locale into the ``data/www-l10n/`` directory. - -Append each locale you wish to convert in a space-separated list. You can find the full -list of supported locales in the `Pontoon configuration file`_ and below in a space-separated -format for easier copy and paste (note this list may differ from the current list of active locales -if these docs fall out of sync; compare to the latest Pontoon configuration to be safe.) - -.. code-block:: bash - - ach af am an ar ast az azz be bg bn br bs ca cak crh cs cy da de dsb el en-CA en-GB eo es-AR es-CL es-ES es-MX et eu fa ff fi fr fy-NL ga-IE gd gl gn gu-IN he hi-IN hr hsb hto hu hy-AM ia id is it ja ka kab kk km kn ko lij lo lt ltg lv mk ml mr ms my nb-NO ne-NP nl nn-NO nv oc pa-IN pai pbb pl pt-BR pt-PT qvi rm ro ru si sk sl son sq sr sv-SE sw ta te th tl tr trs uk ur uz vi wo xh zam zh-CN zh-TW zu - -.. _Pontoon configuration file: https://github.com/mozilla/bedrock/blob/master/l10n/configs/pontoon.toml - -Commit -====== - -Once a migration has been run and looks good locally, the next step is to commit all -of these changes and push them to where they need to be: a pull request to bedrock for -the template and English .ftl file changes, and a pull request to the mozilla-l10n/www-l10n -repo for the translated .ftl files and config changes (don't forget to include the `en` -.ftl file too). - -Becuase migrations involve converting existing .lang files to a new format, it's best that -they are carefully reviewed by the L10n team. Having the migration reviewed before the -bedrock PR merges is also often a good idea, because then the recipe can be tweaked and -run again if needed (fixing typos or missing brand names, adding comments etc). - -Because migrations should be run manually, you can opt-out of the regular L10n automation -that happens in bedrock by including ``[skip l10n]`` in the commit message. This will prevent -a second pull request being opened, that would contain only the `en` content changes. - -Once the translated files have been reviewed and merged in the mozilla-l10n/www-l10n repo, -you should be able to pull those files back into bedrock by running ``./manage.py l10n_update``. diff --git a/docs/index.rst b/docs/index.rst index d77b293ea3..81ef3afa92 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -24,7 +24,6 @@ Contents install l10n - fluent-conversion coding contribute pipeline diff --git a/docs/l10n.rst b/docs/l10n.rst index ae994ce4bf..d543aab5d9 100644 --- a/docs/l10n.rst +++ b/docs/l10n.rst @@ -8,28 +8,26 @@ Localization ============ -The site is fully localizable. Localization files are not shipped with the code -distribution, but are available in separate GitHub repositories. The proper repos -can be cloned and kept up-to-date using the ``l10n_update`` management command: +The site is fully localizable. Localization files are not shipped with the code distribution, but +are available in separate GitHub repositories. The proper repos can be cloned and kept up-to-date +using the ``l10n_update`` management command: .. code-block:: console $ ./manage.py l10n_update -If you don't already have a ``data/locale`` directory, this command will clone the -git repo containing the .lang translation files (either the dev or prod files -depending on your ``DEV`` setting). If the folder is already present, it will -update the repository to the latest version. It does the same thing for the -repository for the .ftl translation files in ``data/www-l10n`` directory. +If you don't already have a ``data/www-l10n`` directory, this command will clone the git repo +containing the .ftl translation files (either the dev or prod files depending on your ``DEV`` +setting). If the folder is already present, it will update the repository to the latest version. Fluent ====== -Bedrock's Localization (l10n) system is based on `Project Fluent`_. This is a -departure from the legacy system (see below) that relied on a gettext work flow -of string extraction from template and code files, in that it relies on developers -directly editing the default language (English in our case) Fluent files and using -the string IDs created there in their templates and views. +Bedrock's Localization (l10n) system is based on `Project Fluent`_. This is a departure from a +standard Django project that relies on a gettext work flow of string extraction from template and +code files, in that it relies on developers directly editing the default language (English in our +case) Fluent files and +using the string IDs created there in their templates and views. The default files for the Fluent system live in the ``l10n`` directory in the root of the bedrock project. This directory houses directories for each locale the developers @@ -39,10 +37,6 @@ are plain and easy to understand English, as free from colloquialisms as possibl translators are able to easily understand the meaning of the string, and can then add their own local flair to the ideas. -.. note:: - - We have some :ref:`fluent tools ` to aid in the transition from the legacy system. - .. _Project Fluent: https://projectfluent.org/ .ftl files @@ -350,12 +344,11 @@ FTL files for that template (or a single file name if that's all you need). return [template_name] -If you need for your URL to use multiple Fluent files to determine the full list of active locales, -for example when you are redesigning a page and have multiple templates in use for a single URL depending -on locale, you can use the `activation_files` parameter. This should be a list of FTL filenames -(or template file names if they are still using .lang) that should all be used when determining the full -list of translations for the URL. Bedrock will gather the full list for each file and combine them into a -single list so that the footer language switcher works properly. +If you need for your URL to use multiple Fluent files to determine the full list of active locales, for +example when you are redesigning a page and have multiple templates in use for a single URL depending on +locale, you can use the `activation_files` parameter. This should be a list of FTL filenames that should all +be used when determining the full list of translations for the URL. Bedrock will gather the full list for each +file and combine them into a single list so that the footer language switcher works properly. Using in a view function ~~~~~~~~~~~~~~~~~~~~~~~~ @@ -383,7 +376,7 @@ via a set of configuration files: Each configuration file consists of a pre-defined set of locales for which each group is responsible for translating. The locales defined in each file should not be changed without -first consulting the with L10n team, and such changes should not be a regular occurence. +first consulting the with L10n team, and such changes should not be a regular occurrence. To establish a localization strategy for a Fluent file, it needs to be included as a path in one or more configuration files. For example: @@ -561,309 +554,6 @@ merged by the L10n team, everything is done. .. _mozilla-l10n/www-l10n: https://github.com/mozilla-l10n/www-l10n -Legacy -====== - -This section describes the legacy l10n system based on .lang files, which will -be frozen and no longer supported for new translations in January of 2020. - -.lang files ------------ - -Bedrock supports a workflow similar to gettext. You extract all the -strings from the codebase, then merge them into each locale to get -them translated. - -The files containing the strings are called ".lang files" and end with -a ``.lang`` extension. - -To extract all the strings from the codebase, run: - -.. code-block:: console - - $ ./manage.py l10n_extract - -If you'd only like to extract strings from certain files, you may optionally -list them on the command line: - -.. code-block:: console - - $ ./manage.py l10n_extract bedrock/mozorg/templates/mozorg/contribute.html - -Command line glob matching will work as well if you want all of the HTML files -in a directory, for example: - -.. code-block:: console - - $ ./manage.py l10n_extract bedrock/mozorg/templates/mozorg/*.html - -That will use gettext to get all the needed localizations from Python -and HTML files, and will convert the result into a series of .lang -files inside ``locale/templates``. This directory represents the -"reference" set of strings to be translated, and you are free to -modify or split up .lang files here as needed (just make sure they are -being referenced correctly, from the code, see -:ref:`Which .lang file should it use? `). - -Once you have extracted .lang files locally, they can then be added via -pull request to the `mozilla.org l10n repository`_ for translation. -You can read the `full documentation`_ for more information on the -extraction workflow. - -.. _using-lang: - -Translating with .lang files -~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -To translate a string from a .lang file, simply use the gettext interface. - -In a jinja2 template: - -.. code-block:: jinja - -
{{ _('Hello, how are you?') }}
- -
{{ _('Click here')|format('http://mozilla.org/') }}
- -
{{ _('Click here')|format(url='http://mozilla.org/') }}
- -Note the usage of variable substitution in the latter examples. It is -important not to hardcode URLs or other parameters in the string. -jinja's `format` filter lets us apply variables outsite of the string. - -You can provide a one-line comment to the translators like this: - -.. code-block:: jinja - - {# L10n: "like" as in "similar to", not "is fond of" #} - {{ _('Like this:') }} - -The comment will be included in the .lang files above the string to be -translated. - -In a Python file, use ``lib.l10n_utils.dotlang._`` or -``lib.l10n_utils.dotlang._lazy``, like this: - -.. code-block:: python - - from lib.l10n_utils.dotlang import _lazy as _ - - sometext = _('Foo about bar.') - -You can provide a one-line comment to the translators like this: - -.. code-block:: python - - # L10n: "like" as in "similar to", not "is fond of" - sometext = _('Like this:') - -The comment will be included in the .lang files above the string to be -translated. - - -There's another way to translate content within jinja2 templates. If -you need a big chunk of content translated, you can put it all inside -a `trans` block. - -.. code-block:: jinja - - {% trans %} -
Hello, how are you
- {% endtrans %} - - {% trans url='http://mozilla.org' %} -
Click here
- {% endtrans %} - -Note that it also allows variable substitution by passing variables -into the block and using template variables to apply them. - - -.. _which-lang: - -Which .lang file should it use? -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -Translated strings are split across several .lang files to make it -easier to manage separate projects and pages. So how does the system -know which one to use when translating a particular string? - -* All translations from Python files are put into main.lang. This - should be a very limited set of strings and most likely should be - available to all pages. -* Templates always load `main.lang` and `download_button.lang`. -* Additionally, each template has its own .lang file, so a template at - `mozorg/firefox.html` would use the .lang file at - `/mozorg/firefox.lang`. -* Templates can override which .lang files are loaded. The above - global ones are always loaded, but instead of loading - `/mozorg/firefox.lang`, the template can specify a list of - additional lang files to load with a template block: - -.. code-block:: jinja - - {% add_lang_files "foo" "bar" %} - -That will make the page load `foo.lang` and `bar.lang` in addition to -`main.lang` and `download_button.lang`. - -When strings are extracted from a template, they are added to the -template-specific .lang file. If the template explicitly specifies -.lang files like above, it will add the strings to the first .lang -file specified, so extracted strings from the above template would go -into `foo.lang`. - -You can similarly specify extra .lang files in your Python source as well. -Simply add a module-level constant in the file named `LANG_FILES`. The -value should be either a string, or a list of strings, similar to the -`add_lang_files` tag above. - -.. code-block:: python - - # forms.py - - from lib.l10n_utils.dotlang import _ - - LANG_FILES = ['foo', 'bar'] - - sometext = _('Foo about bar.') - -This file's strings would be extracted to `foo.lang`, and the lang files -`foo.lang`, `bar.lang`, `main.lang` and `download_button.lang` would be -searched for matches in that order. - -l10n blocks ------------ - -Bedrock also has a block-based translation system that works like the -``{% block %}`` template tag, and marks large sections of translatable -content. This should not be used very often; lang files are the -preferred way to translate content. However, there may be times when -you want to control a large section of a page and customize it -without caring very much about future updates to the English page. - -A Localizers' guide to l10n blocks -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -Let's look at how we would translate an example file from **English** to -**German**. - -The English source template, created by a developer, lives under -`apps/appname/templates/appname/example.html` and looks like this: - -.. code-block:: jinja - - {% extends "base-protocol.html" %} - - {% block content %} - - - {% l10n foo, 20110801 %} -

Hello world!

- {% endl10n %} - -
- - {% l10n bar, 20110801 %} -

This is an example!

- {% endl10n %} - {% endblock %} - -The ``l10n`` blocks mark content that should be localized. -Realistically, the content in these blocks would be much larger. For a -short string like above, please use lang files. We'll use this trivial -code for our example though. - -The ``l10n`` blocks are named and tagged with a date (in ISO format). -The date indicates the time that this content was updated and needs to -be translated. If you are changing trivial things, you shouldn't -update it. The point of l10n blocks is that localizers completely -customize the content, so they don't care about small updates. -However, you may add something important that needs to be added in the -localized blocks; hence, you should update the date in that case. - -When the command ``./manage.py l10n_extract`` is run, it generates -the corresponding files in the ``locale`` folder (see below for more -info on this command). - -The German version of this template is created at -``locale/de/templates/appname/example.html``. The contents of it are: - -.. code-block:: jinja - - {% extends "appname/example.html" %} - - {% l10n foo %} -

Hello world!

- {% endl10n %} - - {% l10n bar %} -

This is an example!

- {% endl10n %} - -This file is an actual template for the site. It extends the main -template and contains a list of l10n blocks which override the content -on the page. - -The localizer just needs to translate the content in the l10n blocks. - -When the reference template is updated with new content and the date -is updated on an l10n block, the generated l10n file will simply add -the new content. It will look like this: - -.. code-block:: jinja - - {% extends "appname/example.html" %} - - {% l10n foo %} -

This is an English string that needs translating.

- {% was %} -

Dies ist ein English string wurde nicht.

- {% endl10n %} - - {% l10n bar %} -

This is an example!

- {% endl10n %} - -Note the ``was`` block in ``foo``. The old translated content is in -there, and the new content is above it. The ``was`` content is always -shown on the site, so the old translation still shows up. The -localizer needs to update the translated content and remove the ``was`` -block. - -Generating the locale files -~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -.. code-block:: console - - $ ./manage.py l10n_check - -This command will check which blocks need to be translated and update -the locale templates with needed translations. It will copy the -English blocks into the locale files if a translation is needed. - -You can specify a list of locales to update: - -.. code-block:: console - - $ ./manage.py l10n_check fr - -.. code-block:: console - - $ ./manage.py l10n_check fr de es - -Currency --------- - -When dealing with currency, make a separate gettext wrapper, placing the amount -inside a variable. You should also include a comment describing the intent. For -example: - -.. code-block:: jinja - - {# L10n: Inserts a sum in US dollars, e.g. '$100'. Adapt the string in your translation for your locale conventions if needed, ex: %(sum)s US$ #} - {{ _('$%(sum)s')|format(sum='15') }} - CSS --- @@ -958,42 +648,15 @@ Sans* and *X-LocaleSpecific* so locale-specific fonts, if defined, will be applied to localized pages. The variant mixins, ``.open-sans-light`` and ``.open-sans-extrabold``, are also available. -Staging Copy Changes --------------------- - -The need will often arise to push a copy change to production before the new -copy has been translated for all locales. To prevent locales not yet translated -from displaying English text, you can use the ``l10n_has_tag`` template -function. For example, if the string "Firefox benefits" needs to be changed to -"Firefox features": - -.. code-block:: jinja - - {% if l10n_has_tag('firefox_products_headline_spring_2016') %} -

{{ _('Firefox features') }}

- {% else %} -

{{ _('Firefox benefits') }}

- {% endif %} - -This function will check the .lang file(s) of the current page for the tag -``firefox_products_headline_spring_2016``. If it exists, the translation for -"Firefox features" will be displayed. If not, the pre-existing translation for -"Firefox benefits" will be displayed. - -When using ``l10n_has_tag``, be sure to coordinate with the localization team to -decide on a good tag name. Always use underscores instead of hyphens if you need -to visually separate words. - All === Locale-specific Templates ------------------------- -While the ``l10n_has_tag`` or ``ftl_has_messages`` template functions are great in small doses, -they don't scale particularly well. A template filled with conditional copy can be -difficult to comprehend, particularly when the conditional copy has associated -CSS and/or JavaScript. +While the ``ftl_has_messages`` template function is great in small doses, it doesn't scale +particularly well. A template filled with conditional copy can be difficult to comprehend, +particularly when the conditional copy has associated CSS and/or JavaScript. In instances where a large amount of a template's copy needs to be changed, or when a template has messaging targeting one particular locale, creating a @@ -1015,12 +678,6 @@ render it instead of the originally specified (locale-agnostic) template. feature was introduced, but it is now. So you can create your en-US-only template and the rest of the locales will continue to use the default. -.. IMPORTANT:: - - Note that the presence of an L10n template (e.g. - ``locale/de/templates/firefox/new.html``) will take precedence over - a locale-specific template in bedrock. - Specifying Active Locales in Views ---------------------------------- @@ -1072,18 +729,3 @@ from the lang files then you can use the `add_active_locales` name in all of the This is useful in situations where we would have needed the l10n team to create an empty .lang file with an active tag in it because we have a locale-specific-template with text in the language hard-coded into the template and therefore do not otherwise need a .lang file. - -Development ------------ - -In local development environments and on demo servers all ``l10n_has_tag`` calls -evaluate to true. If the content has not been translated it will display -the English strings. - -To test l10n locally you can set ``DEV=False`` in your ``.env`` file. - -If you are running your local server you will need to restart it after altering -your ``.env`` file. - -.. _mozilla.org l10n repository: https://github.com/mozilla-l10n/www.mozilla.org/ -.. _full documentation: https://mozilla-l10n.github.io/documentation/products/mozilla_org/ diff --git a/docs/send-to-device.rst b/docs/send-to-device.rst index 58b8bfc176..cdecf74991 100644 --- a/docs/send-to-device.rst +++ b/docs/send-to-device.rst @@ -21,21 +21,17 @@ Usage {% from "macros.html" import send_to_device with context %} -2. Add the appropriate lang file to the page template:: - - {% add_lang_files "firefox/sendto" %} - -3. Make sure necessary files are in your CSS/JS bundles: +2. Make sure necessary files are in your CSS/JS bundles: - ``'css/protocol/components/send-to-device.scss'`` - ``'js/base/send-to-device.js'`` -4. Include the macro in your page template:: +3. Include the macro in your page template:: {{ send_to_device() }} -5. Initialize the widget: +4. Initialize the widget: In your page JS, initialize the widget using:: diff --git a/lib/fluent_migrations/404.py b/lib/fluent_migrations/404.py deleted file mode 100644 index 6b3bd87a1a..0000000000 --- a/lib/fluent_migrations/404.py +++ /dev/null @@ -1,64 +0,0 @@ -from __future__ import absolute_import - -import fluent.syntax.ast as FTL -from fluent.migrate import COPY, REPLACE -from fluent.migrate.helpers import TERM_REFERENCE, VARIABLE_REFERENCE, transforms_from - -not_found = "mozorg/404.lang" - - -def migrate(ctx): - """Migrate bedrock/base/templates/404.html, part {index}.""" - - ctx.add_transforms( - "404.ftl", - "404.ftl", - transforms_from( - """ -not-found-page-not-found-page-page-not-found = {COPY(not_found, "404: Page Not Found",)} -not-found-page-sorry-we-cant-find-that-page = {COPY(not_found, "Sorry, we can’t find that page",)} -not-found-page-were-all-about-a-healthy-internet = {COPY(not_found, "We’re all about a healthy internet but sometimes broken URLs happen.",)} -not-found-page-go-back = {COPY(not_found, "Go Back",)} -""", - not_found=not_found, - ) - + [ - FTL.Message( - id=FTL.Identifier("not-found-page-learn-about-mozilla-the-non"), - value=REPLACE( - not_found, - 'Learn about Mozilla, the non-profit behind Firefox.', - { - "%%": "%", - "%(about)s": VARIABLE_REFERENCE("about"), - "Mozilla": TERM_REFERENCE("brand-name-mozilla"), - "Firefox": TERM_REFERENCE("brand-name-firefox"), - }, - ), - ), - FTL.Message( - id=FTL.Identifier("not-found-page-explore-the-entire-family-for"), - value=REPLACE( - not_found, - "Explore the entire family for Firefox products designed to respect your privacy.", - { - "%%": "%", - "%(explore)s": VARIABLE_REFERENCE("explore"), - "Firefox": TERM_REFERENCE("brand-name-firefox"), - }, - ), - ), - FTL.Message( - id=FTL.Identifier("not-found-page-download-the-firefox-browser"), - value=REPLACE( - not_found, - "Download the Firefox browser for your mobile device or desktop", - { - "%%": "%", - "%(download)s": VARIABLE_REFERENCE("download"), - "Firefox": TERM_REFERENCE("brand-name-firefox"), - }, - ), - ), - ], - ) diff --git a/lib/fluent_migrations/500.py b/lib/fluent_migrations/500.py deleted file mode 100644 index dcbe8d18db..0000000000 --- a/lib/fluent_migrations/500.py +++ /dev/null @@ -1,38 +0,0 @@ -from __future__ import absolute_import - -import fluent.syntax.ast as FTL -from fluent.migrate import COPY, REPLACE -from fluent.migrate.helpers import TERM_REFERENCE, VARIABLE_REFERENCE, transforms_from - -error_page = "mozorg/500.lang" - - -def migrate(ctx): - """Migrate bedrock/base/templates/500.html, part {index}.""" - - ctx.add_transforms( - "500.ftl", - "500.ftl", - transforms_from( - """ -error-page-error-page-internal-server-error = {COPY(error_page, "500: Internal Server Error",)} -error-page-something-went-wrong = {COPY(error_page, "Something went wrong",)} -error-page-its-probably-just-a-server-error = {COPY(error_page, "It’s probably just a server error and we’re working to fix it.",)} -""", - error_page=error_page, - ) - + [ - FTL.Message( - id=FTL.Identifier("error-page-you-can-also-try-refreshing"), - value=REPLACE( - error_page, - "You can also try refreshing this page or go to firefox.com or mozilla.org", - { - "%%": "%", - "%(firefox)s": VARIABLE_REFERENCE("firefox"), - "%(mozilla)s": VARIABLE_REFERENCE("mozilla"), - }, - ), - ), - ], - ) diff --git a/lib/fluent_migrations/__init__.py b/lib/fluent_migrations/__init__.py deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/lib/fluent_migrations/firefox/__init__.py b/lib/fluent_migrations/firefox/__init__.py deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/lib/fluent_migrations/firefox/accounts-2019.py b/lib/fluent_migrations/firefox/accounts-2019.py deleted file mode 100644 index db49bc95cf..0000000000 --- a/lib/fluent_migrations/firefox/accounts-2019.py +++ /dev/null @@ -1,193 +0,0 @@ -from __future__ import absolute_import - -import fluent.syntax.ast as FTL -from fluent.migrate import COPY, REPLACE -from fluent.migrate.helpers import TERM_REFERENCE, VARIABLE_REFERENCE, transforms_from - -accounts_2019 = "firefox/accounts-2019.lang" - - -def migrate(ctx): - """Migrate bedrock/firefox/templates/firefox/accounts-2019.html, part {index}.""" - - ctx.add_transforms( - "firefox/accounts.ftl", - "firefox/accounts.ftl", - [ - FTL.Message( - id=FTL.Identifier("firefox-accounts-there-is-a-way-to"), - value=REPLACE( - accounts_2019, - "There is a way to protect your privacy. Join Firefox.", - { - "Firefox": TERM_REFERENCE("brand-name-firefox"), - }, - ), - ), - FTL.Message( - id=FTL.Identifier("firefox-accounts-get-a-firefox-account"), - value=REPLACE( - accounts_2019, - "Get a Firefox Account – Keep your data private, safe and synced", - { - "Firefox Account": TERM_REFERENCE("brand-name-firefox-account"), - }, - ), - ), - ] - + transforms_from( - """ -firefox-accounts-take-your-stand-stay-smart = {COPY(accounts_2019, "Take your stand against an industry that’s selling your data to third parties. Stay smart and safe online with technology that fights for you.",)} -""", - accounts_2019=accounts_2019, - ) - + [ - FTL.Message( - id=FTL.Identifier("firefox-accounts-securely-sync-your"), - value=REPLACE( - accounts_2019, - "Securely sync your passwords, bookmarks and tabs across all your devices. Get a Firefox Account now – One login – Power and privacy everywhere.", - { - "Firefox Account": TERM_REFERENCE("brand-name-firefox-account"), - }, - ), - ), - FTL.Message( - id=FTL.Identifier("firefox-accounts-there-is-a-way-to-protect"), - value=REPLACE( - accounts_2019, - "There is a way to protect your privacy. Join Firefox.", - { - "Firefox": TERM_REFERENCE("brand-name-firefox"), - }, - ), - ), - ] - + transforms_from( - """ -firefox-accounts-take-your-stand-against = {COPY(accounts_2019, "Take your stand against an industry that’s making you the product.",)} -""", - accounts_2019=accounts_2019, - ) - + [ - FTL.Message( - id=FTL.Identifier("firefox-accounts-youre-signed-in-to"), - value=REPLACE( - accounts_2019, - "You’re signed
in to Firefox.
Now try Firefox Monitor.", - { - "Firefox": TERM_REFERENCE("brand-name-firefox"), - "Firefox Monitor": TERM_REFERENCE("brand-name-firefox-monitor"), - }, - ), - ), - ] - + transforms_from( - """ -firefox-accounts-see-if-youve-been = {COPY(accounts_2019, "See if you’ve been involved in an online data breach.",)} -""", - accounts_2019=accounts_2019, - ) - + [ - FTL.Message( - id=FTL.Identifier("firefox-accounts-sign-in-to-monitor"), - value=REPLACE( - accounts_2019, - "Sign In to Monitor", - { - "Monitor": TERM_REFERENCE("brand-name-monitor"), - }, - ), - ), - FTL.Message( - id=FTL.Identifier("firefox-accounts-join-firefox"), - value=REPLACE( - accounts_2019, - "Join Firefox", - { - "Firefox": TERM_REFERENCE("brand-name-firefox"), - }, - ), - ), - ] - + transforms_from( - """ -firefox-accounts-enter-your-email-address = {COPY(accounts_2019, "Enter your email address to get started.",)} -firefox-accounts-already-have-an-account = {COPY(accounts_2019, "Already have an account?",)} -firefox-accounts-sign-in = {COPY(accounts_2019, "Sign In",)} -firefox-accounts-meet-our-family-of = {COPY(accounts_2019, "Meet our family of privacy-first products.",)} -""", - accounts_2019=accounts_2019, - ) - + [ - FTL.Message( - id=FTL.Identifier("firefox-accounts-firefox-is-technology"), - value=REPLACE( - accounts_2019, - "Firefox is technology that fights for you.", - { - "Firefox": TERM_REFERENCE("brand-name-firefox"), - }, - ), - ), - ] - + transforms_from( - """ -firefox-accounts-get-technology-that = {COPY(accounts_2019, "Get technology that fights for you.",)} -firefox-accounts-travel-the-internet = {COPY(accounts_2019, "Travel the internet with protection, on every device.",)} -firefox-accounts-keep-your-passwords = {COPY(accounts_2019, "Keep your passwords protected and portable.",)} -firefox-accounts-get-a-lookout-for = {COPY(accounts_2019, "Get a lookout for data breaches.",)} -firefox-accounts-share-large-files = {COPY(accounts_2019, "Share large files without prying eyes.",)} -firefox-accounts-get-it-all-on-every = {COPY(accounts_2019, "Get it all on every device, without feeling trapped in a single operating system.",)} -firefox-accounts-and-get-it-all-on = {COPY(accounts_2019, "And get it all on every device, without feeling trapped in a single operating system.",)} -firefox-accounts-get-the-respect-you = {COPY(accounts_2019, "Get the respect you deserve.",)} -""", - accounts_2019=accounts_2019, - ) - + [ - FTL.Message( - id=FTL.Identifier("firefox-accounts-youll-always-get-the"), - value=REPLACE( - accounts_2019, - 'You’ll always get the truth from us. Everything we make and do honors our Personal Data Promise:', - { - "%%": "%", - "%(promise)s": VARIABLE_REFERENCE("promise"), - }, - ), - ), - ] - + transforms_from( - """ -firefox-accounts-take-less-keep-it = {COPY(accounts_2019, "Take less.
Keep it safe.
No secrets.",)} -firefox-accounts-get-the-knowledge = {COPY(accounts_2019, "Get the knowledge to keep you safe.",)} -firefox-accounts-learn-everything-you = {COPY(accounts_2019, "Learn everything you need to know (but don’t yet) about staying smart and safe online, from some of the world’s foremost experts.",)} -firefox-accounts-and-be-part-of-protecting = {COPY(accounts_2019, "And be part of protecting the internet for future generations.",)} -""", - accounts_2019=accounts_2019, - ) - + [ - FTL.Message( - id=FTL.Identifier("firefox-accounts-help-us-build-a-better"), - value=REPLACE( - accounts_2019, - "Help us build a better Firefox for all.", - { - "Firefox": TERM_REFERENCE("brand-name-firefox"), - }, - ), - ), - ] - + transforms_from( - """ -firefox-accounts-get-into-the-open = {COPY(accounts_2019, "Get into the open source spirit by test-driving upcoming products.",)} -firefox-accounts-help-us-keep-big-tech = {COPY(accounts_2019, "Help us keep Big Tech in check.",)} -firefox-accounts-we-support-communities = {COPY(accounts_2019, "We support communities all over the world standing up for a healthier internet. Add your voice to the fight.",)} -firefox-accounts-firefox-browser = { -brand-name-firefox-browser } -firefox-accounts-firefox-lockwise = { -brand-name-firefox-lockwise } -firefox-accounts-firefox-monitor = { -brand-name-firefox-monitor } -firefox-accounts-firefox-send = { -brand-name-firefox-send } -""", - accounts_2019=accounts_2019, - ), - ) diff --git a/lib/fluent_migrations/firefox/all-unified.py b/lib/fluent_migrations/firefox/all-unified.py deleted file mode 100644 index 62b4ccfa43..0000000000 --- a/lib/fluent_migrations/firefox/all-unified.py +++ /dev/null @@ -1,180 +0,0 @@ -from __future__ import absolute_import - -import fluent.syntax.ast as FTL -from fluent.migrate import COPY, REPLACE -from fluent.migrate.helpers import TERM_REFERENCE, VARIABLE_REFERENCE, transforms_from - -all_unified = "firefox/all-unified.lang" - - -def migrate(ctx): - """Migrate bedrock/firefox/templates/firefox/all-unified.html, part {index}.""" - - ctx.add_transforms( - "firefox/all.ftl", - "firefox/all.ftl", - transforms_from( - """ -firefox-all-check-the-system-requirements = {COPY(all_unified, "Check the system requirements",)} -firefox-all-release-notes = {COPY(all_unified, "Release notes",)} -firefox-all-source-code = {COPY(all_unified, "Source code",)} -firefox-all-need-help = {COPY(all_unified, "Need help?",)} -firefox-all-which-browser-would = {COPY(all_unified, "Which browser would you like to download?",)} -firefox-all-get-help = {COPY(all_unified, "Get help",)} -firefox-all-you-are-about-to-download = {COPY(all_unified, "You are about to download:",)} -firefox-all-browser = {COPY(all_unified, "Browser:",)} -firefox-all-platform = {COPY(all_unified, "Platform:",)} -firefox-all-language = {COPY(all_unified, "Language:",)} -firefox-all-sorry-we-couldnt-find = {COPY(all_unified, "Sorry, we couldn’t find the download you’re looking for. Please try again, or select a download from the list below.",)} -firefox-all-the-pre-alpha-version = {COPY(all_unified, "The pre-alpha version for power users who like to hunt crashes and test new features as they’re coded.",)} -firefox-all-64-bit-installers = {COPY(all_unified, "64-bit installers",)} -firefox-all-choose-a-64-bit-installer = {COPY(all_unified, "Choose a 64-bit installer for computers with 64-bit processors, which allow them to allocate more RAM to individual programs — particularly important for games and other demanding applications.",)} -firefox-all-32-bit-installers = {COPY(all_unified, "32-bit installers",)} -""", - all_unified=all_unified, - ) - + [ - FTL.Message( - id=FTL.Identifier("firefox-all-download-the-firefox"), - value=REPLACE( - all_unified, - "Download the Firefox Browser in English (US) and more than 90 other languages", - { - "Firefox Browser": TERM_REFERENCE("brand-name-firefox-browser"), - }, - ), - ), - FTL.Message( - id=FTL.Identifier("firefox-all-everyone-deserves-access"), - value=REPLACE( - all_unified, - "Everyone deserves access to the internet — your language should never be a barrier. That’s why — with the help of dedicated volunteers around the world — we make the Firefox Browser available in more than 90 languages.", - { - "Firefox Browser": TERM_REFERENCE("brand-name-firefox-browser"), - }, - ), - ), - FTL.Message( - id=FTL.Identifier("firefox-all-choose-which-firefox"), - value=REPLACE( - all_unified, - "Choose which Firefox Browser to download in your language", - { - "Firefox Browser": TERM_REFERENCE("brand-name-firefox-browser"), - }, - ), - ), - FTL.Message( - id=FTL.Identifier("firefox-all-firefox-privacy-notice"), - value=REPLACE( - all_unified, - "Firefox Privacy Notice", - { - "Firefox": TERM_REFERENCE("brand-name-firefox"), - }, - ), - ), - FTL.Message( - id=FTL.Identifier("firefox-all-learn-about-firefox"), - value=REPLACE( - all_unified, - "Learn about Firefox browsers", - { - "Firefox": TERM_REFERENCE("brand-name-firefox"), - }, - ), - ), - FTL.Message( - id=FTL.Identifier("firefox-all-the-standard-firefox"), - value=REPLACE( - all_unified, - "The standard Firefox browser — fast and private. If you’re not sure which Firefox to choose, choose this.", - { - "Firefox": TERM_REFERENCE("brand-name-firefox"), - }, - ), - ), - FTL.Message( - id=FTL.Identifier("firefox-all-get-a-sneak-peek-at"), - value=REPLACE( - all_unified, - "Get a sneak peek at the latest Firefox browser features before they’re released.", - { - "Firefox": TERM_REFERENCE("brand-name-firefox"), - }, - ), - ), - FTL.Message( - id=FTL.Identifier("firefox-all-test-your-sites-against"), - value=REPLACE( - all_unified, - "Test your sites against soon-to-be-released Firefox browser features with powerful, flexible DevTools that are on by default.", - { - "Firefox": TERM_REFERENCE("brand-name-firefox"), - }, - ), - ), - FTL.Message( - id=FTL.Identifier("firefox-all-count-on-stability-and"), - value=REPLACE( - all_unified, - "Count on stability and ease of use with this Firefox browser built for enterprise.", - { - "Firefox": TERM_REFERENCE("brand-name-firefox"), - }, - ), - ), - FTL.Message( - id=FTL.Identifier("firefox-all-windows-installers-for"), - value=REPLACE( - all_unified, - "Windows installers for corporate IT that simplify the configuration, deployment and management of the Firefox Browser.", - { - "Firefox Browser": TERM_REFERENCE("brand-name-firefox-browser"), - }, - ), - ), - FTL.Message( - id=FTL.Identifier("firefox-all-choose-a-32-bit-installer"), - value=REPLACE( - all_unified, - 'Choose a 32-bit installer for computers with 32-bit processors — or for older or less powerful computers. If you aren’t sure whether to choose a 64-bit or 32-bit installer, we recommend you go with 32-bit.', - { - "%%": "%", - "%(url)s": VARIABLE_REFERENCE("url"), - }, - ), - ), - FTL.Message( - id=FTL.Identifier("firefox-all-download-product-for"), - value=REPLACE( - all_unified, - "Download %(product_label)s for %(platform)s in %(locale)s", - { - "%%": "%", - "%(product_label)s": VARIABLE_REFERENCE("product_label"), - "%(platform)s": VARIABLE_REFERENCE("platform"), - "%(locale)s": VARIABLE_REFERENCE("locale"), - }, - ), - ), - ] - + transforms_from( - """ -firefox-all-msi-installers = {COPY(all_unified, "MSI installers",)} -firefox-all-which-version = {COPY(all_unified, "Which version would you like?",)} -firefox-all-select-your-preferred-installer = {COPY(all_unified, "Select your preferred installer",)} -firefox-all-select-your-preferred-language = {COPY(all_unified, "Select your preferred language",)} -firefox-all-learn-about-installers = {COPY(all_unified, "Learn about installers",)} -firefox-all-product-firefox = { -brand-name-firefox } -firefox-all-product-firefox-beta = { -brand-name-firefox-beta } -firefox-all-product-firefox-developer = { -brand-name-firefox-developer-edition } -firefox-all-product-firefox-nightly = { -brand-name-firefox-nightly } -firefox-all-product-firefox-esr = { -brand-name-firefox-extended-support-release } -firefox-all-product-firefox-android = { -brand-name-firefox } { -brand-name-android } -firefox-all-product-firefox-android-beta = { -brand-name-firefox } { -brand-name-android } { -brand-name-beta } -firefox-all-product-firefox-android-nightly = { -brand-name-firefox } { -brand-name-android } { -brand-name-nightly } -""", - all_unified=all_unified, - ), - ) diff --git a/lib/fluent_migrations/firefox/browsers/__init__.py b/lib/fluent_migrations/firefox/browsers/__init__.py deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/lib/fluent_migrations/firefox/browsers/best-browser.py b/lib/fluent_migrations/firefox/browsers/best-browser.py deleted file mode 100644 index 9c910f4bda..0000000000 --- a/lib/fluent_migrations/firefox/browsers/best-browser.py +++ /dev/null @@ -1,173 +0,0 @@ -from __future__ import absolute_import - -import fluent.syntax.ast as FTL -from fluent.migrate import COPY, REPLACE -from fluent.migrate.helpers import TERM_REFERENCE, VARIABLE_REFERENCE, transforms_from - -best_browser = "firefox/browsers/best-browser.lang" -best_browser = "firefox/best-browser.lang" - - -def migrate(ctx): - """Migrate bedrock/firefox/templates/firefox/browsers/best-browser.html, part {index}.""" - - ctx.add_transforms( - "firefox/browsers/best-browser.ftl", - "firefox/browsers/best-browser.ftl", - transforms_from( - """ -best-browser-find-your-best-browser = {COPY(best_browser, "Find your best browser for speed, privacy and security.",)} -best-browser-so-many-browser-options = {COPY(best_browser, "So many browser options, but there’s only one that works best for your needs. The best browser for you should offer both speed and privacy protection.",)} -best-browser-privacy-speed-and-security = {COPY(best_browser, "Privacy, speed, and security.",)} -best-browser-how-to-choose-the-best = {COPY(best_browser, "How to choose the best browser for you.",)} -best-browser-the-internet-has-become = {COPY(best_browser, "The internet has become as essential as electricity and running water, so choosing the best browser for you is more important than ever. The internet is a second office, a teacher and sometimes a medical advisor, even if your actual doctor would prefer you didn’t look up your symptoms online.",)} -""", - best_browser=best_browser, - ) - + [ - FTL.Message( - id=FTL.Identifier("best-browser-in-the-mid-nineties"), - value=REPLACE( - best_browser, - "In the mid-nineties, Netscape, Internet Explorer and AOL dominated the landscape. It was a simpler time when the sweet melody of dial-up internet rang across the land. You learned the meaning of patience waiting for web pages to load. Back then, all that mattered was browser speed.", - { - "Internet Explorer": TERM_REFERENCE("brand-name-ie"), - "Netscape": TERM_REFERENCE("brand-name-netscape"), - }, - ), - ), - ] - + transforms_from( - """ -best-browser-today-is-a-different = {COPY(best_browser, "Today is a different story. Ads, privacy hacks, security breaches, and fake news might have you looking at other qualities in a browser. How does the browser protect your privacy? Does it allow trackers to follow you across the web? Does it built to multitask and handle many computer and internet operations at once?",)} -best-browser-when-you-use-a-browser = {COPY(best_browser, "When you use a browser for everything, it needs to be fast. But for the same reason, it needs to be private. A browser has access to everything you do online, so it can put you at real risk if it doesn’t have strong privacy features.",)} -""", - best_browser=best_browser, - ) - + [ - FTL.Message( - id=FTL.Identifier("best-browser-marshall-erwin-senior"), - value=REPLACE( - best_browser, - "Marshall Erwin, Senior Director of Trust and Security at Mozilla", - { - "Mozilla": TERM_REFERENCE("brand-name-mozilla"), - }, - ), - ), - ] - + transforms_from( - """ -best-browser-if-youre-wondering = {COPY(best_browser, "If you’re wondering what it means to have a private or fast browser, here’s a breakdown of three things a browser should have.",)} -best-browser-a-browser-built-for = {COPY(best_browser, "A browser built for speed.",)} -best-browser-a-browser-is-still = {COPY(best_browser, "A browser is still a tool, so it makes sense that you’ll want to pick the best one for the job. If you’re a human who needs to work to survive, you’ll need a fast internet browser. One thing to keep in mind is a browser that runs third-party trackers is more likely to be slower than a browser that doesn’t. Third-party trackers are cookies, and while you can’t see them, they are running in the background of the site, taking up precious time. The more third-party trackers a browser blocks, the faster it can run.",)} -""", - best_browser=best_browser, - ) - + [ - FTL.Message( - id=FTL.Identifier("best-browser-this-is-one-of-the"), - value=REPLACE( - best_browser, - "This is one of the many reasons to choose the Firefox browser: Firefox blocks third-party trackers by default. We have other reasons and we’ll get into those later.", - { - "Firefox": TERM_REFERENCE("brand-name-firefox"), - }, - ), - ), - ] - + transforms_from( - """ -best-browser-a-browser-that-puts = {COPY(best_browser, "A browser that puts safety first.",)} -best-browser-remember-the-last-massive = {COPY(best_browser, "Remember the last massive data breach? If not, it’s probably because it happens so often. Companies hold on to customer data, like their personal or financial information, and hackers steal it. If you’re making safety a priority, then a secure internet browser is the best browser for you.",)} -best-browser-there-are-a-few-ways = {COPY(best_browser, "There are a few ways a browser can help its users stay secure. A browser that is up to date with the latest security tech can help protect your computer and websites from unwanted visitors, such as malware or computer viruses.",)} -""", - best_browser=best_browser, - ) - + [ - FTL.Message( - id=FTL.Identifier("best-browser-the-second-is-not-storing"), - value=REPLACE( - best_browser, - 'The second is not storing too much user data. Hackers can’t steal what’s not there, which is why Firefox keeps a minimum amount of information about its users. Firefox knows if you use the browser and your general location but not the name of your childhood pet or your favorite color.', - { - "%%": "%", - "%(data)s": VARIABLE_REFERENCE("data"), - "%(privacy)s": VARIABLE_REFERENCE("privacy"), - "Firefox": TERM_REFERENCE("brand-name-firefox"), - }, - ), - ), - ] - + transforms_from( - """ -best-browser-last-but-not-least = {COPY(best_browser, "Last but not least, a safe browser should offer tools to help you keep an eye on your accounts. Think of alerts that go straight to your email if any of your accounts get breached or icons that tell you whether a website is encrypted, (i.e., if it’s a good idea to enter your credit number on a shopping site).",)} -""", - best_browser=best_browser, - ) - + [ - FTL.Message( - id=FTL.Identifier("best-browser-firefox-is-offering"), - value=REPLACE( - best_browser, - 'Firefox is offering something new to keep you safe: Firefox Monitor. It’s a free service that will alert you if there are any public hacks on your accounts and let you know if your accounts got hacked in the past. Another neat feature is the Green Lock. It looks like a small green icon at the top left side of the browser window. If you’re on Firefox and see the green lock, it means the website is encrypted and secure. If the lock is grey, you might want to think twice about entering any sensitive information.', - { - "%%": "%", - "%(monitor)s": VARIABLE_REFERENCE("monitor"), - "Firefox": TERM_REFERENCE("brand-name-firefox"), - "Firefox Monitor": TERM_REFERENCE("brand-name-firefox-monitor"), - }, - ), - ), - ] - + transforms_from( - """ -best-browser-we-visit-hundreds-or = {COPY(best_browser, "We visit hundreds or even thousands of websites each day, and you can’t expect users to make security and privacy decisions for each of these sites. That is why a browser that gives you more control is so important - because it offers real, meaningful protection.",)} -best-browser-a-browser-that-minds = {COPY(best_browser, "A browser that minds its business.",)} -best-browser-privacy-on-the-web = {COPY(best_browser, "Privacy on the web is a hot button issue. If privacy is number one on your list of priorities, you want to look for a browser that takes that seriously. When choosing the best private browser for you, look at the tracking policy and how a browser handles your data. These seem like technical questions, but they’re the reason some browsers are more private than others.",)} -best-browser-trackers-are-all-those = {COPY(best_browser, "Trackers are all those annoying “cookies” messages you get on airline sites. These third-party trackers know where you click and can be used to analyze your behavior. A private browser should give users the option to turn off third-party trackers, but ideally, turn them off by default.",)} -best-browser-another-way-to-stop = {COPY(best_browser, "Another way to stop trackers from tracking is using private mode to browse. Any browser that claims to be private should offer browsing in private mode.",)} -""", - best_browser=best_browser, - ) - + [ - FTL.Message( - id=FTL.Identifier("best-browser-one-easy-way-to-check"), - value=REPLACE( - best_browser, - 'One easy way to check is to visit a browser’s content setting page and privacy policy. The privacy webpage should outline if your data is shared and why. It’s why the Firefox privacy notice is easy to read and easy to find.', - { - "%%": "%", - "%(privacy)s": VARIABLE_REFERENCE("privacy"), - "Firefox": TERM_REFERENCE("brand-name-firefox"), - }, - ), - ), - ] - + transforms_from( - """ -best-browser-choosing-the-best-browser = {COPY(best_browser, "Choosing the best browser for you is a lot like choosing a home. You want to explore your options, do some research and make a decision based on what’s important to you.",)} -""", - best_browser=best_browser, - ) - + [ - FTL.Message( - id=FTL.Identifier("best-browser-at-firefox-weve-worked"), - value=REPLACE( - best_browser, - 'At Firefox, we’ve worked hard to build a browser that is twice as fast as before and gives users more control over their online life.', - { - "%%": "%", - "%(firefox)s": VARIABLE_REFERENCE("firefox"), - "Firefox": TERM_REFERENCE("brand-name-firefox"), - }, - ), - ), - ] - + transforms_from( - """ -best-browser-take-control-of-your = {COPY(best_browser, "Take control of your browser.",)} -""", - best_browser=best_browser, - ), - ) diff --git a/lib/fluent_migrations/firefox/browsers/browser-history.py b/lib/fluent_migrations/firefox/browsers/browser-history.py deleted file mode 100644 index 9d42bda1a8..0000000000 --- a/lib/fluent_migrations/firefox/browsers/browser-history.py +++ /dev/null @@ -1,238 +0,0 @@ -from __future__ import absolute_import - -import fluent.syntax.ast as FTL -from fluent.migrate import COPY, REPLACE -from fluent.migrate.helpers import TERM_REFERENCE, VARIABLE_REFERENCE, transforms_from - -browser_history = "firefox/browsers/browser-history.lang" -browser_history = "mozorg/browser-history.lang" - - -def migrate(ctx): - """Migrate bedrock/firefox/templates/firefox/browsers/browser-history.html, part {index}.""" - - ctx.add_transforms( - "firefox/browsers/history/browser-history.ftl", - "firefox/browsers/history/browser-history.ftl", - transforms_from( - """ -browser-history-browser-history = {COPY(browser_history, "Browser History: Epic power struggles that brought us modern browsers",)} -browser-history-the-browser-wars-underdogs-giants = {COPY(browser_history, "The browser wars, underdogs vs giants, and moments that changed the world. Read about the history of the web browser.",)} -browser-history-the-history-of-web = {COPY(browser_history, "The History of Web Browsers",)} -browser-history-world-history-is = {COPY(browser_history, "World history is rife with epic power struggles, world-conquering tyrants, and heroic underdogs. The history of web browsers isn’t very different. University pioneers wrote simple software that sparked an information revolution, and battle for browser superiority and internet users.",)} -browser-history-before-web-era = {COPY(browser_history, "Before Web Era",)} -browser-history-in-1950-computers = {COPY(browser_history, "In 1950, computers took up whole rooms and were dumber than today’s pocket calculators. But progress was swift, and by 1960 they were able to run complex programs. Governments and universities across the globe thought it would be great if the machines could talk, nurturing collaboration and scientific breakthroughs.",)} -""", - browser_history=browser_history, - ) - + [ - FTL.Message( - id=FTL.Identifier("browser-history-arpanet-was-the"), - value=REPLACE( - browser_history, - 'ARPANET was the first successful networking project and in 1969 the first message was sent from the computer science lab at University of California, Los Angeles (UCLA) to Stanford Research Institute (SRI), also in California.', - { - "%%": "%", - "%(arpanet)s": VARIABLE_REFERENCE("arpanet"), - }, - ), - ), - ] - + transforms_from( - """ -browser-history-that-sparked-a-revolution = {COPY(browser_history, "That sparked a revolution in computer networking. New networks formed, connecting universities and research centers across the globe. But for the next 20 years, the internet wasn’t accessible to the public. It was restricted to university and government researchers, students, and private corporations. There were dozens of programs that could trade information over telephone lines, but none of them were easy to use. The real open internet, and the first web browser, wasn’t created until 1990.",)} -browser-history-web-era = {COPY(browser_history, "Web Era",)} -""", - browser_history=browser_history, - ) - + [ - FTL.Message( - id=FTL.Identifier("browser-history-british-computer"), - value=REPLACE( - browser_history, - 'British computer scientist Tim Berners-Lee created the first web server and graphical web browser in 1990 while working at CERN, the European Organization for Nuclear Research, in Switzerland. He called his new window into the internet “WorldWideWeb.” It was an easy-to-use graphical interface created for the NeXT computer. For the first time, text documents were linked together over a public network—the web as we know it.', - { - "%%": "%", - "%(cern)s": VARIABLE_REFERENCE("cern"), - }, - ), - ), - ] - + transforms_from( - """ -browser-history-a-year-later-berners = {COPY(browser_history, "A year later, Berners-Lee asked CERN math student Nicola Pellow to write the Line Mode Browser, a program for basic computer terminals.",)} -""", - browser_history=browser_history, - ) - + [ - FTL.Message( - id=FTL.Identifier("browser-history-by-1993-the-web"), - value=REPLACE( - browser_history, - 'By 1993, the web exploded. Universities, governments, and private corporations all saw opportunity in the open internet. Everyone needed new computer programs to access it. That year, Mosaic was created at the National Center for Supercomputing Applications (NCSA) at the University of Illinois Urbana-Champaign by computer scientist Marc Andreessen. It was the very first popular web browser and the early ancestor of Mozilla Firefox.', - { - "%%": "%", - "%(firefox)s": VARIABLE_REFERENCE("firefox"), - "Mozilla": TERM_REFERENCE("brand-name-mozilla"), - "Firefox": TERM_REFERENCE("brand-name-firefox"), - }, - ), - ), - FTL.Message( - id=FTL.Identifier("browser-history-ncsa-mosaic-ran"), - value=REPLACE( - browser_history, - 'NCSA Mosaic ran on Windows computers, was easy to use, and gave anyone with a PC access to early web pages, chat rooms, and image libraries. The next year (1994), Andreessen founded Netscape and released Netscape Navigator to the public. It was wildly successful, and the first browser for the people. It was also the first move in a new kind of war for internet users.', - { - "%%": "%", - "%(netscape)s": VARIABLE_REFERENCE("netscape"), - "Netscape": TERM_REFERENCE("brand-name-netscape"), - "Windows": TERM_REFERENCE("brand-name-windows"), - }, - ), - ), - ] - + transforms_from( - """ -browser-history-the-browser-wars = {COPY(browser_history, "The Browser Wars",)} -""", - browser_history=browser_history, - ) - + [ - FTL.Message( - id=FTL.Identifier("browser-history-by-1995-netscape"), - value=REPLACE( - browser_history, - 'By 1995, Netscape Navigator wasn’t the only way to get online. Computer software giant Microsoft licensed the old Mosaic code and built its own window to the web, Internet Explorer. The release sparked a war. Netscape and Microsoft worked feverishly to make new versions of their programs, each attempting to outdo the other with faster, better products.', - { - "%%": "%", - "%(ie)s": VARIABLE_REFERENCE("ie"), - "Internet Explorer": TERM_REFERENCE("brand-name-ie"), - "Microsoft": TERM_REFERENCE("brand-name-microsoft"), - "Netscape": TERM_REFERENCE("brand-name-netscape"), - }, - ), - ), - FTL.Message( - id=FTL.Identifier("browser-history-netscape-created"), - value=REPLACE( - browser_history, - 'Netscape created and released JavaScript, which gave websites powerful computing capabilities they never had before. (They also made the infamous <blink> tag.) Microsoft countered with Cascading Style Sheets (CSS), which became the standard for web page design.', - { - "%%": "%", - "%(blink)s": VARIABLE_REFERENCE("blink"), - "Microsoft": TERM_REFERENCE("brand-name-microsoft"), - "Netscape": TERM_REFERENCE("brand-name-netscape"), - }, - ), - ), - FTL.Message( - id=FTL.Identifier("browser-history-things-got-a-little"), - value=REPLACE( - browser_history, - 'Things got a little out of hand in 1997 when Microsoft released Internet Explorer 4.0. The team built a giant letter “e” and snuck it on the lawn of Netscape headquarters. The Netscape team promptly knocked the giant “e” over and put their own Mozilla dinosaur mascot on top of it.', - { - "%%": "%", - "%(dino)s": VARIABLE_REFERENCE("dino"), - "Internet Explorer": TERM_REFERENCE("brand-name-ie"), - "Microsoft": TERM_REFERENCE("brand-name-microsoft"), - "Netscape": TERM_REFERENCE("brand-name-netscape"), - "Mozilla": TERM_REFERENCE("brand-name-mozilla"), - }, - ), - ), - FTL.Message( - id=FTL.Identifier("browser-history-then-microsoft-began"), - value=REPLACE( - browser_history, - 'Then Microsoft began shipping Internet Explorer with their Windows operating system. Within 4 years, it had 75%% of the market and by 1999 it had 99%% of the market. The company faced antitrust litigation over the move, and Netscape decided to open source its codebase and created the not-for-profit Mozilla, which went on to create and release Firefox in 2002. Realizing that having a browser monopoly wasn’t in the best interests of users and the open web, Firefox was created to provide choice for web users. By 2010, Mozilla Firefox and others had reduced Internet Explorer’s market share to 50%%.', - { - "%%": FTL.TextElement("%"), - "%(mozilla)s": VARIABLE_REFERENCE("mozilla"), - "%(marketshare)s": VARIABLE_REFERENCE("marketshare"), - "Internet Explorer": TERM_REFERENCE("brand-name-ie"), - "Microsoft": TERM_REFERENCE("brand-name-microsoft"), - "Windows": TERM_REFERENCE("brand-name-windows"), - "Netscape": TERM_REFERENCE("brand-name-netscape"), - "Mozilla": TERM_REFERENCE("brand-name-mozilla"), - "Firefox": TERM_REFERENCE("brand-name-firefox"), - }, - ), - ), - FTL.Message( - id=FTL.Identifier("browser-history-other-competitors"), - value=REPLACE( - browser_history, - "Other competitors emerged during the late ‘90s and early 2000s, including Opera, Safari, and Google Chrome. Microsoft Edge replaced Internet Explorer with the release of Windows 10 in 2015.", - { - "Internet Explorer": TERM_REFERENCE("brand-name-ie"), - "Microsoft": TERM_REFERENCE("brand-name-microsoft"), - "Windows": TERM_REFERENCE("brand-name-windows"), - "Google": TERM_REFERENCE("brand-name-google"), - "Chrome": TERM_REFERENCE("brand-name-chrome"), - "Safari": TERM_REFERENCE("brand-name-safari"), - "Opera": TERM_REFERENCE("brand-name-opera"), - "Edge": TERM_REFERENCE("brand-name-edge"), - }, - ), - ), - ] - + transforms_from( - """ -browser-history-browsing-the-web = {COPY(browser_history, "Browsing the Web Today",)} -""", - browser_history=browser_history, - ) - + [ - FTL.Message( - id=FTL.Identifier("browser-history-today-there-are"), - value=REPLACE( - browser_history, - 'Today there are just a handful of ways to access the internet. Firefox, Google Chrome, Microsoft Edge, Safari and Opera are the main competitors. Mobile devices have emerged during the past decade as the preferred way to access the internet. Today, most internet users only use mobile browsers and applications to get online. Mobile versions of the major browsers are available for iOS and Android devices. While these apps are very useful for specific purposes, they only provide limited access to the web.', - { - "%%": "%", - "%(applications)s": VARIABLE_REFERENCE("applications"), - "Microsoft": TERM_REFERENCE("brand-name-microsoft"), - "Firefox": TERM_REFERENCE("brand-name-firefox"), - "Android": TERM_REFERENCE("brand-name-android"), - "Google": TERM_REFERENCE("brand-name-google"), - "Chrome": TERM_REFERENCE("brand-name-chrome"), - "Safari": TERM_REFERENCE("brand-name-safari"), - "Opera": TERM_REFERENCE("brand-name-opera"), - "Edge": TERM_REFERENCE("brand-name-edge"), - "iOS": TERM_REFERENCE("brand-name-ios"), - }, - ), - ), - FTL.Message( - id=FTL.Identifier("browser-history-in-the-future-the"), - value=REPLACE( - browser_history, - 'In the future, the web will likely stray further from its hypertext roots to become a vast sea of interactive experiences. Virtual reality has been on the horizon for decades (at least since the release of Lawnmower Man in 1992 and the Nintendo Virtual Boy in 1995), but the web may finally bring it to the masses. Firefox now has support for WebVR and A-Frame, which let developers quickly and easily build virtual reality websites. Most modern mobile devices support WebVR, and can easily be used as headsets with simple cardboard cases. A 3D virtual reality web like the one imagined by science fiction author Neal Stephenson may be just around the corner. If that’s the case, the web browser itself may completely disappear and become a true window into another world.', - { - "%%": "%", - "%(vr)s": VARIABLE_REFERENCE("vr"), - "Firefox": TERM_REFERENCE("brand-name-firefox"), - }, - ), - ), - FTL.Message( - id=FTL.Identifier("browser-history-whatever-the-future"), - value=REPLACE( - browser_history, - "Whatever the future of the web holds, Mozilla and Firefox will be there for users, ensuring that they have powerful tools to experience the web and all it has to offer. The web is for everyone, and everyone should have control of their online experience. That’s why we give Firefox tools to protect user privacy and we never sell user data to advertisers.", - { - "Mozilla": TERM_REFERENCE("brand-name-mozilla"), - "Firefox": TERM_REFERENCE("brand-name-firefox"), - }, - ), - ), - ] - + transforms_from( - """ -browser-history-resources = {COPY(browser_history, "Resources",)} -browser-history-take-control-of = {COPY(browser_history, "Take control of your browser.",)} -""", - browser_history=browser_history, - ), - ) diff --git a/lib/fluent_migrations/firefox/browsers/compare/__init__.py b/lib/fluent_migrations/firefox/browsers/compare/__init__.py deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/lib/fluent_migrations/firefox/browsers/compare/chrome.py b/lib/fluent_migrations/firefox/browsers/compare/chrome.py deleted file mode 100644 index 2b36d635c3..0000000000 --- a/lib/fluent_migrations/firefox/browsers/compare/chrome.py +++ /dev/null @@ -1,265 +0,0 @@ -from __future__ import absolute_import - -import fluent.syntax.ast as FTL -from fluent.migrate import COPY, REPLACE -from fluent.migrate.helpers import TERM_REFERENCE, VARIABLE_REFERENCE, transforms_from - -chrome = "firefox/compare/chrome.lang" - - -def migrate(ctx): - """Migrate bedrock/firefox/templates/firefox/browsers/compare/chrome.html, part {index}.""" - - ctx.add_transforms( - "firefox/browsers/compare/chrome.ftl", - "firefox/browsers/compare/chrome.ftl", - transforms_from( - """ -compare-chrome-we-compare-mozilla-firefox = {COPY(chrome, "We compare Mozilla Firefox with Google Chrome in terms of privacy, utility and portability",)} -""", - chrome=chrome, - ) - + [ - FTL.Message( - id=FTL.Identifier("compare-chrome-at-firefox-we-have-a-huge"), - value=REPLACE( - chrome, - "At Firefox, we have a huge number of dedicated users who appreciate our steadfast dedication to online privacy. For example, the latest version of Firefox includes a feature called Enhanced Tracking Protection (ETP) which is turned on by default for all users worldwide. ETP blocks over 2,000 trackers, including social trackers from companies like Facebook, Twitter, and LinkedIn. It also has an integrated feature called Firefox Monitor that automatically notifies you if your password has been breached or needs to be updated. In addition to these protections, Firefox's Private Browsing mode automatically deletes your browsing information such as history and cookies, leaving no trace after you finish your session.", - { - "%%": "%", - "%(attrs)s": VARIABLE_REFERENCE("attrs"), - "Firefox": TERM_REFERENCE("brand-name-firefox"), - "Facebook": TERM_REFERENCE("brand-name-facebook"), - "Twitter": TERM_REFERENCE("brand-name-twitter"), - "Firefox Monitor": TERM_REFERENCE("brand-name-firefox-monitor"), - }, - ), - ), - FTL.Message( - id=FTL.Identifier("compare-chrome-weve-also-recently-restated"), - value=REPLACE( - chrome, - "We’ve also recently restated our commitment to privacy and transparency regarding user data in our most recent Privacy Notice that states, “At Mozilla, we believe that privacy is fundamental to a healthy internet.”", - { - "%%": "%", - "%(attrs)s": VARIABLE_REFERENCE("attrs"), - }, - ), - ), - ] - + transforms_from( - """ -compare-chrome-ultimately-its-up-to-you = {COPY(chrome, "Ultimately, it’s up to you to decide whether or not or where to draw the line with sharing things like your search history and shopping history. But if you’re anything like most people, you’ve probably searched for some things on the internet that you would rather keep private.",)} -""", - chrome=chrome, - ), - ) - ctx.add_transforms( - "firefox/browsers/compare/chrome.ftl", - "firefox/browsers/compare/chrome.ftl", - [ - FTL.Message( - id=FTL.Identifier("compare-chrome-google-chrome-is-by-all-accounts"), - value=REPLACE( - "firefox/compare/chrome.lang", - "Google Chrome is by all accounts a secure browser, with features like Google Safe Browsing, which helps protect users by displaying an impossible-to-miss warning when they attempt to navigate to dangerous sites or download dangerous files.", - { - "Google": TERM_REFERENCE("brand-name-google"), - "Chrome": TERM_REFERENCE("brand-name-chrome"), - }, - ), - ), - FTL.Message( - id=FTL.Identifier("compare-chrome-firefox-vs-chrome-which-is"), - value=REPLACE( - "firefox/compare/chrome.lang", - "Firefox vs. Chrome: Which is better?", - { - "Firefox": TERM_REFERENCE("brand-name-firefox"), - "Chrome": TERM_REFERENCE("brand-name-chrome"), - }, - ), - ), - FTL.Message( - id=FTL.Identifier("compare-chrome-comparing-firefox-browser"), - value=REPLACE( - "firefox/compare/chrome.lang", - "Comparing Firefox Browser with Google Chrome", - { - "Firefox Browser": TERM_REFERENCE("brand-name-firefox-browser"), - }, - ), - ), - FTL.Message( - id=FTL.Identifier("compare-chrome-fast-forward-to-today-the"), - value=REPLACE( - "firefox/compare/chrome.lang", - "Fast-forward to today, the competitive landscape for browsers has changed with many people beginning to question just what is happening to their online data such as browsing history, passwords, and other sensitive information. A lot has changed since 2008 when Chrome came onto the scene. At Firefox, we’ve been heads down, working to redesign our interface and provide users with an ever growing number of privacy and performance enhancements as well as plenty of handy browser tools.", - { - "Firefox": TERM_REFERENCE("brand-name-firefox"), - "Chrome": TERM_REFERENCE("brand-name-chrome"), - }, - ), - ), - FTL.Message( - id=FTL.Identifier("compare-chrome-and-so-here-we-are-the-browser"), - value=REPLACE( - "firefox/compare/chrome.lang", - "And so here we are, the browser-wars are escalating once again and it’s time to reevaluate and compare Firefox Browser vs Google Chrome.", - { - "Firefox Browser": TERM_REFERENCE("brand-name-firefox-browser"), - }, - ), - ), - FTL.Message( - id=FTL.Identifier("compare-chrome-in-2008-google-introduced"), - value=REPLACE( - "firefox/compare/chrome.lang", - "In 2008, Google introduced Chrome, and its impact as an innovation in browser technology was immediate. It was faster for loading sites, took up minimal screen space and offered an undeniably simple user interface.", - { - "Google": TERM_REFERENCE("brand-name-google"), - "Chrome": TERM_REFERENCE("brand-name-chrome"), - }, - ), - ), - FTL.Message( - id=FTL.Identifier("compare-chrome-in-fact-both-chrome-and-firefox"), - value=REPLACE( - "firefox/compare/chrome.lang", - "In fact, both Chrome and Firefox have rigorous security in place. Both include a thing called “sandboxing” which separates the processes of the browser so something like a harmful website doesn’t infect other parts of your laptop or other device.", - { - "Firefox": TERM_REFERENCE("brand-name-firefox"), - "Chrome": TERM_REFERENCE("brand-name-chrome"), - }, - ), - ), - FTL.Message( - id=FTL.Identifier("compare-chrome-while-chrome-proves-to-be"), - value=REPLACE( - "firefox/compare/chrome.lang", - "While Chrome proves to be a safe web browser, its privacy record is questionable. Google actually collects a disturbingly large amount of data from its users including location, search history and site visits. Google makes its case for data collection saying it’s doing it to improve its services – like helping you find a sweater or a coffee shop like the one you previously bought or visited. However, others might disagree, making the point that Google is actually gathering an unprecedented amount of data for its own marketing purposes. They tout that they’re keeping your information private from hackers, but that’s beside the point. Google itself runs the world’s largest advertising network, thanks in large part to data they harvest from their users.", - { - "Google": TERM_REFERENCE("brand-name-google"), - "Chrome": TERM_REFERENCE("brand-name-chrome"), - }, - ), - ), - FTL.Message( - id=FTL.Identifier("compare-chrome-in-terms-of-features-both"), - value=REPLACE( - "firefox/compare/chrome.lang", - "In terms of features, both Firefox and Chrome offer a large library of extensions and plug-ins, with Chrome’s catalog vastly outnumbering any other browser while nicely integrating with other Google services, like Gmail and Google Docs.", - { - "Google": TERM_REFERENCE("brand-name-google"), - "Chrome": TERM_REFERENCE("brand-name-chrome"), - "Firefox": TERM_REFERENCE("brand-name-firefox"), - }, - ), - ), - FTL.Message( - id=FTL.Identifier("compare-chrome-firefox-also-has-a-sync-feature"), - value=REPLACE( - "firefox/compare/chrome.lang", - "Firefox also has a sync feature to see your open and recent tabs, browsing history, and bookmarks across all your devices.", - { - "Firefox": TERM_REFERENCE("brand-name-firefox"), - }, - ), - ), - FTL.Message( - id=FTL.Identifier("compare-chrome-while-chrome-gets-the-nod"), - value=REPLACE( - "firefox/compare/chrome.lang", - "While Chrome gets the nod with add-ons and extensions, Firefox has a nicely curated set of built-in features, such as the incredibly handy screen capture tool, and reading mode feature which strips away everything from the page except the text from the article you’re reading.", - { - "Chrome": TERM_REFERENCE("brand-name-chrome"), - "Firefox": TERM_REFERENCE("brand-name-firefox"), - }, - ), - ), - FTL.Message( - id=FTL.Identifier("compare-chrome-although-not-as-extensive"), - value=REPLACE( - "firefox/compare/chrome.lang", - "Although not as extensive as Chrome’s add-on library, Firefox, as open-source software with a huge number of active contributors, also features an incredible number of useful extensions.", - { - "Chrome": TERM_REFERENCE("brand-name-chrome"), - "Firefox": TERM_REFERENCE("brand-name-firefox"), - }, - ), - ), - FTL.Message( - id=FTL.Identifier("compare-chrome-if-having-tons-of-open-tabs"), - value=REPLACE( - "firefox/compare/chrome.lang", - "If having tons of open tabs is your thing, then it really comes down to your UI preference. Firefox features a horizontal scroll on all your open tabs rather than shrinking them smaller and smaller with each new one. Google Chrome prefers to shrink them down so just the favicon is visible. The only problem with this is when you have multiple tabs open from the same website, so you see the same favicon across your tabs.", - { - "Firefox": TERM_REFERENCE("brand-name-firefox"), - }, - ), - ), - FTL.Message( - id=FTL.Identifier("compare-chrome-almost-needless-to-say-versions"), - value=REPLACE( - "firefox/compare/chrome.lang", - "Almost needless to say, versions of both Firefox and Chrome are available for the most popular desktop and mobile operating systems (Windows, macOS, Linux, Android, iOS).", - { - "Firefox": TERM_REFERENCE("brand-name-firefox"), - "Chrome": TERM_REFERENCE("brand-name-chrome"), - "Windows": TERM_REFERENCE("brand-name-windows"), - "macOS": TERM_REFERENCE("brand-name-mac"), - "Linux": TERM_REFERENCE("brand-name-linux"), - "Android": TERM_REFERENCE("brand-name-android"), - "iOS": TERM_REFERENCE("brand-name-ios"), - }, - ), - ), - FTL.Message( - id=FTL.Identifier("compare-chrome-both-chrome-and-firefox-also"), - value=REPLACE( - "firefox/compare/chrome.lang", - "Both Chrome and Firefox also allow you to sync things like passwords, bookmarks, and open tabs across all your devices. If you have a Firefox account, you can manually send an open tab on your desktop to your mobile device or vice versa. With Chrome, it’s done automatically if you’ve chosen that setting in your preferences. Not having to manually send the tab from one device to the other is convenient when you want to do something like continue reading an article you didn’t finish earlier. But there could be times where automatic syncing might not be ideal if there’s a chance multiple users are browsing while signed in to your Google account.", - { - "Firefox": TERM_REFERENCE("brand-name-firefox"), - "Chrome": TERM_REFERENCE("brand-name-chrome"), - "Google": TERM_REFERENCE("brand-name-google"), - }, - ), - ), - FTL.Message( - id=FTL.Identifier("compare-chrome-we-think-its-fair-to-say"), - value=REPLACE( - "firefox/compare/chrome.lang", - "We think it’s fair to say Firefox and Chrome are really neck and neck in terms of portability and utility, with Chrome having a slight edge in utility because of its huge library of extensions and add-on features. But in terms of Privacy, Firefox wins the day with our commitment to preserving our users’ online data and providing free baked-in services like password managers that also alert you if there happens to be a data breach involving your credentials.", - { - "Firefox": TERM_REFERENCE("brand-name-firefox"), - "Chrome": TERM_REFERENCE("brand-name-chrome"), - "Google": TERM_REFERENCE("brand-name-google"), - }, - ), - ), - FTL.Message( - id=FTL.Identifier("compare-chrome-as-for-customization-our"), - value=REPLACE( - "firefox/compare/chrome.lang", - "As for customization, our fans will tell you one of the things they love most about our browser is its ability to allow you to move and arrange a majority of the UI elements to best suit your needs. Chrome allows you to hide certain UI elements but there’s not much allowance, if any, for moving things around based on your preferences. However, it should be noted that both Chrome and Firefox make it pretty easy to change your browser’s appearance and theme.", - { - "Firefox": TERM_REFERENCE("brand-name-firefox"), - "Chrome": TERM_REFERENCE("brand-name-chrome"), - }, - ), - ), - FTL.Message( - id=FTL.Identifier("compare-chrome-for-practical-purposes-theres"), - value=REPLACE( - "firefox/compare/chrome.lang", - "For practical purposes, there’s obviously really nothing preventing you from using both browsers—Firefox for those moments in life when privacy really matters, and Chrome if you’re still invested in the Google ecosystem. Yet with the growing number of incursions into our personal data, Firefox may prove to be the right choice in the long run for those of us who value protecting our personal privacy online.", - { - "Firefox": TERM_REFERENCE("brand-name-firefox"), - "Chrome": TERM_REFERENCE("brand-name-chrome"), - "Google": TERM_REFERENCE("brand-name-google"), - }, - ), - ), - ], - ) diff --git a/lib/fluent_migrations/firefox/browsers/compare/edge.py b/lib/fluent_migrations/firefox/browsers/compare/edge.py deleted file mode 100644 index fa74c4c178..0000000000 --- a/lib/fluent_migrations/firefox/browsers/compare/edge.py +++ /dev/null @@ -1,291 +0,0 @@ -from __future__ import absolute_import - -import fluent.syntax.ast as FTL -from fluent.migrate import COPY, REPLACE -from fluent.migrate.helpers import TERM_REFERENCE, VARIABLE_REFERENCE, transforms_from - -edge = "firefox/compare/edge.lang" - - -def migrate(ctx): - """Migrate bedrock/firefox/templates/firefox/browsers/compare/edge.html, part {index}.""" - - ctx.add_transforms( - "firefox/browsers/compare/edge.ftl", - "firefox/browsers/compare/edge.ftl", - [ - FTL.Message( - id=FTL.Identifier("compare-edge-firefox-vs-microsoft-edge-which"), - value=REPLACE( - edge, - "Firefox vs. Microsoft Edge: Which is the better browser for you?", - { - "Firefox": TERM_REFERENCE("brand-name-firefox"), - "Microsoft": TERM_REFERENCE("brand-name-microsoft"), - "Edge": TERM_REFERENCE("brand-name-edge"), - }, - ), - ), - FTL.Message( - id=FTL.Identifier("compare-edge-compare-microsoft-edge-to-the"), - value=REPLACE( - edge, - "Compare Microsoft Edge to the Firefox Browser to find out which is the better browser for you.", - { - "Firefox Browser": TERM_REFERENCE("brand-name-firefox-browser"), - "Microsoft": TERM_REFERENCE("brand-name-microsoft"), - "Edge": TERM_REFERENCE("brand-name-edge"), - }, - ), - ), - FTL.Message( - id=FTL.Identifier("compare-edge-comparing-firefox-browser-with"), - value=REPLACE( - edge, - "Comparing Firefox Browser with Microsoft Edge", - { - "Firefox Browser": TERM_REFERENCE("brand-name-firefox-browser"), - "Microsoft": TERM_REFERENCE("brand-name-microsoft"), - "Edge": TERM_REFERENCE("brand-name-edge"), - }, - ), - ), - FTL.Message( - id=FTL.Identifier("compare-edge-with-windows-10-microsoft-introduced"), - value=REPLACE( - edge, - "With Windows 10, Microsoft introduced its Edge browser to compete with Firefox and Chrome making it the default browser pre-installed on millions of PCs sold. Even so, users were slow to adopt it and Microsoft eventually announced plans to relaunch Edge as a Chromium-based browser (Chromium of course being Google’s Open Source browser project).", - { - "Windows": TERM_REFERENCE("brand-name-windows"), - "Microsoft": TERM_REFERENCE("brand-name-microsoft"), - "Edge": TERM_REFERENCE("brand-name-edge"), - "Firefox": TERM_REFERENCE("brand-name-firefox"), - "Chrome": TERM_REFERENCE("brand-name-chrome"), - "Chromium": TERM_REFERENCE("brand-name-chromium"), - "Google": TERM_REFERENCE("brand-name-google"), - }, - ), - ), - FTL.Message( - id=FTL.Identifier("compare-edge-here-well-compare-our-firefox"), - value=REPLACE( - edge, - "Here we’ll compare our Firefox Browser to the Chromium-based Microsoft Edge in terms of privacy, utility, and portability, to help you have a better understanding of which browser better suits your needs and preferences.", - { - "Firefox Browser": TERM_REFERENCE("brand-name-firefox-browser"), - "Microsoft": TERM_REFERENCE("brand-name-microsoft"), - "Edge": TERM_REFERENCE("brand-name-edge"), - "Chromium": TERM_REFERENCE("brand-name-chromium"), - }, - ), - ), - FTL.Message( - id=FTL.Identifier("compare-edge-edge-is-integrated-into-the"), - value=REPLACE( - edge, - "Edge is integrated into the Windows 10 platform and runs in a sandbox environment, meaning it isolates programs and prevents malicious programs from spying on your computer. It has a built-in SmartScreen that scans the reputation of sites you visit and blocks suspicious sites. To enhance privacy, Edge allows you to use biometrics or a PIN with Windows Hello instead of passwords for online authentication.", - { - "Edge": TERM_REFERENCE("brand-name-edge"), - "Windows": TERM_REFERENCE("brand-name-windows"), - }, - ), - ), - FTL.Message( - id=FTL.Identifier("compare-edge-at-firefox-our-privacy-fallback"), - value=REPLACE( - edge, - "At Firefox, our privacy policy is transparent and in plain language. We actually put a lot of work into making sure it was straightforward and easy to read. We pride ourselves in protecting our users security and privacy. With Enhanced Tracking Protection now on by default, we block 2000+ trackers automatically. Trackers are those little pieces of code that try to piece together what you're doing across multiple internet sites to build a composite and detailed picture of who you are, compromising your privacy all just to target better ads.", - { - "%%": "%", - "%(attrs)s": VARIABLE_REFERENCE("attrs"), - "Firefox": TERM_REFERENCE("brand-name-firefox"), - }, - ), - ), - FTL.Message( - id=FTL.Identifier("compare-edge-your-privacy-protections-shows"), - value=REPLACE( - edge, - "Your Privacy Protections shows you the trackers and cookies that pages have attempted to leave, and how many Firefox has blocked for you.", - { - "%%": "%", - "%(attrs)s": VARIABLE_REFERENCE("attrs"), - "Firefox": TERM_REFERENCE("brand-name-firefox"), - }, - ), - ), - FTL.Message( - id=FTL.Identifier("compare-edge-in-firefox-private-browsing"), - value=REPLACE( - edge, - "In Firefox, Private Browsing mode automatically erases your browsing information like passwords, cookies, and history, leaving no trace after you close out the session. Edge on the other hand, actually records browsing history in their private mode (called “InPrivate”) and it’s a relatively easy task for someone to reconstruct your full browsing history, regardless of whether your browsing was done in regular or InPrivate mode.", - { - "Firefox": TERM_REFERENCE("brand-name-firefox"), - "Edge": TERM_REFERENCE("brand-name-edge"), - }, - ), - ), - FTL.Message( - id=FTL.Identifier("compare-edge-both-browsers-are-relatively"), - value=REPLACE( - edge, - "Both browsers are relatively equal in terms of data encryption. However, if online privacy and transparency are important to you, then Firefox is clearly a better choice here.", - { - "Firefox": TERM_REFERENCE("brand-name-firefox"), - }, - ), - ), - FTL.Message( - id=FTL.Identifier("compare-edge-firefox-is-a-fast-and-open-fallback"), - value=REPLACE( - edge, - "Firefox is a fast and open source browser, which means users can customize their browsing experience in every way possible. Firefox also allows the casual user several different ways to customize the UI with applying different themes and toolbar configurations. Since our browser has always been open source we have a large following of devoted developers who have created an extensive library of add-ons and browser extensions.", - { - "Firefox": TERM_REFERENCE("brand-name-firefox"), - }, - ), - ), - FTL.Message( - id=FTL.Identifier("compare-edge-since-edge-has-moved-to-the"), - value=REPLACE( - edge, - "Since Edge has moved to the processor intensive Chromium platform, you can expect it to run a little slower, especially if you have multiple programs running at once. However, with Chromium platform comes a massive library of extensions as well as a decent level of UI customization that Edge did not have before it’s move to Chromium.", - { - "Edge": TERM_REFERENCE("brand-name-edge"), - "Chromium": TERM_REFERENCE("brand-name-chromium"), - }, - ), - ), - FTL.Message( - id=FTL.Identifier("compare-edge-edge-has-some-nice-ui-features"), - value=REPLACE( - edge, - "Edge has some nice UI features, like their tab previews which can make it easy to find the right open tabs if you’ve got a lot of them open. Another helpful tab-related feature lets you set aside any active tabs that you aren’t using but don’t want to close down.", - { - "Edge": TERM_REFERENCE("brand-name-edge"), - }, - ), - ), - FTL.Message( - id=FTL.Identifier("compare-edge-firefox-features-a-scrolling"), - value=REPLACE( - edge, - "Firefox features a scrolling tab interface, which keeps tab information viewable and scrolls them horizontally instead of shrinking them down to just favicon size. Also whenever you open a new tab, our Pocket feature suggests relevant articles and content for you. Plus with Pocket, you can also save articles, videos, and other content with one click, for reading at a later time.", - { - "%%": "%", - "%(attrs)s": VARIABLE_REFERENCE("attrs"), - "Firefox": TERM_REFERENCE("brand-name-firefox"), - "Pocket": TERM_REFERENCE("brand-name-pocket"), - }, - ), - ), - FTL.Message( - id=FTL.Identifier("compare-edge-firefox-and-edge-both-offer-fallback"), - value=REPLACE( - edge, - "Firefox and Edge both offer excellent reading modes. With Firefox you just tap on the small icon in the search bar and the browser strips down all unnecessary elements and presents you a clean looking article. In Edge you just tap on the small book icon and browser to get a clean easy-to-read UI.", - { - "Firefox": TERM_REFERENCE("brand-name-firefox"), - "Edge": TERM_REFERENCE("brand-name-edge"), - }, - ), - ), - FTL.Message( - id=FTL.Identifier("compare-edge-firefox-also-includes-lots"), - value=REPLACE( - edge, - "Firefox also includes lots of handy built-in features by default like Enhanced Tracking Protection, a built-in screenshot tool, large file sending and more.", - { - "%%": "%", - "%(attrs)s": VARIABLE_REFERENCE("attrs"), - "Firefox": TERM_REFERENCE("brand-name-firefox"), - }, - ), - ), - FTL.Message( - id=FTL.Identifier("compare-edge-out-of-the-gate-firefox-has"), - value=REPLACE( - edge, - "Out of the gate, Firefox has more features and integrations built into the browser and readily available on download. And while both browsers have a tremendous number of add-ons and extensions available, Edge’s compatibility with Google’s Chromium platform gives it the advantage in terms of sheer numbers.", - { - "Firefox": TERM_REFERENCE("brand-name-firefox"), - "Google": TERM_REFERENCE("brand-name-google"), - "Chromium": TERM_REFERENCE("brand-name-chromium"), - }, - ), - ), - FTL.Message( - id=FTL.Identifier("compare-edge-with-internet-explorer-fallback"), - value=REPLACE( - edge, - "With Internet Explorer, Microsoft learned from its lack of availability across platforms and made Edge available for macOS and Android. The software is now readily available on iOS, Android, Windows and Mac.", - { - "Firefox": TERM_REFERENCE("brand-name-firefox"), - "Edge": TERM_REFERENCE("brand-name-edge"), - "Internet Explorer": TERM_REFERENCE("brand-name-ie"), - "Microsoft": TERM_REFERENCE("brand-name-microsoft"), - "iOS": TERM_REFERENCE("brand-name-ios"), - "Android": TERM_REFERENCE("brand-name-android"), - "Windows": TERM_REFERENCE("brand-name-windows"), - "macOS": TERM_REFERENCE("brand-name-mac"), - "Mac": TERM_REFERENCE("brand-name-mac"), - }, - ), - ), - FTL.Message( - id=FTL.Identifier("compare-edge-firefox-has-been-available"), - value=REPLACE( - edge, - "Firefox has been available on iOS, Android, Windows, macOS and Linux for years. And as you would expect with any modern browser, Firefox lets you log in with a free account and sync data such as passwords, browsing history, bookmarks, and open tabs between your computer, tablet and phone. It also allows you to sync across platforms as well.", - { - "%%": "%", - "%(attrs)s": VARIABLE_REFERENCE("attrs"), - "Firefox": TERM_REFERENCE("brand-name-firefox"), - "iOS": TERM_REFERENCE("brand-name-ios"), - "Android": TERM_REFERENCE("brand-name-android"), - "Windows": TERM_REFERENCE("brand-name-windows"), - "macOS": TERM_REFERENCE("brand-name-mac"), - "Linux": TERM_REFERENCE("brand-name-linux"), - }, - ), - ), - FTL.Message( - id=FTL.Identifier("compare-edge-edge-also-allows-you-to-fallback"), - value=REPLACE( - edge, - "Edge also allows you to connect your associated Microsoft account and sign in to sync your favorites, history, passwords, and more between your computer and iOS or Android devices, although some Android tablets are not currently supported.", - { - "Edge": TERM_REFERENCE("brand-name-edge"), - "Microsoft": TERM_REFERENCE("brand-name-microsoft"), - "iOS": TERM_REFERENCE("brand-name-ios"), - "Android": TERM_REFERENCE("brand-name-android"), - }, - ), - ), - FTL.Message( - id=FTL.Identifier("compare-edge-aside-from-sucking-up-a-lot"), - value=REPLACE( - edge, - "Aside from sucking up a lot of computing power, Edge running on Chromium has answered a lot of users’ needs for functionality and features. But there’s still a lot to account for in terms of the browser’s privacy protections. It’s our assessment that Firefox is still a better choice for most people to use in their daily lives, based not only on functionality but more importantly on our transparency in how we collect user data, what exactly we collect, and what we do with it. Because our parent company is Mozilla, a non-profit organization dedicated to internet privacy and freedom, we simply have a different set of priorities when it comes to users’ data.", - { - "%%": "%", - "%(attrs)s": VARIABLE_REFERENCE("attrs"), - "Edge": TERM_REFERENCE("brand-name-edge"), - "Firefox": TERM_REFERENCE("brand-name-firefox"), - "Mozilla": TERM_REFERENCE("brand-name-mozilla"), - "Chromium": TERM_REFERENCE("brand-name-chromium"), - }, - ), - ), - FTL.Message( - id=FTL.Identifier("compare-edge-the-bottom-line-is-that-while"), - value=REPLACE( - edge, - "The bottom line is that while we suggest using Firefox, the best browser for you ultimately will be the one that fits your individual needs with extension support, browsing tools customization, speed, privacy and security.", - { - "Firefox": TERM_REFERENCE("brand-name-firefox"), - }, - ), - ), - ], - ) diff --git a/lib/fluent_migrations/firefox/browsers/compare/ie.py b/lib/fluent_migrations/firefox/browsers/compare/ie.py deleted file mode 100644 index 35e1653237..0000000000 --- a/lib/fluent_migrations/firefox/browsers/compare/ie.py +++ /dev/null @@ -1,222 +0,0 @@ -from __future__ import absolute_import - -import fluent.syntax.ast as FTL -from fluent.migrate import COPY, REPLACE -from fluent.migrate.helpers import TERM_REFERENCE, VARIABLE_REFERENCE, transforms_from - -ie = "firefox/compare/ie.lang" - - -def migrate(ctx): - """Migrate bedrock/firefox/templates/firefox/browsers/compare/ie.html, part {index}.""" - - ctx.add_transforms( - "firefox/browsers/compare/ie.ftl", - "firefox/browsers/compare/ie.ftl", - [ - FTL.Message( - id=FTL.Identifier("compare-ie-firefox-vs-internet-explorer"), - value=REPLACE( - ie, - "Firefox vs. Internet Explorer: Which is the better browser for you?", - { - "Internet Explorer": TERM_REFERENCE("brand-name-ie"), - "Firefox": TERM_REFERENCE("brand-name-firefox"), - }, - ), - ), - FTL.Message( - id=FTL.Identifier("compare-ie-compare-internet-explorer-to"), - value=REPLACE( - ie, - "Compare Internet Explorer to the Firefox Browser to find out which is the better browser for you.", - { - "Internet Explorer": TERM_REFERENCE("brand-name-ie"), - "Firefox Browser": TERM_REFERENCE("brand-name-firefox-browser"), - }, - ), - ), - FTL.Message( - id=FTL.Identifier("compare-ie-comparing-firefox-browser-with"), - value=REPLACE( - ie, - "Comparing Firefox Browser with Microsoft Internet Explorer", - { - "Internet Explorer": TERM_REFERENCE("brand-name-ie"), - "Microsoft": TERM_REFERENCE("brand-name-microsoft"), - "Firefox Browser": TERM_REFERENCE("brand-name-firefox-browser"), - }, - ), - ), - FTL.Message( - id=FTL.Identifier("compare-ie-while-microsofts-internet-explorer"), - value=REPLACE( - ie, - "While Microsoft’s Internet Explorer still comes pre-installed on most Windows-based PCs, clearly Microsoft would prefer you to use their Edge browser, which is set as the default when you purchase.", - { - "Internet Explorer": TERM_REFERENCE("brand-name-ie"), - "Microsoft": TERM_REFERENCE("brand-name-microsoft"), - "Edge": TERM_REFERENCE("brand-name-edge"), - "Windows": TERM_REFERENCE("brand-name-windows"), - }, - ), - ), - FTL.Message( - id=FTL.Identifier("compare-ie-microsoft-discontinued-its-internet"), - value=REPLACE( - ie, - "Microsoft discontinued its Internet Explorer brand several years ago, in favor of its updated Edge browser for Windows 10. However, slow adoption for Edge created room for Internet Explorer to live on, mainly for business compatibility reasons.", - { - "Internet Explorer": TERM_REFERENCE("brand-name-ie"), - "Microsoft": TERM_REFERENCE("brand-name-microsoft"), - "Edge": TERM_REFERENCE("brand-name-edge"), - "Windows": TERM_REFERENCE("brand-name-windows"), - }, - ), - ), - FTL.Message( - id=FTL.Identifier("compare-ie-here-well-compare-our-firefox"), - value=REPLACE( - ie, - "Here we’ll compare our Firefox Browser with Internet Explorer in terms of security, utility, and portability. We’ll help you understand the differences between how a modern browser like Firefox that adheres to web standards compares with the browser you may be using for business purposes or out of old habits that die hard.", - { - "Internet Explorer": TERM_REFERENCE("brand-name-ie"), - "Firefox Browser": TERM_REFERENCE("brand-name-firefox-browser"), - "Firefox": TERM_REFERENCE("brand-name-firefox"), - }, - ), - ), - FTL.Message( - id=FTL.Identifier("compare-ie-if-you-havent-moved-on-from-using"), - value=REPLACE( - ie, - "If you haven’t moved on from using Internet Explorer, the security risk factor alone should be enough to convince you. Microsoft’s own security chief has warned millions of people who continue to use Internet Explorer as their main web browser that they are placing themselves in “peril.”", - { - "%%": "%", - "%(attrs)s": VARIABLE_REFERENCE("attrs"), - "Internet Explorer": TERM_REFERENCE("brand-name-ie"), - }, - ), - ), - FTL.Message( - id=FTL.Identifier("compare-ie-microsoft-is-no-longer-supporting"), - value=REPLACE( - ie, - "Microsoft is no longer supporting new development for Internet Explorer, which means security concerns are rampant. Microsoft openly acknowledges the fact that vulnerabilities exist within basically every version of Internet Explorer.", - { - "Internet Explorer": TERM_REFERENCE("brand-name-ie"), - "Microsoft": TERM_REFERENCE("brand-name-microsoft"), - }, - ), - ), - FTL.Message( - id=FTL.Identifier("compare-ie-so-whats-the-solution-if-your-fallback"), - value=REPLACE( - ie, - "So what’s the solution if your company is running outdated apps that only work on Internet Explorer? Our best advice for you personally is, don’t mix business with pleasure. The simple thing to do is download and use a more secure browser like Firefox. Then, if you need to do things like check your personal email or shop online, you can just switch over to the more secure browser. The bottom line is, if Microsoft is warning people not to use Internet Explorer, don’t use it. Your online privacy and security are not worth risking because you (or your company) have a hard time breaking an old habit. We make Firefox with security and privacy features like Lockwise, our password manager, private browsing and lots of other add-ons that help us make the web safer for you. Also, our Privacy Policy is straightforward: we tell you what we know about you, and why we collect that information. All of these things obviously go beyond what Internet Explorer offers, and even what other modern browsers like Google Chrome and Microsoft Edge offer.", - { - "%%": "%", - "%(lockwise)s": VARIABLE_REFERENCE("lockwise"), - "%(privacy)s": VARIABLE_REFERENCE("privacy"), - "Internet Explorer": TERM_REFERENCE("brand-name-ie"), - "Firefox": TERM_REFERENCE("brand-name-firefox"), - "Lockwise": TERM_REFERENCE("brand-name-lockwise"), - "Microsoft": TERM_REFERENCE("brand-name-microsoft"), - "Google": TERM_REFERENCE("brand-name-google"), - "Chrome": TERM_REFERENCE("brand-name-chrome"), - "Edge": TERM_REFERENCE("brand-name-edge"), - }, - ), - ), - FTL.Message( - id=FTL.Identifier("compare-ie-alarmingly-4-to-5-of-all-desktop-fallback"), - value=REPLACE( - ie, - "Alarmingly, 4 to 5% of all desktop web traffic comes through Internet Explorer. That might not seem like a lot, but in reality it means millions of people are being served a poor internet experience with slow loading and rendering times, pages that won’t display properly — all on top of the security issues already discussed.", - { - "Internet Explorer": TERM_REFERENCE("brand-name-ie"), - }, - ), - ), - FTL.Message( - id=FTL.Identifier("compare-ie-really-the-only-reasons-to-use"), - value=REPLACE( - ie, - "Really the only reasons to use Internet Explorer are for developers to test what their sites look like on an older browser or if a company has business-critical apps that only work with the Internet Explorer browser.", - { - "Internet Explorer": TERM_REFERENCE("brand-name-ie"), - }, - ), - ), - FTL.Message( - id=FTL.Identifier("compare-ie-on-the-other-end-of-the-spectrum-fallback"), - value=REPLACE( - ie, - "On the other end of the spectrum, Firefox is one of the most frequently updated browsers, and comes loaded with lots of useful and interesting features, like Pocket that suggests interesting content every time you open a new tab. Our unified search and web address bar, or Awesome Bar as we call it, also gives you suggestions based on your existing bookmarks and tags, history, open tabs and popular searches. And with a free Firefox account you also get access to all your settings and our other Firefox products on any device simply by signing in. Plus the peace of mind of knowing your browser is proactively working to protect your personal data.", - { - "%%": "%", - "%(pocket)s": VARIABLE_REFERENCE("pocket"), - "%(products)s": VARIABLE_REFERENCE("products"), - "Firefox": TERM_REFERENCE("brand-name-firefox"), - "Pocket": TERM_REFERENCE("brand-name-pocket"), - }, - ), - ), - FTL.Message( - id=FTL.Identifier("compare-ie-as-microsoft-has-made-the-move"), - value=REPLACE( - ie, - "As Microsoft has made the move to sunset the Internet Explorer browser, it no longer supports any version for iOS, and has never been available for Android. Which means unless you’re running a Windows-based laptop or desktop, you won’t have access to your bookmarks, browsing history, saved passwords, and other information that modern browsers sync across devices.", - { - "Microsoft": TERM_REFERENCE("brand-name-microsoft"), - "Internet Explorer": TERM_REFERENCE("brand-name-ie"), - "iOS": TERM_REFERENCE("brand-name-ios"), - "Android": TERM_REFERENCE("brand-name-android"), - }, - ), - ), - FTL.Message( - id=FTL.Identifier("compare-ie-firefox-works-on-any-platform"), - value=REPLACE( - ie, - "Firefox works on any platform, including Windows, macOS, Linux, Android and iOS. Which also means you can sync all your information across platforms. So if you’re browsing on a Windows-based laptop, you can pick up where you left off when you move to browsing on your iPhone or Android device. This convenience should come standard with any modern web browser, and is sorely lacking with Internet Explorer.", - { - "Firefox": TERM_REFERENCE("brand-name-firefox"), - "Internet Explorer": TERM_REFERENCE("brand-name-ie"), - "iOS": TERM_REFERENCE("brand-name-ios"), - "Android": TERM_REFERENCE("brand-name-android"), - "macOS": TERM_REFERENCE("brand-name-mac"), - "Windows": TERM_REFERENCE("brand-name-windows"), - "Linux": TERM_REFERENCE("brand-name-linux"), - "iPhone": TERM_REFERENCE("brand-name-iphone"), - }, - ), - ), - FTL.Message( - id=FTL.Identifier("compare-ie-there-was-a-time-not-so-long"), - value=REPLACE( - ie, - "There was a time not so long ago where Internet Explorer was the most popular and widely used browser in the world. Times have changed and so has technology, but unfortunately Internet Explorer has pretty much stayed the same. Microsoft itself openly implores users to stop using Internet Explorer and instead switch to their newer Chromium-based Edge browser.", - { - "Microsoft": TERM_REFERENCE("brand-name-microsoft"), - "Internet Explorer": TERM_REFERENCE("brand-name-ie"), - "Chromium": TERM_REFERENCE("brand-name-chromium"), - "Edge": TERM_REFERENCE("brand-name-edge"), - }, - ), - ), - FTL.Message( - id=FTL.Identifier("compare-ie-our-opinion-is-just-to-go-with"), - value=REPLACE( - ie, - "Our opinion is just to go with a trusted, private browser with a track record of delivering a great experience across devices. In a head-to-head comparison, it’s really no contest at all. Firefox is hands down the winner across all assessment categories. If you do find yourself at Nana’s house firing up Internet Explorer, maybe you want to do Nana a favor and download Firefox for her.", - { - "%%": "%", - "%(attrs)s": VARIABLE_REFERENCE("attrs"), - "Firefox": TERM_REFERENCE("brand-name-firefox"), - "Internet Explorer": TERM_REFERENCE("brand-name-ie"), - }, - ), - ), - ], - ) diff --git a/lib/fluent_migrations/firefox/browsers/compare/index.py b/lib/fluent_migrations/firefox/browsers/compare/index.py deleted file mode 100644 index 6edf9d7cfe..0000000000 --- a/lib/fluent_migrations/firefox/browsers/compare/index.py +++ /dev/null @@ -1,188 +0,0 @@ -from __future__ import absolute_import - -import fluent.syntax.ast as FTL -from fluent.migrate import COPY, REPLACE -from fluent.migrate.helpers import TERM_REFERENCE, VARIABLE_REFERENCE, transforms_from - -compare = "firefox/compare.lang" - - -def migrate(ctx): - """Migrate bedrock/firefox/templates/firefox/browsers/compare/index.html, part {index}.""" - - ctx.add_transforms( - "firefox/browsers/compare/index.ftl", - "firefox/browsers/compare/index.ftl", - transforms_from( - """ -compare-index-six-of-the-best-browsers-fallback = {COPY(compare, "Six of the best browsers in direct comparison",)} -compare-index-privacy-utility-portability = {COPY(compare, "Privacy. Utility. Portability.",)} -compare-index-a-great-internet-browser-should = {COPY(compare, "A great internet browser should have the functionality you need, portability across devices, and the privacy you deserve.",)} -compare-index-which-browser-is-best-at-keeping = {COPY(compare, "Which browser is best at keeping things confidential?",)} -compare-index-its-not-unreasonable-to-expect = {COPY(compare, "It’s not unreasonable to expect a high level of data protection and privacy from the products we regularly use to get online. At a minimum, a browser should offer some version of “private browsing mode” that automatically deletes your history and search history so other users on the same computer can’t access it. In this area, all six of the browsers compared here score points.",)} -compare-index-what-you-do-online-literally = {COPY(compare, "What you do online literally shouldn’t be anyone else’s business.",)} -compare-index-what-has-your-browser-done = {COPY(compare, "What has your browser done for you lately?",)} -compare-index-how-well-does-your-browser = {COPY(compare, "How well does your browser work across your devices?",)} -compare-index-almost-all-of-the-browsers = {COPY(compare, "Almost all of the browsers compared here allow synchronization between desktop and mobile devices. You’ll need an account to do it, which you can use to log into the browser on all devices and synchronize things like passwords, browsing history, bookmarks and settings.",)} -compare-index-conclusion = {COPY(compare, "Conclusion:",)} -compare-index-and-the-winner-is = {COPY(compare, "And the winner is…",)} -""", - compare=compare, - ), - ) - ctx.add_transforms( - "firefox/browsers/compare/index.ftl", - "firefox/browsers/compare/index.ftl", - [ - FTL.Message( - id=FTL.Identifier("compare-index-using-a-browser-that-blocks"), - value=REPLACE( - "firefox/compare.lang", - "Using a browser that blocks third-party trackers isn’t just important for privacy — it usually means it runs much faster, too. Most trackers are just scripts that run in the background on a number of websites. You can’t see them, but you can feel them slowing down your browser. As of version 67 of Firefox, fingerprinting and cryptominers are also blocked. If you’re not familiar with cryptominers, here’s an example of how they can affect you: maybe you’ve experienced your computer suddenly running hotter or the battery depleting faster than normal. That’s often the byproduct of cryptominers creeping around on your device.", - { - "Firefox": TERM_REFERENCE("brand-name-firefox"), - }, - ), - ), - FTL.Message( - id=FTL.Identifier("compare-index-another-browser-feature-fallback"), - value=REPLACE( - "firefox/compare.lang", - "Another browser feature that should be a given is the ability to prevent websites and companies from tracking your browsing and shopping data — even in normal browsing mode. But that’s actually not the case: in fact, the only browsers that block third party tracking cookies by default are Firefox and Safari.", - { - "Firefox": TERM_REFERENCE("brand-name-firefox"), - "Safari": TERM_REFERENCE("brand-name-safari"), - }, - ), - ), - FTL.Message( - id=FTL.Identifier("compare-index-in-addition-to-privacy-protection-fallback"), - value=REPLACE( - "firefox/compare.lang", - "In addition to privacy protection, which largely takes place in the background of the browser, another key ingredient to a well-made browser is the actual user interface and functionality. Almost all six browsers are equal when it comes to tab browsing, bookmark management, auto-completion, proofreading and extensions. Firefox, Edge and Opera also offer a quick screenshot function that proves to be quite handy and is definitely something you notice is missing when you switch over to a browser without it.", - { - "Firefox": TERM_REFERENCE("brand-name-firefox"), - "Edge": TERM_REFERENCE("brand-name-edge"), - "Opera": TERM_REFERENCE("brand-name-opera"), - }, - ), - ), - FTL.Message( - id=FTL.Identifier("compare-index-find-out-how-firefox-fallback"), - value=REPLACE( - "firefox/compare.lang", - "Find out how Firefox, Chrome, Edge, Safari, Opera and Internet Explorer differ in terms of privacy, utility and portability.", - { - "Firefox": TERM_REFERENCE("brand-name-firefox"), - "Chrome": TERM_REFERENCE("brand-name-chrome"), - "Edge": TERM_REFERENCE("brand-name-edge"), - "Safari": TERM_REFERENCE("brand-name-safari"), - "Opera": TERM_REFERENCE("brand-name-opera"), - "Internet Explorer": TERM_REFERENCE("brand-name-ie"), - }, - ), - ), - FTL.Message( - id=FTL.Identifier("compare-index-looking-for-a-better-fallback"), - value=REPLACE( - "firefox/compare.lang", - "Looking for a better browser? We’ll compare Firefox with Chrome, Edge, Safari, Opera and Internet Explorer to help you make your decision.", - { - "Firefox": TERM_REFERENCE("brand-name-firefox"), - "Chrome": TERM_REFERENCE("brand-name-chrome"), - "Edge": TERM_REFERENCE("brand-name-edge"), - "Safari": TERM_REFERENCE("brand-name-safari"), - "Opera": TERM_REFERENCE("brand-name-opera"), - "Internet Explorer": TERM_REFERENCE("brand-name-ie"), - }, - ), - ), - FTL.Message( - id=FTL.Identifier("compare-index-so-is-your-browser-the-fallback"), - value=REPLACE( - "firefox/compare.lang", - "So is your browser the best one for what you do online? The right browser can make a big difference in how you experience the web. So, without further ado, let’s compare Google Chrome, Firefox, Safari, Opera, Microsoft Internet Explorer and Edge — and see which best suits your needs.", - { - "Firefox": TERM_REFERENCE("brand-name-firefox"), - "Google": TERM_REFERENCE("brand-name-google"), - "Chrome": TERM_REFERENCE("brand-name-chrome"), - "Edge": TERM_REFERENCE("brand-name-edge"), - "Safari": TERM_REFERENCE("brand-name-safari"), - "Opera": TERM_REFERENCE("brand-name-opera"), - "Internet Explorer": TERM_REFERENCE("brand-name-ie"), - "Microsoft": TERM_REFERENCE("brand-name-microsoft"), - }, - ), - ), - FTL.Message( - id=FTL.Identifier("compare-index-since-your-browser-is-your"), - value=REPLACE( - "firefox/compare.lang", - "Since your browser is your gateway to the internet, speed, security, privacy and utility are paramount. In recent years, Google Chrome has been the browser of choice for many. But at a time when online ads seem to follow us everywhere and data breaches are a fixture of news headlines, a lot of people are starting to demand more privacy and respect from their browser.", - { - "Google": TERM_REFERENCE("brand-name-google"), - "Chrome": TERM_REFERENCE("brand-name-chrome"), - }, - ), - ), - FTL.Message( - id=FTL.Identifier("compare-index-the-first-thing-to-point-fallback"), - value=REPLACE( - "firefox/compare.lang", - "The first thing to point out about portability is that not all browsers run on all operating systems. While Firefox, Chrome and Opera work on all major systems and are easy to install, Internet Explorer, Edge and Safari only work on Microsoft and Apple’s own systems. The mobile version of Safari is pre-installed on Apple’s mobile devices, and most Android devices come with a pre-installed browser modified by the manufacturer for the device. Firefox, Chrome, Edge and Opera can easily be installed and even used side by side.", - { - "Firefox": TERM_REFERENCE("brand-name-firefox"), - "Chrome": TERM_REFERENCE("brand-name-chrome"), - "Edge": TERM_REFERENCE("brand-name-edge"), - "Safari": TERM_REFERENCE("brand-name-safari"), - "Opera": TERM_REFERENCE("brand-name-opera"), - "Internet Explorer": TERM_REFERENCE("brand-name-ie"), - "Microsoft": TERM_REFERENCE("brand-name-microsoft"), - "Android": TERM_REFERENCE("brand-name-android"), - }, - ), - ), - FTL.Message( - id=FTL.Identifier("compare-index-browsers-have-come-a-long"), - value=REPLACE( - "firefox/compare.lang", - "Browsers have come a long way since Chrome was introduced and took over the market share. Most of the modern browsers have closed the gap on portability and functionality, and in some areas, like speed and privacy, have actually surpassed Chrome. Still, determining which browser is right for you will always depend on your individual needs and what you value most as you navigate online.", - { - "Firefox": TERM_REFERENCE("brand-name-firefox"), - "Chrome": TERM_REFERENCE("brand-name-chrome"), - }, - ), - ), - FTL.Message( - id=FTL.Identifier("compare-index-firefox-is-backed-by-the-not"), - value=REPLACE( - "firefox/compare.lang", - "Firefox is backed by the not-for-profit Mozilla.", - { - "Firefox": TERM_REFERENCE("brand-name-firefox"), - "Mozilla": TERM_REFERENCE("brand-name-mozilla"), - }, - ), - ), - FTL.Message( - id=FTL.Identifier("compare-index-firefox-puts-your-privacy"), - value=REPLACE( - "firefox/compare.lang", - "Firefox puts your privacy first — in everything we make and do. We believe you have the right to decide how and with whom you share your personal information. Firefox collects as little data as possible and never sells it. The little data we do collect is only used to make products and features better. No secrets. But a lot of transparency and real privacy.", - { - "Firefox": TERM_REFERENCE("brand-name-firefox"), - }, - ), - ), - FTL.Message( - id=FTL.Identifier("compare-index-based-on-the-criteria-we-outlined"), - value=REPLACE( - "firefox/compare.lang", - "Based on the criteria we outlined — privacy, utility, and portability — there’s really only one browser that meets the mark, and that’s Firefox. The real area of difference isn’t in functionality, it’s privacy. Firefox is the most private browser that doesn’t lock you into an ecosystem. Use it on any operating system, on all your devices, and feel secure when you do.", - { - "Firefox": TERM_REFERENCE("brand-name-firefox"), - }, - ), - ), - ], - ) diff --git a/lib/fluent_migrations/firefox/browsers/compare/opera.py b/lib/fluent_migrations/firefox/browsers/compare/opera.py deleted file mode 100644 index e5ed80de7d..0000000000 --- a/lib/fluent_migrations/firefox/browsers/compare/opera.py +++ /dev/null @@ -1,238 +0,0 @@ -from __future__ import absolute_import - -import fluent.syntax.ast as FTL -from fluent.migrate import COPY, REPLACE -from fluent.migrate.helpers import TERM_REFERENCE, VARIABLE_REFERENCE, transforms_from - -opera = "firefox/compare/opera.lang" - - -def migrate(ctx): - """Migrate bedrock/firefox/templates/firefox/browsers/compare/opera.html, part {index}.""" - - ctx.add_transforms( - "firefox/browsers/compare/opera.ftl", - "firefox/browsers/compare/opera.ftl", - [ - FTL.Message( - id=FTL.Identifier("compare-opera-firefox-vs-opera-which-is"), - value=REPLACE( - opera, - "Firefox vs. Opera: Which is the better browser for you?", - { - "Firefox": TERM_REFERENCE("brand-name-firefox"), - "Opera": TERM_REFERENCE("brand-name-opera"), - }, - ), - ), - FTL.Message( - id=FTL.Identifier("compare-opera-compare-opera-to-the-firefox"), - value=REPLACE( - opera, - "Compare Opera to the Firefox Browser to find out which is the best browser for you.", - { - "Firefox Browser": TERM_REFERENCE("brand-name-firefox-browser"), - "Opera": TERM_REFERENCE("brand-name-opera"), - }, - ), - ), - FTL.Message( - id=FTL.Identifier("compare-opera-comparing-firefox-browser"), - value=REPLACE( - opera, - "Comparing Firefox Browser with Opera", - { - "Firefox Browser": TERM_REFERENCE("brand-name-firefox-browser"), - "Opera": TERM_REFERENCE("brand-name-opera"), - }, - ), - ), - FTL.Message( - id=FTL.Identifier("compare-opera-the-firefox-browser-and-opera"), - value=REPLACE( - opera, - "The Firefox Browser and Opera are two of the earliest browsers on the scene still releasing frequent updates. While Opera has not reached the same level of user adoption as Firefox or Google Chrome, it’s maintained a relatively stable and loyal base over a sustained period of time. In this review, we’ll compare the Opera browser with our Firefox browser in terms of security and privacy, utility, and portability to help you choose which browser might be the best fit for you.", - { - "Firefox Browser": TERM_REFERENCE("brand-name-firefox-browser"), - "Opera": TERM_REFERENCE("brand-name-opera"), - "Firefox": TERM_REFERENCE("brand-name-firefox"), - "Google": TERM_REFERENCE("brand-name-google"), - "Chrome": TERM_REFERENCE("brand-name-chrome"), - }, - ), - ), - FTL.Message( - id=FTL.Identifier("compare-opera-operas-privacy-policy-lacks-fallback"), - value=REPLACE( - opera, - "Opera’s privacy policy lacks some specificity in its explanation of which types of information it collects and how, in certain sections, it says they collect names of account holders, IP addresses and search terms. What seems confusing and troubling is the section about International data transfers; when, how often and why they need to transfer your data internationally is not explained.", - { - "Opera": TERM_REFERENCE("brand-name-opera"), - }, - ), - ), - FTL.Message( - id=FTL.Identifier("compare-opera-firefoxs-privacy-policy-is"), - value=REPLACE( - opera, - "Firefox’s privacy policy is very transparent in describing what personal information we collect with the only end goal being to give you greater control over the information you share online.", - { - "%%": "%", - "%(attrs)s": VARIABLE_REFERENCE("attrs"), - "Firefox": TERM_REFERENCE("brand-name-firefox"), - }, - ), - ), - FTL.Message( - id=FTL.Identifier("compare-opera-as-far-as-actual-privacy-protections"), - value=REPLACE( - opera, - "As far as actual privacy protections in the Opera browser, it does offer a robust Private mode that allows you to surf the web without the browser tracking your activity. Also in normal browsing mode, you can also turn off some data collection features by digging into the settings to enable the ad blocker and adjust other security features.", - { - "Opera": TERM_REFERENCE("brand-name-opera"), - }, - ), - ), - FTL.Message( - id=FTL.Identifier("compare-opera-with-the-latest-version-of"), - value=REPLACE( - opera, - "With the latest version of Firefox, Enhanced Tracking Protection is turned on by default in normal browsing mode, so you don’t have to mess around with the settings just to protect yourself from trackers. With Enhanced Tracking Protection, Firefox actively blocks thousands of third-party trackers that try to follow you around the web. You are provided with a personalized protection report that shows how often Firefox blocked third-party cookies, social media trackers, fingerprinting tools and cryptominers as you browse the web.", - { - "%%": "%", - "%(attrs)s": VARIABLE_REFERENCE("attrs"), - "Firefox": TERM_REFERENCE("brand-name-firefox"), - }, - ), - ), - FTL.Message( - id=FTL.Identifier("compare-opera-we-make-firefox-for-people"), - value=REPLACE( - opera, - "We make Firefox for people like you, who care deeply about personal privacy and security. That's why we collect so little info about users and are transparent about how we use that info. It's hard to know how Opera is operating from a privacy perspective. While there are robust privacy features, how they themselves collect and share your data is murky. Firefox remains consistent in what we say and what we do in protecting your privacy.", - { - "%%": "%", - "%(attrs)s": VARIABLE_REFERENCE("attrs"), - "Firefox": TERM_REFERENCE("brand-name-firefox"), - "Opera": TERM_REFERENCE("brand-name-opera"), - }, - ), - ), - FTL.Message( - id=FTL.Identifier("compare-opera-theres-no-debate-that-opera"), - value=REPLACE( - opera, - "There’s no debate that Opera is a feature-packed browser with a clean user interface and strong customization options. Because Opera is built on Chromium, it can take advantage of most of Google Chrome’s vast extension library. Firefox also features a large extension library to browse, but not quite as large as Chrome’s.", - { - "%%": "%", - "%(attrs)s": VARIABLE_REFERENCE("attrs"), - "Firefox": TERM_REFERENCE("brand-name-firefox"), - "Opera": TERM_REFERENCE("brand-name-opera"), - "Chromium": TERM_REFERENCE("brand-name-chromium"), - "Google": TERM_REFERENCE("brand-name-google"), - "Chrome": TERM_REFERENCE("brand-name-chrome"), - }, - ), - ), - FTL.Message( - id=FTL.Identifier("compare-opera-like-firefox-opera-delivers"), - value=REPLACE( - opera, - "Like Firefox, Opera delivers a scrolling tab experience, which means that when you open more tabs than will fit on screen, it scrolls them off screen instead of just continuously shrinking them down. Also both Firefox and Opera have a screenshot tool that lets you capture a snapshot of your screen or part of the page. However, the Opera tool doesn’t give you the ability to create one huge capture of the whole webpage, only the visible portion.", - { - "Firefox": TERM_REFERENCE("brand-name-firefox"), - "Opera": TERM_REFERENCE("brand-name-opera"), - }, - ), - ), - FTL.Message( - id=FTL.Identifier("compare-opera-opera-provides-a-lot-of-hidden"), - value=REPLACE( - opera, - "Opera provides a lot of hidden utility within its simple and manageable interface. For example there’s built-in support for messaging apps, like Facebook Messenger. There’s also a news reader that aggregates articles from your choice of sites and news outlets. The parallel feature to this on Firefox is called Pocket. Pocket is a free service for Firefox account holders that makes it easy to find and save interesting articles and videos from all around the web. In addition, it recommends a variety of articles that expand your knowledge base curated by real, thoughtful humans.", - { - "%%": "%", - "%(attrs)s": VARIABLE_REFERENCE("attrs"), - "Opera": TERM_REFERENCE("brand-name-opera"), - "Pocket": TERM_REFERENCE("brand-name-pocket"), - "Firefox": TERM_REFERENCE("brand-name-firefox"), - "Facebook": TERM_REFERENCE("brand-name-facebook"), - }, - ), - ), - FTL.Message( - id=FTL.Identifier("compare-opera-in-terms-of-head-to-head-utility"), - value=REPLACE( - opera, - "In terms of head to head utility, Opera and Firefox are close competitors. Opera may have an advantage in one aspect with its compatibility with and access to Chrome’s huge extension library. But one significant factor to consider is the fact that Opera, because it’s built on Chromium, is a processor-hungry browser with its RAM consumption comparable to Chrome, which is known for its high CPU usage.", - { - "Opera": TERM_REFERENCE("brand-name-opera"), - "Firefox": TERM_REFERENCE("brand-name-firefox"), - "Chrome": TERM_REFERENCE("brand-name-chrome"), - "Chromium": TERM_REFERENCE("brand-name-chromium"), - }, - ), - ), - FTL.Message( - id=FTL.Identifier("compare-opera-both-firefox-and-opera-are"), - value=REPLACE( - opera, - "Both Firefox and Opera are compatible across every platform including Windows, Mac, Linux, Android and iOS. Firefox account holders can easily sync their bookmarks, passwords, open tabs, and browsing history across all their signed into devices. The same is true for Opera users with an account. However, many sites, especially old sites that haven’t been updated in years, block the latest version of Opera entirely. So if visiting places like your Ex’s old blog is important, take heed, you may not be able to access some of the dustier corners of the internet if you use Opera.", - { - "Opera": TERM_REFERENCE("brand-name-opera"), - "Firefox": TERM_REFERENCE("brand-name-firefox"), - "Windows": TERM_REFERENCE("brand-name-windows"), - "Linux": TERM_REFERENCE("brand-name-linux"), - "Android": TERM_REFERENCE("brand-name-android"), - "iOS": TERM_REFERENCE("brand-name-ios"), - "Mac": TERM_REFERENCE("brand-name-mac"), - }, - ), - ), - FTL.Message( - id=FTL.Identifier("compare-opera-in-addition-to-the-regular"), - value=REPLACE( - opera, - "In addition to the regular mobile app, Opera has two other mobile versions of its browser: Touch and Mini. Touch is light on features but it’s designed to use on the go with only one hand. The Mini version aims at lowering data usage and increased speeds on slow connections by downgrading images and stripping away content.", - { - "Opera": TERM_REFERENCE("brand-name-opera"), - }, - ), - ), - FTL.Message( - id=FTL.Identifier("compare-opera-we-also-offer-an-additional"), - value=REPLACE( - opera, - "We also offer an additional, albeit experimental version of our Firefox mobile app, Firefox Preview, which focuses on speed and security.", - { - "%%": "%", - "%(attrs)s": VARIABLE_REFERENCE("attrs"), - "Firefox": TERM_REFERENCE("brand-name-firefox"), - }, - ), - ), - FTL.Message( - id=FTL.Identifier("compare-opera-most-major-browsers-these"), - value=REPLACE( - opera, - "Most major browsers these days, with the exception of Safari, work seamlessly across platforms and browsers. Opera and Firefox are no exception with both browsers providing excellent portability across every device.", - { - "Opera": TERM_REFERENCE("brand-name-opera"), - "Firefox": TERM_REFERENCE("brand-name-firefox"), - "Safari": TERM_REFERENCE("brand-name-safari"), - }, - ), - ), - FTL.Message( - id=FTL.Identifier("compare-opera-overall-opera-is-a-solid-browser"), - value=REPLACE( - opera, - "Overall, Opera is a solid browser, with a clean interface and a lot of useful features available. There are, however, some serious privacy concerns as well as an issue with it using a lot of processing power. Although Opera has some really terrific ease of use features, we still believe Firefox remains a superior browser based on performance and with a transparent user-privacy stance and strict privacy protections.", - { - "Opera": TERM_REFERENCE("brand-name-opera"), - "Firefox": TERM_REFERENCE("brand-name-firefox"), - }, - ), - ), - ], - ), diff --git a/lib/fluent_migrations/firefox/browsers/compare/safari.py b/lib/fluent_migrations/firefox/browsers/compare/safari.py deleted file mode 100644 index 8f2a37b8ad..0000000000 --- a/lib/fluent_migrations/firefox/browsers/compare/safari.py +++ /dev/null @@ -1,294 +0,0 @@ -from __future__ import absolute_import - -import fluent.syntax.ast as FTL -from fluent.migrate import COPY, REPLACE -from fluent.migrate.helpers import TERM_REFERENCE, VARIABLE_REFERENCE, transforms_from - -safari = "firefox/compare/safari.lang" - - -def migrate(ctx): - """Migrate bedrock/firefox/templates/firefox/browsers/compare/safari.html, part {index}.""" - - ctx.add_transforms( - "firefox/browsers/compare/safari.ftl", - "firefox/browsers/compare/safari.ftl", - [ - FTL.Message( - id=FTL.Identifier("compare-safari-firefox-vs-safari-which-is"), - value=REPLACE( - safari, - "Firefox vs. Safari: Which is the better browser for you?", - { - "Firefox": TERM_REFERENCE("brand-name-firefox"), - "Safari": TERM_REFERENCE("brand-name-safari"), - }, - ), - ), - FTL.Message( - id=FTL.Identifier("compare-safari-safari-is-the-pre-installed"), - value=REPLACE( - safari, - "Safari is the pre-installed browser on Mac and iPhone. Compare Safari to the Firefox Browser to find out which is the better browser for you.", - { - "Firefox Browser": TERM_REFERENCE("brand-name-firefox-browser"), - "Safari": TERM_REFERENCE("brand-name-safari"), - "iPhone": TERM_REFERENCE("brand-name-iphone"), - "Mac": TERM_REFERENCE("brand-name-mac"), - }, - ), - ), - FTL.Message( - id=FTL.Identifier("compare-safari-comparing-firefox-browser"), - value=REPLACE( - safari, - "Comparing Firefox Browser with Apple Safari", - { - "Firefox Browser": TERM_REFERENCE("brand-name-firefox-browser"), - }, - ), - ), - FTL.Message( - id=FTL.Identifier("compare-safari-if-you-use-a-mac-or-have"), - value=REPLACE( - safari, - "If you use a Mac or have an iPhone, chances are you’re familiar with the Safari web browser. The fact that it’s pre-installed as the default browser for Apple product users definitely gives it an early advantage, but Firefox has its own set of useful features that make it an attractive alternative. Here we’ll explore the main differences between our browser and Safari in terms of privacy, utility, and portability between devices.", - { - "iPhone": TERM_REFERENCE("brand-name-iphone"), - "Apple": TERM_REFERENCE("brand-name-apple"), - "Safari": TERM_REFERENCE("brand-name-safari"), - "Firefox": TERM_REFERENCE("brand-name-firefox"), - }, - ), - ), - FTL.Message( - id=FTL.Identifier("compare-safari-privacy-has-become-a-white"), - value=REPLACE( - safari, - "Privacy has become a white hot topic for tech companies as they realize more and more people are feeling vulnerable to things like data breaches, ad trackers and hackers. But when it comes down to the real tools people use to navigate the actual interwebs, is it all talk or are they actually taking action to keep your data secure?", - { - "Apple": TERM_REFERENCE("brand-name-apple"), - "Safari": TERM_REFERENCE("brand-name-safari"), - }, - ), - ), - FTL.Message( - id=FTL.Identifier("compare-safari-as-alluded-to-before-apple-fallback"), - value=REPLACE( - safari, - "As alluded to before, Apple is one of those companies that recently decided to step up their privacy game. Not long ago, Apple implemented cross-site tracking prevention in Safari, which prevents ads from following you around the internet. Safari also offers a strong password suggestion when you sign up for a new account on any website. And if you’re invested in the iCloud ecosystem, it syncs that password securely with your other devices, so you never actually have to remember it.", - { - "Apple": TERM_REFERENCE("brand-name-apple"), - "Safari": TERM_REFERENCE("brand-name-safari"), - }, - ), - ), - FTL.Message( - id=FTL.Identifier("compare-safari-like-safari-we-at-firefox"), - value=REPLACE( - safari, - "Like Safari, we at Firefox have made a point of focusing on privacy and security. But unlike Safari, we’ve been standing on the privacy soap box for a long time. In fact, Mozilla (our parent company) was one of the first voices in the tech community to sound the alarm for online privacy.", - { - "Firefox": TERM_REFERENCE("brand-name-firefox"), - "Safari": TERM_REFERENCE("brand-name-safari"), - "Mozilla": TERM_REFERENCE("brand-name-mozilla"), - }, - ), - ), - FTL.Message( - id=FTL.Identifier("compare-safari-our-private-browsing-mode"), - value=REPLACE( - safari, - "Our Private Browsing mode blocks trackers and erases your passwords, cookies and history every time you close it. But you can also experience our advanced privacy features even in regular browsing mode. With the latest edition of Firefox, enhanced tracking prevention is turned on by default. This prevents things like cross-site trackers from following you as you jump around the web. Also, with Facebook being caught out almost daily for privacy problems, our Facebook Container extension makes a lot of sense. It makes it harder for Facebook to track you around the web — similar to what Safari does to prevent cross-site tracking — but Firefox actually isolates your Facebook session into a separate container blocking Facebook from tracking what you do on other websites. Why do they need to know what you look up on WebMD anyway?", - { - "%%": "%", - "%(attrs)s": VARIABLE_REFERENCE("attrs"), - "Firefox": TERM_REFERENCE("brand-name-firefox"), - "Safari": TERM_REFERENCE("brand-name-safari"), - "Facebook": TERM_REFERENCE("brand-name-facebook"), - "Facebook Container": TERM_REFERENCE("brand-name-facebook-container"), - }, - ), - ), - FTL.Message( - id=FTL.Identifier("compare-safari-as-far-as-security-goes-firefox"), - value=REPLACE( - safari, - "As far as security goes, Firefox is solid there as well. Any time you’re in Firefox, you can right-click in the password field to securely generate a strong password using the Fill Password option. When you save your new password, we will prompt you to save to its built-in password manager, Lockwise. We also serve up users and account holders with another free and useful product called Monitor that automatically alerts you if your data is included in a known data breach.", - { - "%%": "%", - "%(lockwise)s": VARIABLE_REFERENCE("lockwise"), - "%(monitor)s": VARIABLE_REFERENCE("monitor"), - "Firefox": TERM_REFERENCE("brand-name-firefox"), - "Lockwise": TERM_REFERENCE("brand-name-lockwise"), - "Monitor": TERM_REFERENCE("brand-name-monitor"), - }, - ), - ), - FTL.Message( - id=FTL.Identifier("compare-safari-if-you-choose-to-use-safari"), - value=REPLACE( - safari, - "If you choose to use Safari, you’re in safe hands as long as you’re using an Apple device. But Safari only works on Apple devices, whereas Firefox works on Windows, Mac, iOS, Android and Linux. So no matter what operating system you choose, Firefox has you covered with our security and privacy protections.", - { - "Apple": TERM_REFERENCE("brand-name-apple"), - "Safari": TERM_REFERENCE("brand-name-safari"), - "Firefox": TERM_REFERENCE("brand-name-firefox"), - "Windows": TERM_REFERENCE("brand-name-windows"), - "Android": TERM_REFERENCE("brand-name-android"), - "iOS": TERM_REFERENCE("brand-name-ios"), - "Linux": TERM_REFERENCE("brand-name-linux"), - "Mac": TERM_REFERENCE("brand-name-mac"), - }, - ), - ), - FTL.Message( - id=FTL.Identifier("compare-safari-apple-is-widely-known-for"), - value=REPLACE( - safari, - "Apple is widely known for its closed ecosystem as it relates to creating software for its products. But inside the App Store, it does offer a section to developers to create plugins and add-ons to make the browser more robust. These extensions are also browsable through the App Store and easily added to Safari.", - { - "Apple": TERM_REFERENCE("brand-name-apple"), - "Safari": TERM_REFERENCE("brand-name-safari"), - "App Store": TERM_REFERENCE("brand-name-app-store"), - }, - ), - ), - FTL.Message( - id=FTL.Identifier("compare-safari-in-addition-to-the-regular"), - value=REPLACE( - safari, - "In addition to the regular set of features you’d expect in a browser, such as tabbed browsing and private browsing, Safari has some unexpected features as well. For instance, if a user were to right-click a word anywhere on a page inside Safari, then click Look Up, they’d get a dictionary definition plus entries from the thesaurus, App Store, movies and more. Safari’s Parental Controls are easy to customize, allowing the adults to breathe a little easier when the kids begin to get curious about the internet.", - { - "Safari": TERM_REFERENCE("brand-name-safari"), - "App Store": TERM_REFERENCE("brand-name-app-store"), - }, - ), - ), - FTL.Message( - id=FTL.Identifier("compare-safari-like-safari-firefox-encourages"), - value=REPLACE( - safari, - "Like Safari, Firefox encourages its enthusiastic developer community to create add-ons and extensions to the browser. And since our platform is open-source, there’s a vast selection adding a wealth of functionality.", - { - "%%": "%", - "%(attrs)s": VARIABLE_REFERENCE("attrs"), - "Firefox": TERM_REFERENCE("brand-name-firefox"), - "Safari": TERM_REFERENCE("brand-name-safari"), - }, - ), - ), - FTL.Message( - id=FTL.Identifier("compare-safari-also-when-you-sign-up-for-fallback"), - value=REPLACE( - safari, - "Also, when you sign up for a Firefox account you get access to some unique services like Screenshots, Pocket and Send that integrate directly into the browser. Screenshots is a feature built right into the Firefox browser, allowing you to copy or download any or all part of a web page. When you save the screenshot, you can also choose which folder you want to find it in, instead of cluttering your desktop. The Pocket for Firefox button lets you save web pages and videos to Pocket in just one click, so you can read a clean, distraction-free version whenever and wherever you want — even offline. With Send, you can share large files with end-to-end encryption and a variety of security controls, such as the ability to set an expiration time for a file link to expire, the number of downloads, and whether to add an optional password for an extra layer of security.", - { - "%%": "%", - "%(pocket)s": VARIABLE_REFERENCE("pocket"), - "%(send)s": VARIABLE_REFERENCE("send"), - "Firefox": TERM_REFERENCE("brand-name-firefox"), - "Pocket": TERM_REFERENCE("brand-name-pocket"), - "Send": TERM_REFERENCE("brand-name-send"), - }, - ), - ), - FTL.Message( - id=FTL.Identifier("compare-safari-firefox-and-safari-both-provide"), - value=REPLACE( - safari, - "Firefox and Safari both provide a seamless experience when moving from desktop to mobile browsing or vice versa. For Safari, one of its main strengths is its continuity features. It syncs your bookmarks, tabs, history and more to iCloud so they’re available on all your devices. That means you can open a tab on your iPhone and have it also appear on your Mac laptop with just a click.", - { - "Firefox": TERM_REFERENCE("brand-name-firefox"), - "Safari": TERM_REFERENCE("brand-name-safari"), - "iPhone": TERM_REFERENCE("brand-name-iphone"), - }, - ), - ), - FTL.Message( - id=FTL.Identifier("compare-safari-both-browsers-have-a-lot"), - value=REPLACE( - safari, - "Both browsers have a lot of crossover features, as well as some unique functions. It’s worth mentioning, if you take a lot of screenshots, you’ll wonder how you ever lived without this handy feature that’s built right into Firefox. But if you’re just looking for a fast, private browser for surfing and shopping, then you may want to give Firefox a try — especially if you’ve been exclusively using Safari because it came preloaded as the default browser on your computer. Eventually, you’ll discover which one is more suited to your needs.", - { - "Firefox": TERM_REFERENCE("brand-name-firefox"), - }, - ), - ), - FTL.Message( - id=FTL.Identifier("compare-safari-firefox-also-offers-a-similar"), - value=REPLACE( - safari, - "Firefox also offers a similar sync feature when you sign up for a free Firefox Account that enables users to easily synchronize their bookmarks, browsing history, preferences, passwords, filled forms, add-ons, and the last 25 opened tabs across multiple computers. What sets Firefox apart from Safari is that it is available on any desktop or mobile platform, iOS, Android, Windows or macOS, boosting its portability across any device you may own.", - { - "%%": "%", - "%(attrs)s": VARIABLE_REFERENCE("attrs"), - "Firefox": TERM_REFERENCE("brand-name-firefox"), - "Firefox Account": TERM_REFERENCE("brand-name-firefox-account"), - "Safari": TERM_REFERENCE("brand-name-safari"), - "Firefox": TERM_REFERENCE("brand-name-firefox"), - "Android": TERM_REFERENCE("brand-name-android"), - "iOS": TERM_REFERENCE("brand-name-ios"), - "Windows": TERM_REFERENCE("brand-name-windows"), - "macOS": TERM_REFERENCE("brand-name-macos"), - }, - ), - ), - FTL.Message( - id=FTL.Identifier("compare-safari-the-firefox-app-for-ios-and"), - value=REPLACE( - safari, - "The Firefox app for iOS and Android is one of the fastest browsers available and also has solid security and anti-tracking features — a huge plus if you’re constantly bouncing between a laptop and mobile devices.", - { - "%%": "%", - "%(ios)s": VARIABLE_REFERENCE("ios"), - "%(android)s": VARIABLE_REFERENCE("android"), - "Firefox": TERM_REFERENCE("brand-name-firefox"), - "iOS": TERM_REFERENCE("brand-name-ios"), - "Android": TERM_REFERENCE("brand-name-android"), - }, - ), - ), - FTL.Message( - id=FTL.Identifier("compare-safari-since-safari-is-apples-proprietary"), - value=REPLACE( - safari, - "Since Safari is Apple’s proprietary web browser, its iCloud syncing works exclusively with Apple products. This can be somewhat limiting if, for example, you’re both an Android user and an iPhone user or if you have a Windows based PC for work but use an iPhone as your personal device.", - { - "Safari": TERM_REFERENCE("brand-name-safari"), - "Firefox": TERM_REFERENCE("brand-name-firefox"), - "Apple": TERM_REFERENCE("brand-name-apple"), - "Android": TERM_REFERENCE("brand-name-android"), - "iPhone": TERM_REFERENCE("brand-name-iphone"), - "Windows": TERM_REFERENCE("brand-name-windows"), - }, - ), - ), - FTL.Message( - id=FTL.Identifier("compare-safari-safari-does-a-great-job-of"), - value=REPLACE( - safari, - "Safari does a great job of making the browsing experience simple, fast, and seamless if you’re an Apple user with multiple Apple products. Like Safari, Firefox is a fast and utilitarian browser, but privacy and cross-platform compatibility are our defining features. Firefox updates each month with new features and functionality. For example, one recent update switched on our Enhanced Tracking Protection (ETP) by default for new users, which effectively blocks cookies and cross-site trackers.", - { - "%%": "%", - "%(attrs)s": VARIABLE_REFERENCE("attrs"), - "Safari": TERM_REFERENCE("brand-name-safari"), - "Firefox": TERM_REFERENCE("brand-name-firefox"), - "Apple": TERM_REFERENCE("brand-name-apple"), - }, - ), - ), - FTL.Message( - id=FTL.Identifier("compare-safari-in-the-end-it-just-boils"), - value=REPLACE( - safari, - "In the end, it just boils down to what you value in your browser. If you’re integrated with the Apple ecosystem, Safari is still a great choice. But if you value having the latest and greatest privacy protections and being able to work across multiple operating systems, we think Firefox is your best bet. Firefox is also a solid option as a secondary browser for those Apple-exclusive users who may want to switch into a different browser for those online moments that call for extra layers of privacy protection.", - { - "Safari": TERM_REFERENCE("brand-name-safari"), - "Firefox": TERM_REFERENCE("brand-name-firefox"), - "Apple": TERM_REFERENCE("brand-name-apple"), - }, - ), - ), - ], - ) diff --git a/lib/fluent_migrations/firefox/browsers/compare/shared.py b/lib/fluent_migrations/firefox/browsers/compare/shared.py deleted file mode 100644 index 7ed45d6634..0000000000 --- a/lib/fluent_migrations/firefox/browsers/compare/shared.py +++ /dev/null @@ -1,58 +0,0 @@ -from __future__ import absolute_import - -import fluent.syntax.ast as FTL -from fluent.migrate import COPY, REPLACE -from fluent.migrate.helpers import TERM_REFERENCE, VARIABLE_REFERENCE, transforms_from - -shared = "firefox/compare/shared.lang" - - -def migrate(ctx): - """Migrate bedrock/firefox/templates/firefox/browsers/compare/index.html, part {index}.""" - - ctx.add_transforms( - "firefox/browsers/compare/shared.ftl", - "firefox/browsers/compare/shared.ftl", - transforms_from( - """ -compare-shared-yes = {COPY(shared, "Yes",)} -compare-shared-no = {COPY(shared, "No",)} -compare-shared-private-browsing-mode = {COPY(shared, "Private Browsing mode",)} -compare-shared-blocks-third-party-tracking = {COPY(shared, "Blocks third-party tracking cookies",)} -compare-shared-blocks-cryptomining-scripts = {COPY(shared, "Blocks cryptomining scripts",)} -compare-shared-blocks-social-trackers = {COPY(shared, "Blocks social trackers",)} -compare-shared-autoplay-blocking = {COPY(shared, "Autoplay blocking",)} -compare-shared-tab-browsing = {COPY(shared, "Tab browsing",)} -compare-shared-bookmark-manager = {COPY(shared, "Bookmark manager",)} -compare-shared-automatically-fills-out-forms = {COPY(shared, "Automatically fills out forms",)} -compare-shared-search-engine-options = {COPY(shared, "Search engine options",)} -compare-shared-text-to-speech = {COPY(shared, "Text to speech",)} -compare-shared-reader-mode = {COPY(shared, "Reader mode",)} -compare-shared-spell-checking = {COPY(shared, "Spell checking",)} -compare-shared-web-extensionsadd-ons = {COPY(shared, "Web extensions/Add-ons",)} -compare-shared-in-browser-screenshot-tool = {COPY(shared, "In-browser screenshot tool",)} -compare-shared-os-availability = {COPY(shared, "OS availability",)} -compare-shared-mobile-os-availability = {COPY(shared, "Mobile OS availability",)} -compare-shared-syncs-with-mobile = {COPY(shared, "Syncs with mobile",)} -compare-shared-password-management = {COPY(shared, "Password management",)} -compare-shared-master-password = {COPY(shared, "Master Password",)} -compare-shared-security-and-privacy = {COPY(shared, "Security and Privacy",)} -compare-shared-utility = {COPY(shared, "Utility",)} -compare-shared-portability = {COPY(shared, "Portability",)} -compare-shared-security-and-privacy-strong = {COPY(shared, "Security and Privacy",)} -compare-shared-utility-strong = {COPY(shared, "Utility",)} -compare-shared-portability-strong = {COPY(shared, "Portability",)} -compare-shared-overall-assessment = {COPY(shared, "Overall Assessment",)} -compare-shared-the-comparisons-made-here = {COPY(shared, "The comparisons made here were done so across browser release versions as follows:",)} -compare-shared-brand-name-firefox = { -brand-name-firefox } -compare-shared-brand-name-chrome = { -brand-name-chrome } -compare-shared-brand-name-edge = { -brand-name-edge } -compare-shared-brand-name-ie = { -brand-name-ie } -compare-shared-brand-name-opera = { -brand-name-opera } -compare-shared-brand-name-safari = { -brand-name-safari } -compare-shared-brand-name-brave = { -brand-name-brave } -compare-shared-compare-browsers = {COPY(shared, "Compare Browsers",)} -""", - shared=shared, - ), - ) diff --git a/lib/fluent_migrations/firefox/browsers/index.py b/lib/fluent_migrations/firefox/browsers/index.py deleted file mode 100644 index 1143a8aabc..0000000000 --- a/lib/fluent_migrations/firefox/browsers/index.py +++ /dev/null @@ -1,162 +0,0 @@ -from __future__ import absolute_import - -import fluent.syntax.ast as FTL -from fluent.migrate import COPY, REPLACE -from fluent.migrate.helpers import TERM_REFERENCE, VARIABLE_REFERENCE, transforms_from - -browsers = "firefox/browsers.lang" - - -def migrate(ctx): - """Migrate bedrock/firefox/templates/firefox/browsers/index.html, part {index}.""" - - ctx.add_transforms( - "firefox/browsers.ftl", - "firefox/browsers.ftl", - transforms_from( - """ -firefox-browsers-get-the-browsers-that-put = {COPY(browsers, "Get the browsers that put your privacy first — and always have",)} -""", - browsers=browsers, - ) - + [ - FTL.Message( - id=FTL.Identifier("firefox-browsers-get-the-privacy-you-deserve"), - value=REPLACE( - browsers, - "Get the privacy you deserve. Enhanced Tracking Protection is automatic in every Firefox browser.", - { - "Firefox": TERM_REFERENCE("brand-name-firefox"), - }, - ), - ), - ] - + transforms_from( - """ -firefox-browsers-get-the-browsers-strong = {COPY(browsers, "Get the browsers that put your privacy first — and always have",)} -firefox-browsers-desktop = {COPY(browsers, "Desktop",)} -""", - browsers=browsers, - ) - + [ - FTL.Message( - id=FTL.Identifier("firefox-browsers-seriously-private-browsing"), - value=REPLACE( - browsers, - "Seriously private browsing. Firefox automatically blocks 2000+ online trackers from collecting information about what you do online.", - { - "Firefox": TERM_REFERENCE("brand-name-firefox"), - }, - ), - ), - ] - + transforms_from( - """ -firefox-browsers-download-for-desktop = {COPY(browsers, "Download for Desktop",)} -firefox-browsers-mobile = {COPY(browsers, "Mobile",)} -firefox-browsers-take-the-same-level-of-privacy = {COPY(browsers, "Take the same level of privacy — plus your passwords, search history, open tabs and more — with you wherever you go.",)} -firefox-browsers-download-for-mobile = {COPY(browsers, "Download for Mobile",)} -firefox-browsers-send-me-a-link = {COPY(browsers, "Send me a link",)} -""", - browsers=browsers, - ) - + [ - FTL.Message( - id=FTL.Identifier("firefox-browsers-enterprise"), - value=REPLACE( - browsers, - "Enterprise", - { - "Enterprise": TERM_REFERENCE("brand-name-enterprise"), - }, - ), - ), - ] - + transforms_from( - """ -firefox-browsers-get-unmatched-data-protection = {COPY(browsers, "Get unmatched data protection with support cycles tailored to suit your company’s needs.",)} -""", - browsers=browsers, - ) - + [ - FTL.Message( - id=FTL.Identifier("firefox-browsers-enterprise-packages"), - value=REPLACE( - browsers, - "Enterprise packages", - { - "Enterprise": TERM_REFERENCE("brand-name-enterprise"), - }, - ), - ), - FTL.Message( - id=FTL.Identifier("firefox-browsers-reality"), - value=REPLACE( - browsers, - "Reality", - { - "Reality": TERM_REFERENCE("brand-name-reality"), - }, - ), - ), - ] - + transforms_from( - """ -firefox-browsers-go-beyond-two-dimensions-and = {COPY(browsers, "Go beyond two dimensions and enjoy the best immersive content from around the web.",)} -""", - browsers=browsers, - ) - + [ - FTL.Message( - id=FTL.Identifier("firefox-browsers-build-sites-and-refine-your"), - value=REPLACE( - browsers, - "Build sites and refine your code with Firefox DevTools", - { - "Firefox": TERM_REFERENCE("brand-name-firefox"), - "DevTools": TERM_REFERENCE("brand-name-devtools"), - }, - ), - ), - FTL.Message( - id=FTL.Identifier("firefox-browsers-learn-more-about-devtools"), - value=REPLACE( - browsers, - "Learn more about DevTools", - { - "DevTools": TERM_REFERENCE("brand-name-devtools"), - }, - ), - ), - FTL.Message( - id=FTL.Identifier("firefox-browsers-join-firefox-and-get-the-most"), - value=REPLACE( - browsers, - "Join Firefox and get the most out of every product — across every device.", - { - "Firefox": TERM_REFERENCE("brand-name-firefox"), - }, - ), - ), - FTL.Message( - id=FTL.Identifier("firefox-browsers-already-have-an-account-sign"), - value=REPLACE( - browsers, - "Already have an account? Sign In or learn more about joining Firefox.", - { - "%%": "%", - "%(fxa_attr)s": VARIABLE_REFERENCE("fxa_attr"), - "%(accounts_attr)s": VARIABLE_REFERENCE("accounts_attr"), - }, - ), - ), - ] - + transforms_from( - """ -firefox-browsers-android = { -brand-name-android } -firefox-browsers-ios = { -brand-name-ios } -firefox-browsers-developer-edition = { -brand-name-developer-edition } -""", - browsers=browsers, - ), - ) diff --git a/lib/fluent_migrations/firefox/browsers/what-is-a-browser.py b/lib/fluent_migrations/firefox/browsers/what-is-a-browser.py deleted file mode 100644 index 9e1fe2f265..0000000000 --- a/lib/fluent_migrations/firefox/browsers/what-is-a-browser.py +++ /dev/null @@ -1,160 +0,0 @@ -from __future__ import absolute_import - -import fluent.syntax.ast as FTL -from fluent.migrate import COPY, REPLACE -from fluent.migrate.helpers import TERM_REFERENCE, VARIABLE_REFERENCE, transforms_from - -what_is_a_browser = "firefox/browsers/what-is-a-browser.lang" -what_is_a_browser = "mozorg/what-is-a-browser.lang" - - -def migrate(ctx): - """Migrate bedrock/firefox/templates/firefox/browsers/what-is-a-browser.html, part {index}.""" - - ctx.add_transforms( - "firefox/browsers/history/what-is-a-browser.ftl", - "firefox/browsers/history/what-is-a-browser.ftl", - transforms_from( - """ -what-is-a-browser-what-is-a-web = {COPY(what_is_a_browser, "What is a web browser?",)} -what-is-a-browser-a-web-browser = {COPY(what_is_a_browser, "A web browser takes you anywhere on the internet, letting you see text, images and video from anywhere in the world.",)} -what-is-a-browser-the-web-is-a-vast = {COPY(what_is_a_browser, "The web is a vast and powerful tool. Over the course of a few decades the internet has changed the way we work, the way we play and the way we interact with one another. Depending on how it’s used, it bridges nations, drives commerce, nurtures relationships, drives the innovation engine of the future and is responsible for more memes than we know what to do with.",)} -""", - what_is_a_browser=what_is_a_browser, - ) - + [ - FTL.Message( - id=FTL.Identifier("what-is-a-browser-its-important"), - value=REPLACE( - what_is_a_browser, - 'It’s important that everyone has access to the web, but it’s also vital that we all understand the tools we use to access it. We use web browsers like Mozilla Firefox, Google Chrome, Microsoft Edge and Apple Safari every day, but do we understand what they are and how they work?', - { - "%%": "%", - "%(tools)s": VARIABLE_REFERENCE("tools"), - "Microsoft": TERM_REFERENCE("brand-name-microsoft"), - "Mozilla": TERM_REFERENCE("brand-name-mozilla"), - "Firefox": TERM_REFERENCE("brand-name-firefox"), - "Google": TERM_REFERENCE("brand-name-google"), - "Chrome": TERM_REFERENCE("brand-name-chrome"), - "Safari": TERM_REFERENCE("brand-name-safari"), - "Apple": TERM_REFERENCE("brand-name-apple"), - "Edge": TERM_REFERENCE("brand-name-edge"), - }, - ), - ), - ] - + transforms_from( - """ -what-is-a-browser-in-a-short-period-long = {COPY(what_is_a_browser, "In a short period of time we’ve gone from being amazed by the ability to send an email to someone around the world, to a change in how we think of information. It’s not a question of how much you know anymore, but simply a question of what browser or app can get you to that information fastest.",)} -what-is-a-browser-in-a-short-period = {COPY(what_is_a_browser, "In a short period of time we’ve gone from being amazed by the ability to send an email to someone around the world, to a change in how we think about information.",)} -what-is-a-browser-how-does-a-web = {COPY(what_is_a_browser, "How does a web browser work?",)} -what-is-a-browser-a-web-browser-long = {COPY(what_is_a_browser, "A web browser takes you anywhere on the internet. It retrieves information from other parts of the web and displays it on your desktop or mobile device. The information is transferred using the Hypertext Transfer Protocol, which defines how text, images and video are transmitted on the web. This information needs to be shared and displayed in a consistent format so that people using any browser, anywhere in the world can see the information.",)} -""", - what_is_a_browser=what_is_a_browser, - ) - + [ - FTL.Message( - id=FTL.Identifier("what-is-a-browser-sadly-not-all"), - value=REPLACE( - what_is_a_browser, - 'Sadly, not all browser makers choose to interpret the format in the same way. For users, this means that a website can look and function differently. Creating consistency between browsers, so that any user can enjoy the internet, regardless of the browser they choose, is called web standards.', - { - "%%": "%", - "%(standards)s": VARIABLE_REFERENCE("standards"), - }, - ), - ), - FTL.Message( - id=FTL.Identifier("what-is-a-browser-when-the-web-browser"), - value=REPLACE( - what_is_a_browser, - 'When the web browser fetches data from an internet connected server and it then uses a piece of software called a rendering engine to translate that data into text and images. This data is written in Hypertext Markup Language (HTML) and web browsers read this code to create what we see, hear and experience on the internet.', - { - "%%": "%", - "%(html)s": VARIABLE_REFERENCE("html"), - }, - ), - ), - FTL.Message( - id=FTL.Identifier("what-is-a-browser-hyperlinks-allow"), - value=REPLACE( - what_is_a_browser, - 'Hyperlinks allow users to follow a path to other pages or sites on the web. Every webpage, image and video has its own unique Uniform Resource Locator (URL), which is also known as a web address. When a browser visits a server for data, the web address tells the browser where to look for each item that is described in the html, which then tells the browser where it goes on the web page.', - { - "%%": "%", - "%(hyperlink)s": VARIABLE_REFERENCE("hyperlink"), - "%(url)s": VARIABLE_REFERENCE("url"), - }, - ), - ), - ] - + transforms_from( - """ -what-is-a-browser-cookies-not-the = {COPY(what_is_a_browser, "Cookies (not the yummy kind)",)} -""", - what_is_a_browser=what_is_a_browser, - ) - + [ - FTL.Message( - id=FTL.Identifier("what-is-a-browser-websites-save"), - value=REPLACE( - what_is_a_browser, - 'Websites save information about you in files called cookies. They are saved on your computer for the next time you visit that site. Upon your return, the website code will read that file to see that it’s you. For example, when you go to a website and the page remembers your username and password – that’s made possible by a cookie.', - { - "%%": "%", - "%(cookies)s": VARIABLE_REFERENCE("cookies"), - }, - ), - ), - ] - + transforms_from( - """ -what-is-a-browser-there-are-also = {COPY(what_is_a_browser, "There are also cookies that remember more detailed information about you. Perhaps your interests, your web browsing patterns, etc. This means that a site can provide you more targeted content – often in the form of ads. There are types of cookies, called third-party cookies, that come from sites you’re not even visiting at the time and can track you from site to site to gather information about you, which is sometimes sold to other companies. Sometimes you can block these kinds of cookies, though not all browsers allow you to.",)} -what-is-a-browser-when-you-go-to = {COPY(what_is_a_browser, "When you go to a website and the page remembers your username and password – that’s made possible by a cookie.",)} -what-is-a-browser-understanding = {COPY(what_is_a_browser, "Understanding privacy",)} -""", - what_is_a_browser=what_is_a_browser, - ) - + [ - FTL.Message( - id=FTL.Identifier("what-is-a-browser-nearly-all-major"), - value=REPLACE( - what_is_a_browser, - "Nearly all major browsers have a private browsing setting. These exist to hide the browsing history from other users on the same computer. Many people think that private browsing or incognito mode will hide both their identity and browsing history from internet service providers, governments and advertisers. They don’t. These settings just clear the history on your system, which is helpful if you’re dealing with sensitive personal information on a shared or public computer. Firefox goes beyond that.", - { - "Firefox": TERM_REFERENCE("brand-name-firefox"), - }, - ), - ), - FTL.Message( - id=FTL.Identifier("what-is-a-browser-firefox-helps"), - value=REPLACE( - what_is_a_browser, - "Firefox helps you be more private online by letting you block trackers from following you around the web.", - { - "Firefox": TERM_REFERENCE("brand-name-firefox"), - }, - ), - ), - ] - + transforms_from( - """ -what-is-a-browser-making-your-web = {COPY(what_is_a_browser, "Making your web browser work for you",)} -what-is-a-browser-most-major-web = {COPY(what_is_a_browser, "Most major web browsers let users modify their experience through extensions or add-ons. Extensions are bits of software that you can add to your browser to customize it or add functionality. Extensions can do all kinds of fun and practical things like enabling new features, foreign language dictionaries, or visual appearances and themes.",)} -""", - what_is_a_browser=what_is_a_browser, - ) - + [ - FTL.Message( - id=FTL.Identifier("what-is-a-browser-all-browser-makers"), - value=REPLACE( - what_is_a_browser, - "All browser makers develop their products to display images and video as quickly and smoothly as possible making it easy for you to make the most of the web. They all work hard to make sure users have a browser that is fast, powerful and easy to use. Where they differ is why. It’s important to choose the right browser for you. Mozilla builds Firefox to ensure that users have control over their online lives and to ensure that the internet is a global, public resource, accessible to all.", - { - "Mozilla": TERM_REFERENCE("brand-name-mozilla"), - "Firefox": TERM_REFERENCE("brand-name-firefox"), - }, - ), - ), - ], - ) diff --git a/lib/fluent_migrations/firefox/browsers/windows-64-bit.py b/lib/fluent_migrations/firefox/browsers/windows-64-bit.py deleted file mode 100644 index f1da8a4d70..0000000000 --- a/lib/fluent_migrations/firefox/browsers/windows-64-bit.py +++ /dev/null @@ -1,156 +0,0 @@ -from __future__ import absolute_import - -import fluent.syntax.ast as FTL -from fluent.migrate import COPY, REPLACE -from fluent.migrate.helpers import TERM_REFERENCE, VARIABLE_REFERENCE, transforms_from - -windows_64_bit = "firefox/windows-64-bit.lang" - - -def migrate(ctx): - """Migrate bedrock/firefox/templates/firefox/browsers/windows-64-bit.html, part {index}.""" - - ctx.add_transforms( - "firefox/windows-64-bit.ftl", - "firefox/windows-64-bit.ftl", - [ - FTL.Message( - id=FTL.Identifier("windows-64-bit-firefox-for-windows"), - value=REPLACE( - windows_64_bit, - "Firefox for Windows 64-bit", - { - "Firefox": TERM_REFERENCE("brand-name-firefox"), - "Windows": TERM_REFERENCE("brand-name-windows"), - }, - ), - ), - FTL.Message( - id=FTL.Identifier("windows-64-bit-users-on-64-bit-windows"), - value=REPLACE( - windows_64_bit, - "Users on 64-bit Windows who download Firefox can get our 64-bit version by default. That means you get a more secure version of Firefox.", - { - "Firefox": TERM_REFERENCE("brand-name-firefox"), - "Windows": TERM_REFERENCE("brand-name-windows"), - }, - ), - ), - ] - + transforms_from( - """ -windows-64-bit-64-bit = {COPY(windows_64_bit, "64-bit",)} -""", - windows_64_bit=windows_64_bit, - ) - + [ - FTL.Message( - id=FTL.Identifier("windows-64-bit-a-more-secure-firefox"), - value=REPLACE( - windows_64_bit, - "A more secure Firefox.", - { - "Firefox": TERM_REFERENCE("brand-name-firefox"), - }, - ), - ), - FTL.Message( - id=FTL.Identifier("windows-64-bit-users-on-64-bit-windows-crashes"), - value=REPLACE( - windows_64_bit, - 'Users on 64-bit Windows who download Firefox can get our 64-bit version by default. That means you get a more secure version of Firefox, one that also crashes a whole lot less. How much less? In our tests so far, 64-bit Firefox reduced crashes by 39%% on machines with 4GB of RAM or more.', - { - "%%": FTL.TextElement("%"), - "%(crashes)s": VARIABLE_REFERENCE("crashes"), - "Firefox": TERM_REFERENCE("brand-name-firefox"), - "Windows": TERM_REFERENCE("brand-name-windows"), - }, - ), - ), - ] - + transforms_from( - """ -windows-64-bit-whats-the-difference = {COPY(windows_64_bit, "What’s the difference between 32-bit and 64-bit?",)} -""", - windows_64_bit=windows_64_bit, - ) - + [ - FTL.Message( - id=FTL.Identifier("windows-64-bit-heres-the-key-thing"), - value=REPLACE( - windows_64_bit, - "Here’s the key thing to know: 64-bit applications can access more memory and are less likely to crash than 32-bit applications. Also, with the jump from 32 to 64 bits, a security feature called Address Space Layout Randomization (ASLR) works better to protect you from attackers. Linux and macOS users, fret not, you already enjoy a Firefox that’s optimized for 64-bit.", - { - "%%": "%", - "%(ASLR)s": VARIABLE_REFERENCE("ASLR"), - "Firefox": TERM_REFERENCE("brand-name-firefox"), - "Linux": TERM_REFERENCE("brand-name-linux"), - "macOS": TERM_REFERENCE("brand-name-mac"), - }, - ), - ), - FTL.Message( - id=FTL.Identifier("windows-64-bit-how-do-you-get-64"), - value=REPLACE( - windows_64_bit, - "How do you get 64-bit Firefox?", - { - "Firefox": TERM_REFERENCE("brand-name-firefox"), - }, - ), - ), - FTL.Message( - id=FTL.Identifier("windows-64-bit-if-youre-running"), - value=REPLACE( - windows_64_bit, - 'If you’re running 64-bit Windows (here’s how to check), your Firefox may already be 64-bit. Check your Firefox version (in the “About Firefox” window) and look for “(32-bit)” or “(64-bit)” after the version number:', - { - "%%": "%", - "%(version)s": VARIABLE_REFERENCE("version"), - "%(check)s": VARIABLE_REFERENCE("check"), - "Firefox": TERM_REFERENCE("brand-name-firefox"), - "Windows": TERM_REFERENCE("brand-name-windows"), - }, - ), - ), - FTL.Message( - id=FTL.Identifier("windows-64-bit-if-you-see-32-bit-older"), - value=REPLACE( - windows_64_bit, - "If you see “(32-bit)” and you are running Firefox 56.0 or older, updating to the latest Firefox version should automatically upgrade you to 64-bit.", - { - "Firefox": TERM_REFERENCE("brand-name-firefox"), - }, - ), - ), - FTL.Message( - id=FTL.Identifier("windows-64-bit-if-you-see-32-bit-newer"), - value=REPLACE( - windows_64_bit, - "If you see “(32-bit)” and are running Firefox 56.0.1 or newer, then your computer may not meet the minimum memory requirement for 64-bit (3 GB RAM or more). You can still manually install 64-bit Firefox, if you choose.", - { - "Firefox": TERM_REFERENCE("brand-name-firefox"), - }, - ), - ), - FTL.Message( - id=FTL.Identifier("windows-64-bit-if-you-need-to-run"), - value=REPLACE( - windows_64_bit, - 'If you need to run 32-bit Firefox or manually install 64-bit Firefox, you can simply download and re-run the Windows (32-bit or 64-bit) Firefox installer from the Firefox platforms and languages download page.', - { - "%%": "%", - "%(all)s": VARIABLE_REFERENCE("all"), - "Firefox": TERM_REFERENCE("brand-name-firefox"), - "Windows": TERM_REFERENCE("brand-name-windows"), - }, - ), - ), - ] - + transforms_from( - """ -windows-64-bit-take-control-of-your = {COPY(windows_64_bit, "Take control of your browser.",)} -""", - windows_64_bit=windows_64_bit, - ), - ) diff --git a/lib/fluent_migrations/firefox/channel.py b/lib/fluent_migrations/firefox/channel.py deleted file mode 100644 index 5581d0c342..0000000000 --- a/lib/fluent_migrations/firefox/channel.py +++ /dev/null @@ -1,415 +0,0 @@ -from __future__ import absolute_import - -import fluent.syntax.ast as FTL -from fluent.migrate import COPY, REPLACE -from fluent.migrate.helpers import TERM_REFERENCE, VARIABLE_REFERENCE, transforms_from - -index = "firefox/channel/index.lang" -main = "main.lang" - - -def migrate(ctx): - """Migrate bedrock/firefox/templates/firefox/channel/base.html, part {index}.""" - - ctx.add_transforms( - "firefox/channel.ftl", - "firefox/channel.ftl", - transforms_from( - """ -firefox-channel-desktop = {COPY(index, "Desktop",)} -""", - index=index, - ) - + [ - FTL.Message( - id=FTL.Identifier("firefox-channel-android"), - value=REPLACE( - index, - "Android", - { - "Android": TERM_REFERENCE("brand-name-android"), - }, - ), - ), - FTL.Message( - id=FTL.Identifier("firefox-channel-ios"), - value=REPLACE( - index, - "iOS", - { - "iOS": TERM_REFERENCE("brand-name-ios"), - }, - ), - ), - ] - + transforms_from( - """ -firefox-channel-take-a-browse-on-the-wild-side = {COPY(index, "Take a browse on the wild side.",)} -""", - index=index, - ) - + [ - FTL.Message( - id=FTL.Identifier("firefox-channel-be-among-the-first-to-explore"), - value=REPLACE( - index, - "Be among the first to explore future releases of Firefox for desktop, Android and iOS.", - { - "Firefox": TERM_REFERENCE("brand-name-firefox"), - "Android": TERM_REFERENCE("brand-name-android"), - "iOS": TERM_REFERENCE("brand-name-ios"), - }, - ), - ), - ] - + transforms_from( - """ -firefox-channel-see-something-that-isnt-working = {COPY(index, "See something that isn’t working? Let us know.",)} -firefox-channel-file-a-bug-now = {COPY(index, "File a bug now",)} -firefox-channel-tips-for-filing-a-bug = {COPY(index, "Tips for filing a bug",)} -""", - index=index, - ), - ) - - ctx.add_transforms( - "firefox/channel.ftl", - "firefox/channel.ftl", - [ - FTL.Message( - id=FTL.Identifier("firefox-channel-try-new-features-in-a-pre"), - value=REPLACE( - index, - "Try New Features in a Pre-Release Android Browser | Firefox", - { - "Firefox": TERM_REFERENCE("brand-name-firefox"), - "Android": TERM_REFERENCE("brand-name-android"), - }, - ), - ), - FTL.Message( - id=FTL.Identifier("firefox-channel-download-and-test-future"), - value=REPLACE( - index, - "Download and test future releases of Firefox for desktop, Android and iOS.", - { - "Firefox": TERM_REFERENCE("brand-name-firefox"), - "Android": TERM_REFERENCE("brand-name-android"), - "iOS": TERM_REFERENCE("brand-name-ios"), - }, - ), - ), - FTL.Message( - id=FTL.Identifier("firefox-channel-experience-cutting-edge-android-updated"), - value=REPLACE( - index, - "Experience cutting-edge features in a pre-release browser for Android: Firefox Beta and Firefox Nightly. Install now!", - { - "Firefox Nightly": TERM_REFERENCE("brand-name-firefox-nightly"), - "Firefox Beta": TERM_REFERENCE("brand-name-firefox-beta"), - "Android": TERM_REFERENCE("brand-name-android"), - }, - ), - ), - FTL.Message( - id=FTL.Identifier("firefox-channel-experience-cutting-edge-android"), - value=REPLACE( - index, - "Experience cutting-edge features in a pre-release browser for Android: Firefox Beta, Firefox Aurora and Firefox Nightly. Install now!", - { - "Firefox Nightly": TERM_REFERENCE("brand-name-firefox-nightly"), - "Firefox Aurora": TERM_REFERENCE("brand-name-firefox-aurora"), - "Firefox Beta": TERM_REFERENCE("brand-name-firefox-beta"), - "Android": TERM_REFERENCE("brand-name-android"), - }, - ), - ), - FTL.Message( - id=FTL.Identifier("firefox-channel-download-and-test-the-latest-android"), - value=REPLACE( - index, - "Download and test the latest Firefox for Android features with Aurora, Beta and Nightly builds.", - { - "Firefox": TERM_REFERENCE("brand-name-firefox"), - "Nightly": TERM_REFERENCE("brand-name-nightly"), - "Android": TERM_REFERENCE("brand-name-android"), - "Beta": TERM_REFERENCE("brand-name-beta"), - "Aurora": TERM_REFERENCE("brand-name-aurora"), - }, - ), - ), - FTL.Message( - id=FTL.Identifier("firefox-channel-try-the-latest-android-features"), - value=REPLACE( - index, - "Try the latest Android features, before they get released to the rest of the world.", - { - "Android": TERM_REFERENCE("brand-name-android"), - }, - ), - ), - ] - + transforms_from( - """ -firefox-channel-all-languages-and-platforms = {COPY(index, "All Languages and Platforms",)} -firefox-channel-all-languages-and-builds = {COPY(index, "All Languages and Builds",)} -""", - index=index, - ) - + [ - FTL.Message( - id=FTL.Identifier("firefox-channel-beta-is-an-unstable-testing"), - value=REPLACE( - index, - 'Beta is an unstable testing and development platform. By default, Beta sends data to Mozilla — and sometimes our partners — to help us handle problems and try ideas. Learn what is shared.', - { - "%%": "%", - "%(link)s": VARIABLE_REFERENCE("link"), - "Mozilla": TERM_REFERENCE("brand-name-mozilla"), - "Beta": TERM_REFERENCE("brand-name-beta"), - }, - ), - ), - FTL.Message( - id=FTL.Identifier("firefox-channel-firefox-beta-automatically"), - value=REPLACE( - index, - "Firefox Beta automatically sends feedback to Mozilla.", - { - "Firefox Beta": TERM_REFERENCE("brand-name-firefox-beta"), - "Mozilla": TERM_REFERENCE("brand-name-mozilla"), - }, - ), - ), - FTL.Message( - id=FTL.Identifier("firefox-channel-give-us-feedback-to-help"), - value=REPLACE( - index, - 'Give us feedback to help us put the final tweaks on performance and functionality in a stable environment.', - { - "%%": "%", - "%(feedback)s": VARIABLE_REFERENCE("feedback"), - }, - ), - ), - FTL.Message( - id=FTL.Identifier("firefox-channel-check-out-new-android-features"), - value=REPLACE( - index, - "Check out new Android features in their earliest stages. Enjoy at your own risk.", - { - "Android": TERM_REFERENCE("brand-name-android"), - }, - ), - ), - FTL.Message( - id=FTL.Identifier("firefox-channel-nightly-blog"), - value=REPLACE( - index, - "Nightly Blog", - { - "Nightly": TERM_REFERENCE("brand-name-nightly"), - }, - ), - ), - FTL.Message( - id=FTL.Identifier("firefox-channel-nightly-is-an-unstable-testing"), - value=REPLACE( - index, - 'Nightly is an unstable testing and development platform. By default, Nightly sends data to Mozilla — and sometimes our partners — to help us handle problems and try ideas. Learn what is shared.', - { - "%%": "%", - "%(link)s": VARIABLE_REFERENCE("link"), - "Mozilla": TERM_REFERENCE("brand-name-mozilla"), - "Nightly": TERM_REFERENCE("brand-name-nightly"), - }, - ), - ), - FTL.Message( - id=FTL.Identifier("firefox-channel-firefox-nightly-automatically"), - value=REPLACE( - index, - "Firefox Nightly automatically sends feedback to Mozilla.", - { - "Firefox Nightly": TERM_REFERENCE("brand-name-firefox-nightly"), - "Mozilla": TERM_REFERENCE("brand-name-mozilla"), - }, - ), - ), - ], - ) - - ctx.add_transforms( - "firefox/channel.ftl", - "firefox/channel.ftl", - [ - FTL.Message( - id=FTL.Identifier("firefox-channel-try-new-browser-features"), - value=REPLACE( - index, - "Try New Browser Features in Pre-Release Versions | Firefox", - { - "Firefox": TERM_REFERENCE("brand-name-firefox"), - }, - ), - ), - FTL.Message( - id=FTL.Identifier("firefox-channel-experience-cutting-edge-desktop"), - value=REPLACE( - index, - "Experience cutting-edge browser features in pre-release versions: Firefox Developer Edition, Firefox Beta and Firefox Nightly. Download now!", - { - "Firefox Developer Edition": TERM_REFERENCE("brand-name-firefox-developer-edition"), - "Firefox Nightly": TERM_REFERENCE("brand-name-firefox-nightly"), - "Firefox Beta": TERM_REFERENCE("brand-name-firefox-beta"), - }, - ), - ), - FTL.Message( - id=FTL.Identifier("firefox-channel-download-and-test-the-latest-desktop"), - value=REPLACE( - index, - "Download and test the latest Firefox for desktop features with Developer Edition, Beta and Nightly builds.", - { - "Developer Edition": TERM_REFERENCE("brand-name-developer-edition"), - "Firefox": TERM_REFERENCE("brand-name-firefox"), - "Nightly": TERM_REFERENCE("brand-name-nightly"), - "Beta": TERM_REFERENCE("brand-name-beta"), - }, - ), - ), - ] - + transforms_from( - """ -firefox-channel-beta = { -brand-name-beta } -firefox-channel-test-about-to-be-released = {COPY(index, "Test about-to-be-released features in the most stable pre-release build.",)} -firefox-channel-release-notes = {COPY(main, "Release Notes")} -firefox-channel-developer-edition = { -brand-name-developer-edition } -firefox-channel-build-test-scale-and-more = {COPY(index, "Build, test, scale and more with the only browser built just for developers.",)} -""", - index=index, - main=main, - ) - + [ - FTL.Message( - id=FTL.Identifier("firefox-channel-developer-edition-is-an"), - value=REPLACE( - index, - 'Developer Edition is an unstable testing and development platform. By default, Developer Edition sends data to Mozilla — and sometimes our partners — to help us handle problems and try ideas. Learn what is shared.', - { - "%%": "%", - "%(link)s": VARIABLE_REFERENCE("link"), - "Developer Edition": TERM_REFERENCE("brand-name-developer-edition"), - "Mozilla": TERM_REFERENCE("brand-name-mozilla"), - }, - ), - ), - FTL.Message( - id=FTL.Identifier("firefox-channel-firefox-developer-edition"), - value=REPLACE( - index, - "Firefox Developer Edition automatically sends feedback to Mozilla.", - { - "Firefox Developer Edition": TERM_REFERENCE("brand-name-firefox-developer-edition"), - "Mozilla": TERM_REFERENCE("brand-name-mozilla"), - }, - ), - ), - ] - + transforms_from( - """ -firefox-channel-nightly = { -brand-name-nightly } -""", - index=index, - ) - + [ - FTL.Message( - id=FTL.Identifier("firefox-channel-get-a-sneak-peek-at-our"), - value=REPLACE( - index, - "Get a sneak peek at our next generation web browser, and help us make it the best browser it can be: try Firefox Nightly.", - { - "Firefox Nightly": TERM_REFERENCE("brand-name-firefox-nightly"), - }, - ), - ), - ] - + transforms_from( - """ -firefox-channel-test-brand-new-features = {COPY(index, "Test brand new features daily (or… nightly). Enjoy at your own risk.",)} -""", - index=index, - ), - ) - - ctx.add_transforms( - "firefox/channel.ftl", - "firefox/channel.ftl", - [ - FTL.Message( - id=FTL.Identifier("firefox-channel-try-new-features-in-a-pre-release"), - value=REPLACE( - index, - "Try New Features in a Pre-Release iOS Browser | Firefox", - { - "Firefox": TERM_REFERENCE("brand-name-firefox"), - "iOS": TERM_REFERENCE("brand-name-ios"), - }, - ), - ), - FTL.Message( - id=FTL.Identifier("firefox-channel-experience-cutting-edge-features-ios"), - value=REPLACE( - index, - "Experience cutting-edge features in a pre-release browser for iOS via Apple’s TestFlight program. Install now!", - { - "Apple": TERM_REFERENCE("brand-name-apple"), - "iOS": TERM_REFERENCE("brand-name-ios"), - "TestFlight": TERM_REFERENCE("brand-name-test-flight"), - }, - ), - ), - FTL.Message( - id=FTL.Identifier("firefox-channel-test-beta-versions-of-firefox-ios-long"), - value=REPLACE( - index, - "Test beta versions of Firefox for iOS via Apple’s TestFlight program and help make our mobile browser for iPhone, iPad and iPod touch even better.", - { - "Firefox": TERM_REFERENCE("brand-name-firefox"), - "iPhone": TERM_REFERENCE("brand-name-iphone"), - "Apple": TERM_REFERENCE("brand-name-apple"), - "iPad": TERM_REFERENCE("brand-name-ipad"), - "iOS": TERM_REFERENCE("brand-name-ios"), - "TestFlight": TERM_REFERENCE("brand-name-test-flight"), - }, - ), - ), - ] - + transforms_from( - """ -firefox-channel-test-flight = { -brand-name-test-flight } -""", - index=index, - ) - + [ - FTL.Message( - id=FTL.Identifier("firefox-channel-test-beta-versions-of-firefox-ios"), - value=REPLACE( - index, - "Test beta versions of Firefox for iOS via Apple’s TestFlight program.", - { - "Firefox": TERM_REFERENCE("brand-name-firefox"), - "Apple": TERM_REFERENCE("brand-name-apple"), - "iOS": TERM_REFERENCE("brand-name-ios"), - "TestFlight": TERM_REFERENCE("brand-name-test-flight"), - }, - ), - ), - ] - + transforms_from( - """ -firefox-channel-sign-up-now = {COPY(index, "Sign up now",)} -""", - index=index, - ), - ) diff --git a/lib/fluent_migrations/firefox/developer/__init__.py b/lib/fluent_migrations/firefox/developer/__init__.py deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/lib/fluent_migrations/firefox/developer/index.py b/lib/fluent_migrations/firefox/developer/index.py deleted file mode 100644 index e3f998b964..0000000000 --- a/lib/fluent_migrations/firefox/developer/index.py +++ /dev/null @@ -1,342 +0,0 @@ -from __future__ import absolute_import - -import fluent.syntax.ast as FTL -from fluent.migrate import COPY, REPLACE -from fluent.migrate.helpers import TERM_REFERENCE, VARIABLE_REFERENCE, transforms_from - -index = "firefox/developer/index.lang" -developer_quantum = "firefox/products/developer-quantum.lang" -shared = "firefox/shared.lang" - - -def migrate(ctx): - """Migrate bedrock/firefox/templates/firefox/developer/index.html, part {index}.""" - - ctx.add_transforms( - "firefox/developer.ftl", - "firefox/developer.ftl", - transforms_from( - """ -firefox-developer-page-title = { -brand-name-firefox-developer-edition } -""", - developer_quantum=developer_quantum, - ) - + [ - FTL.Message( - id=FTL.Identifier("firefox-developer-firefox-developer-edition-desc"), - value=REPLACE( - developer_quantum, - "Firefox Developer Edition is the blazing fast browser that offers cutting edge developer tools and latest features like CSS Grid support and framework debugging", - { - "Firefox Developer Edition": TERM_REFERENCE("brand-name-firefox-developer-edition"), - }, - ), - ), - ] - + transforms_from( - """ -firefox-developer-firefox-browser = { -brand-name-firefox-browser } { -brand-name-developer-edition } -firefox-developer-welcome-to-your-new-favorite = {COPY(developer_quantum, "Welcome to your new favorite browser. Get the latest features, fast performance, and the development tools you need to build for the open web.",)} -firefox-developer-speak-up = {COPY(developer_quantum, "Speak up",)} -firefox-developer-feedback-makes-us = {COPY(developer_quantum, "Feedback makes us better. Tell us how we can improve the browser and Developer tools.",)} -firefox-developer-join-the-convo = {COPY(developer_quantum, "Join the conversation",)} -firefox-developer-get-involved = {COPY(developer_quantum, "Get involved",)} -firefox-developer-help-build-the-last = {COPY(developer_quantum, "Help build the last independent browser. Write code, fix bugs, make add-ons, and more.",)} -firefox-developer-start-now = {COPY(developer_quantum, "Start now",)} -firefox-developer-design-code-test = {COPY(developer_quantum, "Design. Code. Test. Refine.",)} -""", - developer_quantum=developer_quantum, - ) - + [ - FTL.Message( - id=FTL.Identifier("firefox-developer-build-and-perfect"), - value=REPLACE( - developer_quantum, - "Build and Perfect your sites
with Firefox DevTools", - { - "Firefox DevTools": TERM_REFERENCE("brand-name-firefox-devtools"), - }, - ), - ), - ] - + transforms_from( - """ -firefox-developer-inspector = {COPY(developer_quantum, "Inspector",)} -firefox-developer-inspect-and-refine = {COPY(developer_quantum, "Inspect and refine code to build pixel-perfect layouts.",)} -firefox-developer-learn-about-page-inspector = {COPY(developer_quantum, "Learn more about Page Inspector",)} -firefox-developer-console = {COPY(developer_quantum, "Console",)} -firefox-developer-track-css = {COPY(developer_quantum, "Track CSS, JavaScript, security and network issues.",)} -firefox-developer-learn-about-web-console = {COPY(developer_quantum, "Learn more about Web Console",)} -firefox-developer-debugger = {COPY(developer_quantum, "Debugger",)} -firefox-developer-powerful-javascript = {COPY(developer_quantum, "Powerful JavaScript debugger with support for your framework.",)} -firefox-developer-learn-more-about-debugger = {COPY(developer_quantum, "Learn more about JavaScript Debugger",)} -firefox-developer-network = {COPY(developer_quantum, "Network",)} -firefox-developer-monitor-network-requests = {COPY(developer_quantum, "Monitor network requests that can slow or block your site.",)} -firefox-developer-learn-more-about-newtork-monitor = {COPY(developer_quantum, "Learn more about Network Monitor",)} -firefox-developer-storage-panel = {COPY(developer_quantum, "Storage panel",)} -firefox-developer-add-modify-remove = {COPY(developer_quantum, "Add, modify and remove cache, cookies, databases and session data.",)} -firefox-developer-learn-more-about-storage = {COPY(developer_quantum, "Learn more about Storage Panel",)} -firefox-developer-responsive-design-mode = {COPY(developer_quantum, "Responsive Design Mode",)} -firefox-developer-test-sites-emulated = {COPY(developer_quantum, "Test sites on emulated devices in your browser.",)} -firefox-developer-learn-more-about-responsive = {COPY(developer_quantum, "Learn more about Responsive Design View",)} -firefox-developer-visual-editing = {COPY(developer_quantum, "Visual Editing",)} -firefox-developer-fine-tuning-animations = {COPY(developer_quantum, "Fine-tune animations, alignment and padding.",)} -firefox-developer-learn-more-about-visual-editing = {COPY(developer_quantum, "Learn more about Visual Editing",)} -firefox-developer-performance = {COPY(developer_quantum, "Performance",)} -firefox-developer-unblock-bottlenecks = {COPY(developer_quantum, "Unblock bottlenecks, streamline processes, optimize assets.",)} -firefox-developer-learn-more-about-performance = {COPY(developer_quantum, "Learn more about Performance Tools",)} -firefox-developer-memory = {COPY(developer_quantum, "Memory",)} -firefox-developer-find-memory-leaks = {COPY(developer_quantum, "Find memory leaks and make your application zippy.",)} -firefox-developer-learn-more-about-memory = {COPY(developer_quantum, "Learn more about Memory Tools",)} -firefox-developer-style-editor = {COPY(developer_quantum, "Style Editor",)} -firefox-developer-edit-and-manage = {COPY(developer_quantum, "Edit and manage all your CSS stylesheets in your browser.",)} -firefox-developer-learn-more-about-style = {COPY(developer_quantum, "Learn more about Style Editor",)} -firefox-developer-made-for-developers = {COPY(developer_quantum, "The browser made for developers",)} -firefox-developer-all-the-latest = {COPY(developer_quantum, "All the latest developer tools in beta, plus experimental features like the Multi-line Console Editor and WebSocket Inspector.",)} -""", - developer_quantum=developer_quantum, - ) - + [ - FTL.Message( - id=FTL.Identifier("firefox-developer-welcome-to-firefox-browser"), - value=REPLACE( - developer_quantum, - "Welcome to Firefox Browser Developer Edition", - { - "Firefox Browser": TERM_REFERENCE("brand-name-firefox-browser"), - "Developer Edition": TERM_REFERENCE("brand-name-developer-edition"), - }, - ), - ), - FTL.Message( - id=FTL.Identifier("firefox-developer-congrats-you-now-have"), - value=REPLACE( - developer_quantum, - "Congrats. You now have Firefox Browser Developer Edition.", - { - "Firefox Browser": TERM_REFERENCE("brand-name-firefox-browser"), - "Developer Edition": TERM_REFERENCE("brand-name-developer-edition"), - }, - ), - ), - FTL.Message( - id=FTL.Identifier("firefox-developer-a-separate-profile"), - value=REPLACE( - developer_quantum, - "A separate profile and path so you can easily run it alongside Release or Beta Firefox.", - { - "Firefox": TERM_REFERENCE("brand-name-firefox"), - }, - ), - ), - ] - + transforms_from( - """ -firefox-developer-preferences-tailored = {COPY(developer_quantum, "Preferences tailored for web developers: Browser and remote debugging are enabled by default, as are the dark theme and developer toolbar button.",)} -firefox-developer-new-tools = {COPY(developer_quantum, "New Tools",)} -firefox-developer-inactive-css = {COPY(developer_quantum, "Inactive CSS",)} -""", - developer_quantum=developer_quantum, - ) - + [ - FTL.Message( - id=FTL.Identifier("firefox-developer-firefox-devtools-now-grays-out"), - value=REPLACE( - developer_quantum, - "Firefox DevTools now grays out CSS declarations that don’t have an effect on the page. When you hover over the info icon, you’ll see a useful message about why the CSS is not being applied, including a hint about how to fix the problem.", - { - "Firefox DevTools": TERM_REFERENCE("brand-name-firefox-devtools"), - }, - ), - ), - FTL.Message( - id=FTL.Identifier("firefox-developer-firefox-devtools"), - value=REPLACE( - developer_quantum, - "Firefox DevTools", - { - "Firefox DevTools": TERM_REFERENCE("brand-name-firefox-devtools"), - }, - ), - ), - FTL.Message( - id=FTL.Identifier("firefox-developer-the-new-firefox-devtools"), - value=REPLACE( - developer_quantum, - "The new Firefox DevTools are powerful, flexible, and best of all, hackable. This includes a best-in-class JavaScript debugger, which can target multiple browsers and is built in React and Redux.", - { - "Firefox DevTools": TERM_REFERENCE("brand-name-firefox-devtools"), - }, - ), - ), - ] - + transforms_from( - """ -firefox-developer-master-css-grid = {COPY(developer_quantum, "Master CSS Grid",)} -firefox-developer-next-gen-css-engine = {COPY(developer_quantum, "Next-Gen CSS Engine",)} -firefox-developer-a-next-generation = {COPY(developer_quantum, "A Next-Generation CSS Engine",)} -firefox-developer-master-innovative-features = {COPY(developer_quantum, "Innovative Features",)} -firefox-developer-want-to-be-on-the-cutting-edge = {COPY(developer_quantum, "Want to be on the cutting-edge?",)} -""", - developer_quantum=developer_quantum, - ) - + [ - FTL.Message( - id=FTL.Identifier("firefox-developer-firefox-nightly-receives"), - value=REPLACE( - developer_quantum, - "Firefox Nightly receives daily updates and allows you to access features months before they go mainstream.", - { - "Firefox Nightly": TERM_REFERENCE("brand-name-firefox-nightly"), - }, - ), - ), - FTL.Message( - id=FTL.Identifier("firefox-developer-firefox-quantum-includes"), - value=REPLACE( - developer_quantum, - "Firefox Quantum includes a new CSS engine, written in Rust, that has state-of-the-art innovations and is blazingly fast.", - { - "Firefox Quantum": TERM_REFERENCE("brand-name-firefox-quantum"), - }, - ), - ), - FTL.Message( - id=FTL.Identifier("firefox-developer-firefox-is-the-only-browser"), - value=REPLACE( - developer_quantum, - "Firefox is the only browser with tools built specifically for building and designing with CSS Grid. These tools allow you to visualize the grid, display associated area names, preview transformations on the grid and much more.", - { - "Firefox": TERM_REFERENCE("brand-name-firefox"), - }, - ), - ), - ] - + transforms_from( - """ -firefox-developer-convenient-features = {COPY(developer_quantum, "Convenient Features",)} -firefox-developer-faster-performance = {COPY(developer_quantum, "Faster Performance",)} -firefox-developer-shapes-editor = {COPY(developer_quantum, "Shapes Editor",)} -""", - developer_quantum=developer_quantum, - ) - + [ - FTL.Message( - id=FTL.Identifier("firefox-developer-firefox-devtools-has-a-brand-new-v2"), - value=REPLACE( - developer_quantum, - "Firefox DevTools has a brand new shape path editor that takes the guesswork out of fine-tuning your shape-outside and clip-path shapes by allowing you to very easily fine-tune your adjustments with a visual editor.", - { - "Firefox DevTools": TERM_REFERENCE("brand-name-firefox-devtools"), - }, - ), - ), - FTL.Message( - id=FTL.Identifier("firefox-developer-firefox-devtools-has-a-brand-new"), - value=REPLACE( - developer_quantum, - "Firefox DevTools has a brand new shape path editor that takes the guesswork out of fine-tuning your shadow-outside and clip-path shapes by allowing you to very easily fine-tune your adjustments with a visual editor.", - { - "Firefox DevTools": TERM_REFERENCE("brand-name-firefox-devtools"), - }, - ), - ), - ] - + transforms_from( - """ -firefox-developer-faster-innovation = {COPY(developer_quantum, "Faster Information",)} -firefox-developer-fonts-panel = {COPY(developer_quantum, "Fonts Panel",)} -""", - developer_quantum=developer_quantum, - ) - + [ - FTL.Message( - id=FTL.Identifier("firefox-developer-the-new-fonts-panel"), - value=REPLACE( - developer_quantum, - "The new fonts panel in Firefox DevTools gives developers quick access to all of the information they need about the fonts being used in an element. It also includes valuable information such as the font source, weight, style and more.", - { - "Firefox DevTools": TERM_REFERENCE("brand-name-firefox-devtools"), - }, - ), - ), - FTL.Message( - id=FTL.Identifier("firefox-developer-firefox-developer-edition-sends"), - value=REPLACE( - developer_quantum, - "Firefox Developer Edition automatically sends feedback to Mozilla.", - { - "Firefox Developer Edition": TERM_REFERENCE("brand-name-firefox-developer-edition"), - "Mozilla": TERM_REFERENCE("brand-name-mozilla"), - }, - ), - ), - FTL.Message( - id=FTL.Identifier("firefox-developer-download-the-firefox-browser"), - value=REPLACE( - developer_quantum, - "Download the Firefox browser made for developers", - { - "Firefox": TERM_REFERENCE("brand-name-firefox"), - }, - ), - ), - ], - ) - - ctx.add_transforms( - "firefox/developer.ftl", - "firefox/developer.ftl", - [ - FTL.Message( - id=FTL.Identifier("firefox-developer-welcome-to-the-all-new"), - value=REPLACE( - developer_quantum, - "Welcome to the all-new Firefox Quantum: Developer Edition", - { - "Developer Edition": TERM_REFERENCE("brand-name-developer-edition"), - "Firefox Quantum": TERM_REFERENCE("brand-name-firefox-quantum"), - }, - ), - ), - FTL.Message( - id=FTL.Identifier("firefox-developer-firefox-has-been-rebuilt"), - value=REPLACE( - developer_quantum, - "Firefox has been rebuilt from the ground-up to be faster, sleeker, and more powerful than ever.", - { - "Firefox": TERM_REFERENCE("brand-name-firefox"), - }, - ), - ), - ], - ) - - ctx.add_transforms( - "firefox/developer.ftl", - "firefox/developer.ftl", - [ - FTL.Message( - id=FTL.Identifier("firefox-developer-congrats-you-now-have-firefox"), - value=REPLACE( - developer_quantum, - "Congrats. You now have Firefox Quantum: Developer Edition.", - { - "Developer Edition": TERM_REFERENCE("brand-name-developer-edition"), - "Firefox Quantum": TERM_REFERENCE("brand-name-firefox-quantum"), - }, - ), - ), - FTL.Message( - id=FTL.Identifier("firefox-developer-this-isnt-just-an-update"), - value=REPLACE( - developer_quantum, - "This isn’t just an update. This is Firefox Quantum: A brand new Firefox that has been rebuilt from the ground-up to be faster, sleeker, and more powerful than ever.", - { - "Firefox Quantum": TERM_REFERENCE("brand-name-firefox-quantum"), - "Firefox": TERM_REFERENCE("brand-name-firefox"), - }, - ), - ), - ], - ) diff --git a/lib/fluent_migrations/firefox/enterprise/__init__.py b/lib/fluent_migrations/firefox/enterprise/__init__.py deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/lib/fluent_migrations/firefox/enterprise/index.py b/lib/fluent_migrations/firefox/enterprise/index.py deleted file mode 100644 index 14e199c2ef..0000000000 --- a/lib/fluent_migrations/firefox/enterprise/index.py +++ /dev/null @@ -1,257 +0,0 @@ -from __future__ import absolute_import - -import fluent.syntax.ast as FTL -from fluent.migrate import COPY, REPLACE -from fluent.migrate.helpers import TERM_REFERENCE, VARIABLE_REFERENCE, transforms_from - -index = "firefox/enterprise/index.lang" - - -def migrate(ctx): - """Migrate bedrock/firefox/templates/firefox/enterprise/index.html, part {index}.""" - - ctx.add_transforms( - "firefox/enterprise.ftl", - "firefox/enterprise.ftl", - [ - FTL.Message( - id=FTL.Identifier("firefox-enterprise-get-firefox-for-your-enterprise-with"), - value=REPLACE( - index, - "Get Firefox for your enterprise with ESR and Rapid Release", - { - "Firefox": TERM_REFERENCE("brand-name-firefox"), - "ESR": TERM_REFERENCE("brand-name-esr"), - }, - ), - ), - FTL.Message( - id=FTL.Identifier("firefox-enterprise-get-unmatched-data-protection"), - value=REPLACE( - index, - "Get unmatched data protection on the release cadence that suits you with Firefox for enterprise. Download ESR and Rapid Release.", - { - "Firefox": TERM_REFERENCE("brand-name-firefox"), - "ESR": TERM_REFERENCE("brand-name-esr"), - }, - ), - ), - FTL.Message( - id=FTL.Identifier("firefox-enterprise-enterprise"), - value=REPLACE( - index, - "Enterprise", - { - "Enterprise": TERM_REFERENCE("brand-name-enterprise"), - }, - ), - ), - ] - + transforms_from( - """ -firefox-enterprise-overview = {COPY(index, "Overview",)} -firefox-enterprise-downloads = {COPY(index, "Downloads",)} -""", - index=index, - ) - + [ - FTL.Message( - id=FTL.Identifier("firefox-enterprise-get-firefox-for-your-enterprise"), - value=REPLACE( - index, - "Get Firefox for your enterprise", - { - "Firefox": TERM_REFERENCE("brand-name-firefox"), - }, - ), - ), - FTL.Message( - id=FTL.Identifier("firefox-enterprise-get-the-firefox-extended-support"), - value=REPLACE( - index, - 'Get the Firefox Extended Support Release or Rapid Release browser for comprehensive data security and data protection.', - { - "%%": "%", - "%s": VARIABLE_REFERENCE("url"), - "Firefox Extended Support Release": TERM_REFERENCE("brand-name-firefox-extended-support-release"), - }, - ), - ), - ] - + transforms_from( - """ -firefox-enterprise-unmatched-data-protection = {COPY(index, "Unmatched data protection — on the release cadence that suits you",)} -""", - index=index, - ) - + [ - FTL.Message( - id=FTL.Identifier("firefox-enterprise-the-firefox-browser-is-open"), - value=REPLACE( - index, - "The Firefox browser is open source and provides Enhanced Tracking Protection — all part of our longstanding commitment to data protection.", - { - "Firefox": TERM_REFERENCE("brand-name-firefox"), - }, - ), - ), - ] - + transforms_from( - """ -firefox-enterprise-your-data-stays-your-business = {COPY(index, "Your data stays your business",)} -firefox-enterprise-deploy-when-and-how-you-want = {COPY(index, "Deploy when and how you want",)} -""", - index=index, - ) - + [ - FTL.Message( - id=FTL.Identifier("firefox-enterprise-with-install-packages-and"), - value=REPLACE( - index, - "With install packages and a wide expansion of group policies and features, deployment is faster and more flexible than ever — and a breeze in Windows and MacOS environments.", - { - "Windows": TERM_REFERENCE("brand-name-windows"), - "MacOS": TERM_REFERENCE("brand-name-mac"), - }, - ), - ), - ] - + transforms_from( - """ -firefox-enterprise-choose-your-release-cadence = {COPY(index, "Choose your release cadence",)} -firefox-enterprise-get-rapid-releases-to-make = {COPY(index, "Get rapid releases to make sure you get the latest features faster, or go extended to ensure a super stable experience.",)} -""", - index=index, - ) - + [ - FTL.Message( - id=FTL.Identifier("firefox-enterprise-enterprise-downloads"), - value=REPLACE( - index, - "Enterprise downloads", - { - "Enterprise": TERM_REFERENCE("brand-name-enterprise"), - }, - ), - ), - FTL.Message( - id=FTL.Identifier("firefox-enterprise-windows-64-bit"), - value=REPLACE( - index, - "Windows 64-bit", - { - "Windows": TERM_REFERENCE("brand-name-windows"), - }, - ), - ), - ] - + transforms_from( - """ -firefox-enterprise-macos = { -brand-name-mac } -firefox-enterprise-select-your-download = {COPY(index, "Select your download",)} -""", - index=index, - ) - + [ - FTL.Message( - id=FTL.Identifier("firefox-enterprise-firefox-browser"), - value=REPLACE( - index, - "Firefox browser", - { - "Firefox": TERM_REFERENCE("brand-name-firefox"), - "Firefox browser": TERM_REFERENCE("brand-name-firefox-browser"), - }, - ), - ), - FTL.Message( - id=FTL.Identifier("firefox-enterprise-firefox-browser-msi-installer"), - value=REPLACE( - index, - "Firefox browser - MSI installer", - { - "Firefox": TERM_REFERENCE("brand-name-firefox"), - "Firefox browser": TERM_REFERENCE("brand-name-firefox-browser"), - }, - ), - ), - FTL.Message( - id=FTL.Identifier("firefox-enterprise-firefox-extended-support-release"), - value=REPLACE( - index, - "Firefox Extended Support Release (ESR)", - { - "Firefox Extended Support Release": TERM_REFERENCE("brand-name-firefox-extended-support-release"), - "ESR": TERM_REFERENCE("brand-name-esr"), - }, - ), - ), - FTL.Message( - id=FTL.Identifier("firefox-enterprise-firefox-extended-support-release-msi"), - value=REPLACE( - index, - "Firefox Extended Support Release (ESR) - MSI installer", - { - "Firefox Extended Support Release": TERM_REFERENCE("brand-name-firefox-extended-support-release"), - "ESR": TERM_REFERENCE("brand-name-esr"), - }, - ), - ), - ] - + transforms_from( - """ -firefox-enterprise-support = {COPY(index, "Support",)} -firefox-enterprise-msi-installers = {COPY(index, "MSI installers",)} -firefox-enterprise-legacy-browser-support = {COPY(index, "Legacy browser support",)} -firefox-enterprise-admx-templates = {COPY(index, "ADMX templates",)} -firefox-enterprise-deployment-guide = {COPY(index, "Deployment guide",)} -firefox-enterprise-policy-documentation = {COPY(index, "Policy documentation",)} -firefox-enterprise-release-notes = {COPY(index, "Release Notes",)} -firefox-enterprise-documentation-and-community = {COPY(index, "Documentation and Community Support",)} -""", - index=index, - ) - + [ - FTL.Message( - id=FTL.Identifier("firefox-enterprise-sample-plist-for-configuration"), - value=REPLACE( - index, - 'Sample plist for configuration profile', - { - "%%": "%", - "%s": VARIABLE_REFERENCE("url"), - }, - ), - ), - ] - + transforms_from( - """ -firefox-enterprise-pkg-installer = {COPY(index, "PKG installer",)} -""", - index=index, - ) - + [ - FTL.Message( - id=FTL.Identifier("firefox-enterprise-windows-32-bit"), - value=REPLACE( - index, - "Windows 32-bit", - { - "Windows": TERM_REFERENCE("brand-name-windows"), - }, - ), - ), - FTL.Message( - id=FTL.Identifier("firefox-enterprise-download-firefox-esr-or-rapid"), - value=REPLACE( - index, - 'Download Firefox ESR or Rapid Release for
another language or platform.', - { - "%%": "%", - "%(firefox_all)s": VARIABLE_REFERENCE("firefox_all"), - "Firefox ESR": TERM_REFERENCE("brand-name-firefox-esr"), - }, - ), - ), - ], - ) diff --git a/lib/fluent_migrations/firefox/facebookcontainer/__init__.py b/lib/fluent_migrations/firefox/facebookcontainer/__init__.py deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/lib/fluent_migrations/firefox/facebookcontainer/index.py b/lib/fluent_migrations/firefox/facebookcontainer/index.py deleted file mode 100644 index a5bde759c6..0000000000 --- a/lib/fluent_migrations/firefox/facebookcontainer/index.py +++ /dev/null @@ -1,169 +0,0 @@ -from __future__ import absolute_import - -import fluent.syntax.ast as FTL -from fluent.migrate import COPY, REPLACE -from fluent.migrate.helpers import TERM_REFERENCE, VARIABLE_REFERENCE, transforms_from - -index = "firefox/facebookcontainer/index.lang" - - -def migrate(ctx): - """Migrate bedrock/firefox/templates/firefox/facebookcontainer/index.html, part {index}.""" - - ctx.add_transforms( - "firefox/facebook_container.ftl", - "firefox/facebook_container.ftl", - [ - FTL.Message( - id=FTL.Identifier("facebook-container-facebook-container-for-firefox"), - value=REPLACE( - index, - "Facebook Container for Firefox | Prevent Facebook from seeing what websites you visit.", - { - "Facebook": TERM_REFERENCE("brand-name-facebook"), - "Facebook Container": TERM_REFERENCE("brand-name-facebook-container"), - "Firefox": TERM_REFERENCE("brand-name-firefox"), - }, - ), - ), - FTL.Message( - id=FTL.Identifier("facebook-container-millions-of-people-around"), - value=REPLACE( - index, - "Millions of people around the world trust Firefox Web browsers on Android, iOS and desktop computers. Fast. Private. Download now!", - { - "Firefox": TERM_REFERENCE("brand-name-firefox"), - "Android": TERM_REFERENCE("brand-name-android"), - "iOS": TERM_REFERENCE("brand-name-ios"), - }, - ), - ), - FTL.Message( - id=FTL.Identifier("facebook-container-facebook-well-contained-keep"), - value=REPLACE( - index, - "Facebook. Well contained. Keep the rest of your life to yourself.", - { - "Facebook": TERM_REFERENCE("brand-name-facebook"), - }, - ), - ), - FTL.Message( - id=FTL.Identifier("facebook-container-get-the-facebook-container"), - value=REPLACE( - index, - "Get the Facebook Container Extension", - { - "Facebook Container": TERM_REFERENCE("brand-name-facebook-container"), - }, - ), - ), - FTL.Message( - id=FTL.Identifier("facebook-container-download-firefox-and-get-the"), - value=REPLACE( - index, - "Download Firefox and get the Facebook Container Extension", - { - "Facebook Container": TERM_REFERENCE("brand-name-facebook-container"), - "Firefox": TERM_REFERENCE("brand-name-firefox"), - }, - ), - ), - FTL.Message( - id=FTL.Identifier("facebook-container-the-facebook-container-extension"), - value=REPLACE( - index, - "The Facebook Container Extension is not available on mobile devices.", - { - "Facebook Container": TERM_REFERENCE("brand-name-facebook-container"), - }, - ), - ), - FTL.Message( - id=FTL.Identifier("facebook-container-try-firefox-focus-the-privacy"), - value=REPLACE( - index, - "Try Firefox Focus, the privacy browser for Android and iOS.", - { - "Firefox Focus": TERM_REFERENCE("brand-name-firefox-focus"), - "Android": TERM_REFERENCE("brand-name-android"), - "iOS": TERM_REFERENCE("brand-name-ios"), - }, - ), - ), - ] - + transforms_from( - """ -facebook-container-opt-out-on-your-terms = {COPY(index, "Opt out on your terms",)} -""", - index=index, - ) - + [ - FTL.Message( - id=FTL.Identifier("facebook-container-facebook-can-track-almost"), - value=REPLACE( - index, - 'Facebook can track almost all your web activity and tie it to your Facebook identity. If that’s too much for you, the Facebook Container extension isolates your identity into a separate container tab, making it harder for Facebook to track you on the web outside of Facebook.', - { - "%%": "%", - "%(fbcontainer)s": VARIABLE_REFERENCE("fbcontainer"), - "Facebook": TERM_REFERENCE("brand-name-facebook"), - "Facebook Container": TERM_REFERENCE("brand-name-facebook-container"), - }, - ), - ), - ] - + transforms_from( - """ -facebook-container-install-and-contain = {COPY(index, "Install and contain",)} -""", - index=index, - ) - + [ - FTL.Message( - id=FTL.Identifier("facebook-container-installing-the-extension-is"), - value=REPLACE( - index, - 'Installing the extension is easy and, once activated, will open Facebook in a blue tab each time you use it. Use and enjoy Facebook normally. Facebook will still be able to send you advertising and recommendations on their site, but it will be much harder for Facebook to use your activity collected off Facebook to send you ads and other targeted messages.', - { - "%%": "%", - "%(fbcontainer)s": VARIABLE_REFERENCE("fbcontainer"), - "Facebook": TERM_REFERENCE("brand-name-facebook"), - }, - ), - ), - FTL.Message( - id=FTL.Identifier("facebook-container-about-firefox-and-mozilla"), - value=REPLACE( - index, - "About Firefox and Mozilla", - { - "Mozilla": TERM_REFERENCE("brand-name-mozilla"), - "Firefox": TERM_REFERENCE("brand-name-firefox"), - }, - ), - ), - FTL.Message( - id=FTL.Identifier("facebook-container-were-backed-by-mozilla-the"), - value=REPLACE( - index, - 'We’re backed by Mozilla, the not-for-profit organization that puts people over profit to give everyone more power online. We created this extension because we believe that you should have easy-to-use tools that help you manage your privacy and security.', - { - "%%": "%", - "%(mozilla)s": VARIABLE_REFERENCE("mozilla"), - "Mozilla": TERM_REFERENCE("brand-name-mozilla"), - }, - ), - ), - FTL.Message( - id=FTL.Identifier("facebook-container-browse-freely-with-firefox"), - value=REPLACE( - index, - "Browse freely with Firefox today.", - { - "Firefox": TERM_REFERENCE("brand-name-firefox"), - }, - ), - ), - ], - ) diff --git a/lib/fluent_migrations/firefox/features/__init__.py b/lib/fluent_migrations/firefox/features/__init__.py deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/lib/fluent_migrations/firefox/features/adblocker.py b/lib/fluent_migrations/firefox/features/adblocker.py deleted file mode 100644 index ff94817aed..0000000000 --- a/lib/fluent_migrations/firefox/features/adblocker.py +++ /dev/null @@ -1,261 +0,0 @@ -from __future__ import absolute_import - -import fluent.syntax.ast as FTL -from fluent.migrate import COPY, REPLACE -from fluent.migrate.helpers import TERM_REFERENCE, VARIABLE_REFERENCE, transforms_from - -adblocker = "firefox/adblocker.lang" - - -def migrate(ctx): - """Migrate bedrock/firefox/templates/firefox/features/adblocker.html, part {index}.""" - - ctx.add_transforms( - "firefox/features/adblocker.ftl", - "firefox/features/adblocker.ftl", - transforms_from( - """ -features-adblocker-how-to-block-annoying = {COPY(adblocker, "How to block annoying ads using an ad blocker",)} -""", - adblocker=adblocker, - ) - + [ - FTL.Message( - id=FTL.Identifier("features-adblocker-how-to-stop-seeing-too"), - value=REPLACE( - adblocker, - "How to stop seeing too many ads and keep companies from following you around online. An ad blocker guide from the Firefox web browser.", - { - "Firefox": TERM_REFERENCE("brand-name-firefox"), - }, - ), - ), - ] - + transforms_from( - """ -features-adblocker-the-ad-blocker-a-secret = {COPY(adblocker, "The ad blocker – a secret weapon against annoying ads.",)} -features-adblocker-so-many-ads-so-little = {COPY(adblocker, "So many ads, so little patience… It’s time to stop the madness.",)} -features-adblocker-the-average-person-sees = {COPY(adblocker, "The average person sees an average of 4,000 ads a day. If you think that’s too many, an ad blocker is your new best friend.",)} -features-adblocker-an-ad-blocker-is-a-piece = {COPY(adblocker, "An ad blocker is a piece of software that can be used to block ads, and they work in two ways. The first way is when an ad blocker blocks the signal from an advertiser’s server, so the ad never shows up on your page. Another way ad blockers work is by blocking out sections of a website that could be ads.",)} -""", - adblocker=adblocker, - ) - + [ - FTL.Message( - id=FTL.Identifier("features-adblocker-these-ads-might-be-loud"), - value=REPLACE( - adblocker, - 'These ads might be loud video ads, ads that follow you around the web, trackers, third-party cookies, and more. To use an ad blocker, you can search for ad blocker add-ons that are available in your browser. Firefox, for example, has this list of approved ad blocker add-ons. Click on this list (or ad blockers that are approved for your browser) and see which fits your needs.', - { - "%%": "%", - "%(firefox)s": VARIABLE_REFERENCE("firefox"), - "%(addons)s": VARIABLE_REFERENCE("addons"), - "Firefox": TERM_REFERENCE("brand-name-firefox"), - }, - ), - ), - ] - + transforms_from( - """ -features-adblocker-find-the-right-ad-blocker = {COPY(adblocker, "Find the right ad blocker for you",)} -""", - adblocker=adblocker, - ) - + [ - FTL.Message( - id=FTL.Identifier("features-adblocker-theres-adblocker-ultimate"), - value=REPLACE( - adblocker, - 'There’s AdBlocker Ultimate that gets rid of every single ad, but buyer beware. Some of your favorite newspapers and magazines rely on advertising. Too many people blocking their ads could put them out of business.', - { - "%%": "%", - "%(url)s": VARIABLE_REFERENCE("url"), - }, - ), - ), - FTL.Message( - id=FTL.Identifier("features-adblocker-popup-ads-are-the-worst"), - value=REPLACE( - adblocker, - 'Popup ads are the worst. Block them with Popup Blocker and never deal with another annoying popup again.', - { - "%%": "%", - "%(url)s": VARIABLE_REFERENCE("url"), - }, - ), - ), - FTL.Message( - id=FTL.Identifier("features-adblocker-one-of-the-most-popular"), - value=REPLACE( - adblocker, - 'One of the most popular ad blockers for Chrome, Safari and Firefox is AdBlock. Use it to block ads on Facebook, YouTube and Hulu.', - { - "%%": "%", - "%(url)s": VARIABLE_REFERENCE("url"), - "Facebook": TERM_REFERENCE("brand-name-facebook"), - "Firefox": TERM_REFERENCE("brand-name-firefox"), - "YouTube": TERM_REFERENCE("brand-name-youtube"), - "Chrome": TERM_REFERENCE("brand-name-chrome"), - "Safari": TERM_REFERENCE("brand-name-safari"), - "Hulu": TERM_REFERENCE("brand-name-hulu"), - }, - ), - ), - ] - + transforms_from( - """ -features-adblocker-create-a-tracker-free = {COPY(adblocker, "Create a tracker-free zone with Content Blocking",)} -""", - adblocker=adblocker, - ) - + [ - FTL.Message( - id=FTL.Identifier("features-adblocker-on-firefox-you-can-use"), - value=REPLACE( - adblocker, - 'On Firefox, you can use Privacy or Content Blocking settings to get even more control over ad trackers that serve you the ads.', - { - "%%": "%", - "%(privacy)s": VARIABLE_REFERENCE("privacy"), - "%(blocking)s": VARIABLE_REFERENCE("blocking"), - "Firefox": TERM_REFERENCE("brand-name-firefox"), - }, - ), - ), - ] - + transforms_from( - """ -features-adblocker-choose-your-level-of-protection = {COPY(adblocker, "Choose your level of protection",)} -""", - adblocker=adblocker, - ) - + [ - FTL.Message( - id=FTL.Identifier("features-adblocker-to-start-click-on-the"), - value=REPLACE( - adblocker, - "To start, click on the Firefox menu in the top right-hand corner of your screen. It looks like three lines stacked on top of each other. In the drop-down menu, click on Content Blocking. You should see a blue pop-up with different selections.", - { - "Firefox": TERM_REFERENCE("brand-name-firefox"), - }, - ), - ), - ] - + transforms_from( - """ -features-adblocker-go-easy-with-standard = {COPY(adblocker, "Go easy with Standard mode",)} -""", - adblocker=adblocker, - ) - + [ - FTL.Message( - id=FTL.Identifier("features-adblocker-if-ads-dont-bother-you"), - value=REPLACE( - adblocker, - 'If ads don’t bother you and you don’t mind being followed by trackers and third-party cookies, then the Standard setting should work for you. To get trackers off your tail in Standard mode, use a Private Browsing window.', - { - "%%": "%", - "%(url)s": VARIABLE_REFERENCE("url"), - }, - ), - ), - ] - + transforms_from( - """ -features-adblocker-get-tough-with-strict = {COPY(adblocker, "Get tough with Strict mode",)} -""", - adblocker=adblocker, - ) - + [ - FTL.Message( - id=FTL.Identifier("features-adblocker-if-seeing-too-many-ads"), - value=REPLACE( - adblocker, - "If seeing too many ads ruins your day, then the Strict mode is a better fit. This mode will block known third-party trackers and cookies in all Firefox windows.", - { - "Firefox": TERM_REFERENCE("brand-name-firefox"), - }, - ), - ), - ] - + transforms_from( - """ -features-adblocker-do-it-yourself-custom = {COPY(adblocker, "Do-it-yourself Custom mode",)} -features-adblocker-the-custom-setting-gives = {COPY(adblocker, "The Custom setting gives you the ultimate choice. You can decide what you’re blocking, including trackers, cookies and more. If you allow cookies from a website, you’ll automatically be in Custom mode.",)} -features-adblocker-cover-your-trail-block = {COPY(adblocker, "Cover your trail, block trackers",)} -features-adblocker-click-on-the-trackers = {COPY(adblocker, "Click on the Trackers box and you’ll be able to block trackers in two ways. One way to block trackers is to do it when you’re working in a Private Window. Another way to do it is to block trackers in all windows. Keep in mind that if you choose to always block trackers, some pages might not load correctly.",)} -features-adblocker-take-a-bite-out-of-cookies = {COPY(adblocker, "Take a bite out of cookies",)} -""", - adblocker=adblocker, - ) - + [ - FTL.Message( - id=FTL.Identifier("features-adblocker-cookies-are-sent-by-websites"), - value=REPLACE( - adblocker, - 'Cookies are sent by websites you visit. They live on your computer and monitor what you’ve been doing on a site. When an airline hikes your rates because you’ve looked at plane tickets once that day, that is the handiwork of a cookie.', - { - "%%": "%", - "%(url)s": VARIABLE_REFERENCE("url"), - }, - ), - ), - FTL.Message( - id=FTL.Identifier("features-adblocker-in-firefox-you-can-block"), - value=REPLACE( - adblocker, - "In Firefox, you can block all third-party cookies or just those set by trackers. Be aware that blocking all cookies can break some sites.", - { - "Firefox": TERM_REFERENCE("brand-name-firefox"), - }, - ), - ), - ] - + transforms_from( - """ -features-adblocker-send-a-do-not-track-signal = {COPY(adblocker, "Send a Do Not Track signal",)} -""", - adblocker=adblocker, - ) - + [ - FTL.Message( - id=FTL.Identifier("features-adblocker-if-you-dont-want-your"), - value=REPLACE( - adblocker, - 'If you don’t want your online behavior used for ads, you can send websites a polite “thanks but no thanks” letter by checking the Do Not Track option of Firefox. Participation is voluntary, but the websites that participate will stop tracking you immediately.', - { - "%%": "%", - "%(url)s": VARIABLE_REFERENCE("url"), - "Firefox": TERM_REFERENCE("brand-name-firefox"), - }, - ), - ), - ] - + transforms_from( - """ -features-adblocker-speed-up-thanks-to-ad = {COPY(adblocker, "Speed up thanks to ad blockers",)} -features-adblocker-in-some-cases-an-ad-blocker = {COPY(adblocker, "In some cases, an ad blocker can help your browser go faster. When an ad is loading, it can slow down a website. At the same time, it takes longer to find what you’re looking for if you’re too busy closing yet another ad.",)} -""", - adblocker=adblocker, - ) - + [ - FTL.Message( - id=FTL.Identifier("features-adblocker-if-you-want-to-learn-more"), - value=REPLACE( - adblocker, - 'If you want to learn more about ad blocking, there are hundreds of ad blocker extensions available for Firefox and other browsers. If want to try out the ad blockers Firefox uses, click here to download a browser that puts privacy first.', - { - "%%": "%", - "%(url)s": VARIABLE_REFERENCE("url"), - "Firefox": TERM_REFERENCE("brand-name-firefox"), - }, - ), - ), - ] - + transforms_from( - """ -features-adblocker-take-control-of-your-browser = {COPY(adblocker, "Take control of your browser.",)} -""", - adblocker=adblocker, - ), - ) diff --git a/lib/fluent_migrations/firefox/features/bookmarks.py b/lib/fluent_migrations/firefox/features/bookmarks.py deleted file mode 100644 index f6b931a415..0000000000 --- a/lib/fluent_migrations/firefox/features/bookmarks.py +++ /dev/null @@ -1,90 +0,0 @@ -from __future__ import absolute_import - -import fluent.syntax.ast as FTL -from fluent.migrate import COPY, REPLACE -from fluent.migrate.helpers import TERM_REFERENCE, VARIABLE_REFERENCE, transforms_from - -bookmarks = "firefox/features/bookmarks.lang" -shared = "firefox/shared.lang" - - -def migrate(ctx): - """Migrate bedrock/firefox/templates/firefox/features/bookmarks.html, part {index}.""" - - ctx.add_transforms( - "firefox/features/bookmarks.ftl", - "firefox/features/bookmarks.ftl", - [ - FTL.Message( - id=FTL.Identifier("features-bookmarks-firefox-browser-better"), - value=REPLACE( - bookmarks, - "Firefox Browser: Better bookmarks everywhere you go", - { - "Firefox Browser": TERM_REFERENCE("brand-name-firefox-browser"), - }, - ), - ), - ] - + transforms_from( - """ -features-bookmarks-easily-organize-your-bookmarks = {COPY(bookmarks, "Easily organize your bookmarks into folder and access them across all your devices, from desktop to mobile.",)} -features-bookmarks-better-bookmarks = {COPY(bookmarks, "Better bookmarks",)} -""", - bookmarks=bookmarks, - ) - + [ - FTL.Message( - id=FTL.Identifier("features-bookmarks-dont-agonize-lovers-of"), - value=REPLACE( - bookmarks, - "Don’t agonize, lovers of bookmarking. Organize with Firefox.", - { - "Firefox": TERM_REFERENCE("brand-name-firefox"), - }, - ), - ), - ] - + transforms_from( - """ -features-bookmarks-file-that-bookmark = {COPY(bookmarks, "File that bookmark",)} -features-bookmarks-get-your-faves-all-sorted = {COPY(bookmarks, "Get your faves all sorted with the bookmark star icon, which lets you add custom names and folders quickly. Then dial in your bookmarks toolbar to make sure you never lose sight of the links you love.",)} -features-bookmarks-fly-with-that-bookmark = {COPY(bookmarks, "Fly with that bookmark",)} -""", - bookmarks=bookmarks, - ) - + [ - FTL.Message( - id=FTL.Identifier("features-bookmarks-take-your-favorites-on"), - value=REPLACE( - bookmarks, - 'Take your favorites on the fly. Use Firefox Sync to access your bookmarks across all your devices, from desktop to mobile. Or try Pocket to save any online article, or page and come back to later – even without internet.', - { - "%%": "%", - "%(url)s": VARIABLE_REFERENCE("url"), - "Firefox Sync": TERM_REFERENCE("brand-name-firefox-sync"), - "Pocket": TERM_REFERENCE("brand-name-pocket"), - }, - ), - ), - ] - + transforms_from( - """ -features-bookmarks-futz-with-that-bookmark = {COPY(bookmarks, "Futz with that bookmark",)} -""", - bookmarks=bookmarks, - ) - + [ - FTL.Message( - id=FTL.Identifier("features-bookmarks-practice-your-exactitude"), - value=REPLACE( - bookmarks, - 'Practice your exactitude with every bookmark manager add-on you can think of, from full page snapshots to quick-switch sidebars to locked-down-tight private bookmarks.', - { - "%%": "%", - "%(url)s": VARIABLE_REFERENCE("url"), - }, - ), - ), - ], - ) diff --git a/lib/fluent_migrations/firefox/features/fast.py b/lib/fluent_migrations/firefox/features/fast.py deleted file mode 100644 index 12969f97dd..0000000000 --- a/lib/fluent_migrations/firefox/features/fast.py +++ /dev/null @@ -1,92 +0,0 @@ -from __future__ import absolute_import - -import fluent.syntax.ast as FTL -from fluent.migrate import COPY, REPLACE -from fluent.migrate.helpers import TERM_REFERENCE, VARIABLE_REFERENCE, transforms_from - -fast = "firefox/features/fast.lang" -shared = "firefox/shared.lang" - - -def migrate(ctx): - """Migrate bedrock/firefox/templates/firefox/features/fast.html, part {index}.""" - - ctx.add_transforms( - "firefox/features/fast.ftl", - "firefox/features/fast.ftl", - transforms_from( - """ -features-fast-get-more-done-browse-faster = {COPY(fast, "Get more done. Browse faster and lighter with multiple tabs",)} -features-fast-our-new-powerful-multi-process = {COPY(fast, "Our new, powerful multi-process platform handles all your tabs without slowing down your computer.",)} -""", - fast=fast, - ) - + [ - FTL.Message( - id=FTL.Identifier("features-fast-firefox-is-now-faster-and-leaner"), - value=REPLACE( - fast, - "Firefox is now faster and leaner", - { - "Firefox": TERM_REFERENCE("brand-name-firefox"), - }, - ), - ), - ] - + transforms_from( - """ -features-fast-weve-been-working-out-so-you = {COPY(fast, "We’ve been working out, so you can get more done.",)} -features-fast-use-less-memory = {COPY(fast, "Use less memory",)} -""", - fast=fast, - ) - + [ - FTL.Message( - id=FTL.Identifier("features-fast-no-one-likes-a-computer-hog"), - value=REPLACE( - fast, - "No one likes a computer hog! Firefox is a lean, mean (actually we’re pretty nice) browsing machine. Since we use less RAM than Chrome, your other programs can keep running at top speed.", - { - "Firefox": TERM_REFERENCE("brand-name-firefox"), - "Chrome": TERM_REFERENCE("brand-name-chrome"), - }, - ), - ), - ] - + transforms_from( - """ -features-fast-get-all-the-tabs-without-lags = {COPY(fast, "Get all the tabs without lags",)} -""", - fast=fast, - ) - + [ - FTL.Message( - id=FTL.Identifier("features-fast-multi-tasking-with-multiple"), - value=REPLACE( - fast, - "Multi-tasking with multiple tabs just got easier. Firefox is now a multi-process browser, which means that your tabs stay fresh and won’t take forever to reload. With 86% less hang time, switch quickly between tabs even as you open more.", - { - "Firefox": TERM_REFERENCE("brand-name-firefox"), - }, - ), - ), - ] - + transforms_from( - """ -features-fast-level-up-browser-gameplay = {COPY(fast, "Level-up browser gameplay",)} -""", - fast=fast, - ) - + [ - FTL.Message( - id=FTL.Identifier("features-fast-we-led-the-tech-to-run-3d-games"), - value=REPLACE( - fast, - "We led the tech to run 3D games at near-native speeds, and now Firefox is bringing better performance to online gaming. Our powerful browser reduces lags, speeds up ping times and optimizes overall gameplay through faster, leaner browsing.", - { - "Firefox": TERM_REFERENCE("brand-name-firefox"), - }, - ), - ), - ], - ) diff --git a/lib/fluent_migrations/firefox/features/independent.py b/lib/fluent_migrations/firefox/features/independent.py deleted file mode 100644 index cee561e9f0..0000000000 --- a/lib/fluent_migrations/firefox/features/independent.py +++ /dev/null @@ -1,121 +0,0 @@ -from __future__ import absolute_import - -import fluent.syntax.ast as FTL -from fluent.migrate import COPY, REPLACE -from fluent.migrate.helpers import TERM_REFERENCE, VARIABLE_REFERENCE, transforms_from - -independent = "firefox/features/independent.lang" -shared = "firefox/shared.lang" - - -def migrate(ctx): - """Migrate bedrock/firefox/templates/firefox/features/independent.html, part {index}.""" - - ctx.add_transforms( - "firefox/features/independent.ftl", - "firefox/features/independent.ftl", - [ - FTL.Message( - id=FTL.Identifier("features-independent-firefox-a-different"), - value=REPLACE( - independent, - "Firefox, a different browser for different times. Browse free.", - { - "Firefox": TERM_REFERENCE("brand-name-firefox"), - }, - ), - ), - ] - + transforms_from( - """ -features-independent-browse-the-internet = {COPY(independent, "Browse the Internet as it was meant to be… free, safe and accessible to all. Declare your online independence.",)} -""", - independent=independent, - ) - + [ - FTL.Message( - id=FTL.Identifier("features-independent-firefox-rebel-with-a"), - value=REPLACE( - independent, - "Firefox: Rebel with a cause", - { - "Firefox": TERM_REFERENCE("brand-name-firefox"), - }, - ), - ), - FTL.Message( - id=FTL.Identifier("features-independent-firefox-is-independent"), - value=REPLACE( - independent, - "Firefox is independent and a part of the non-profit Mozilla, which fights for your online rights, keeps corporate powers in check and makes the Internet accessible to everyone, everywhere.", - { - "Mozilla": TERM_REFERENCE("brand-name-mozilla"), - "Firefox": TERM_REFERENCE("brand-name-firefox"), - }, - ), - ), - ] - + transforms_from( - """ -features-independent-no-strings-attached = {COPY(independent, "No strings attached",)} -""", - independent=independent, - ) - + [ - FTL.Message( - id=FTL.Identifier("features-independent-firefox-is-built-by"), - value=REPLACE( - independent, - "Firefox is built by a non-profit. That means we can do things that others can’t, like build new products and features without a hidden agenda. We champion your right to privacy with tools like Private Browsing with Tracking Protection.", - { - "Firefox": TERM_REFERENCE("brand-name-firefox"), - }, - ), - ), - FTL.Message( - id=FTL.Identifier("features-independent-firefox-is-built-by-old"), - value=REPLACE( - independent, - "Firefox is built by a non-profit. That means we can do things that others can’t, like build new products and features without a hidden agenda. We champion your right to privacy with tools like Private Browsing with Tracking Protection, which go beyond what Google Chrome and Microsoft Edge offer.", - { - "Microsoft": TERM_REFERENCE("brand-name-microsoft"), - "Firefox": TERM_REFERENCE("brand-name-firefox"), - "Google": TERM_REFERENCE("brand-name-google"), - "Chrome": TERM_REFERENCE("brand-name-chrome"), - "Edge": TERM_REFERENCE("brand-name-edge"), - }, - ), - ), - ] - + transforms_from( - """ -features-independent-what-you-see-is-what = {COPY(independent, "What you see is what you get",)} -features-independent-we-believe-the-internet = {COPY(independent, "We believe the Internet is for people, not profit. Unlike other companies, we don’t sell access to your data. You’re in control over who sees your search and browsing history. Choice — that’s what a healthy Internet is all about!",)} -features-independent-a-browser-on-a-mission = {COPY(independent, "A browser on a mission",)} -""", - independent=independent, - ) - + [ - FTL.Message( - id=FTL.Identifier("features-independent-in-addition-to-fighting"), - value=REPLACE( - independent, - "In addition to fighting for your online rights, we also keep corporate powers in check, while working with allies all around the globe to nurture healthy Internet practices. So when you choose Firefox, we’re choosing you, too.", - { - "Firefox": TERM_REFERENCE("brand-name-firefox"), - }, - ), - ), - FTL.Message( - id=FTL.Identifier("features-independent-firefox-is-a-browser"), - value=REPLACE( - independent, - "Firefox is a browser with a conscience. As part of the technology non-profit Mozilla, we fight for your online rights, keep corporate powers in check and help educate developing countries on healthy Internet practices. So when you choose Firefox, we’re choosing you, too.", - { - "Mozilla": TERM_REFERENCE("brand-name-mozilla"), - "Firefox": TERM_REFERENCE("brand-name-firefox"), - }, - ), - ), - ], - ) diff --git a/lib/fluent_migrations/firefox/features/memory.py b/lib/fluent_migrations/firefox/features/memory.py deleted file mode 100644 index 220c951330..0000000000 --- a/lib/fluent_migrations/firefox/features/memory.py +++ /dev/null @@ -1,118 +0,0 @@ -from __future__ import absolute_import - -import fluent.syntax.ast as FTL -from fluent.migrate import COPY, REPLACE -from fluent.migrate.helpers import TERM_REFERENCE, VARIABLE_REFERENCE, transforms_from - -memory = "firefox/features/memory.lang" -shared = "firefox/shared.lang" - - -def migrate(ctx): - """Migrate bedrock/firefox/templates/firefox/features/memory.html, part {index}.""" - - ctx.add_transforms( - "firefox/features/memory.ftl", - "firefox/features/memory.ftl", - [ - FTL.Message( - id=FTL.Identifier("features-memory-firefox-browser-use-less"), - value=REPLACE( - memory, - "Firefox Browser: Use less memory, get more speed", - { - "Firefox Browser": TERM_REFERENCE("brand-name-firefox-browser"), - }, - ), - ), - FTL.Message( - id=FTL.Identifier("features-memory-is-your-computer-slow-your"), - value=REPLACE( - memory, - "Is your computer slow? Your browser might be using too much memory. Switch to Firefox today for more speed.", - { - "Firefox": TERM_REFERENCE("brand-name-firefox"), - }, - ), - ), - FTL.Message( - id=FTL.Identifier("features-memory-less-memory-usage-than-chrome"), - value=REPLACE( - memory, - "Less memory usage than Chrome", - { - "Chrome": TERM_REFERENCE("brand-name-chrome"), - }, - ), - ), - FTL.Message( - id=FTL.Identifier("features-memory-if-your-web-browser-uses"), - value=REPLACE( - memory, - "If your web browser uses too much memory, switch to Firefox.", - { - "Firefox": TERM_REFERENCE("brand-name-firefox"), - }, - ), - ), - ] - + transforms_from( - """ -features-memory-speed-up-your-computer = {COPY(memory, "Speed up your computer",)} -""", - memory=memory, - ) - + [ - FTL.Message( - id=FTL.Identifier("features-memory-every-computer-program-you"), - value=REPLACE( - memory, - "Every computer program you run takes up some memory. When too much is used, your system can slooooowww down. Firefox aims for a balance — using enough memory to let you browse smoothly and leaving plenty of memory to keep your computer responsive.", - { - "Firefox": TERM_REFERENCE("brand-name-firefox"), - }, - ), - ), - ] - + transforms_from( - """ -features-memory-stop-running-out-of-memory = {COPY(memory, "Stop running out of memory",)} -""", - memory=memory, - ) - + [ - FTL.Message( - id=FTL.Identifier("features-memory-chrome-uses-up-to-177x-more"), - value=REPLACE( - memory, - 'Chrome uses up to 1.77x more memory than Firefox. If your computer is already low on memory, this can cause a significant slowdown. Using Firefox’s latest version with multi-process can result in more available memory to run your favorite programs.', - { - "%%": "%", - "%(url)s": VARIABLE_REFERENCE("url"), - "Firefox": TERM_REFERENCE("brand-name-firefox"), - "Chrome": TERM_REFERENCE("brand-name-chrome"), - }, - ), - ), - ] - + transforms_from( - """ -features-memory-browse-faster-privately = {COPY(memory, "Browse faster, privately",)} -""", - memory=memory, - ) - + [ - FTL.Message( - id=FTL.Identifier("features-memory-explore-the-web-faster-with"), - value=REPLACE( - memory, - 'Explore the web faster with Firefox Private Browsing. Only Firefox’s private mode includes tracking protection which blocks ads with trackers from loading on pages. Decluttering sites means web pages can load faster.', - { - "%%": "%", - "%(url)s": VARIABLE_REFERENCE("url"), - "Firefox": TERM_REFERENCE("brand-name-firefox"), - }, - ), - ), - ], - ) diff --git a/lib/fluent_migrations/firefox/features/password-manager.py b/lib/fluent_migrations/firefox/features/password-manager.py deleted file mode 100644 index 9beea6f5bb..0000000000 --- a/lib/fluent_migrations/firefox/features/password-manager.py +++ /dev/null @@ -1,115 +0,0 @@ -from __future__ import absolute_import - -import fluent.syntax.ast as FTL -from fluent.migrate import COPY, REPLACE -from fluent.migrate.helpers import TERM_REFERENCE, VARIABLE_REFERENCE, transforms_from - -password_manager = "firefox/features/password-manager.lang" -shared = "firefox/shared.lang" - - -def migrate(ctx): - """Migrate bedrock/firefox/templates/firefox/features/password-manager.html, part {index}.""" - - ctx.add_transforms( - "firefox/features/password-manager.ftl", - "firefox/features/password-manager.ftl", - [ - FTL.Message( - id=FTL.Identifier("password-manager-firefox-browser"), - value=REPLACE( - password_manager, - "Firefox Browser: Fast, Easy Password Manager", - { - "Firefox Browser": TERM_REFERENCE("brand-name-firefox-browser"), - }, - ), - ), - FTL.Message( - id=FTL.Identifier("password-manager-firefox-password"), - value=REPLACE( - password_manager, - "Firefox Password Manager saves all your passwords in one place so you can automatically login to sites, or retrieve saved passwords.", - { - "Firefox": TERM_REFERENCE("brand-name-firefox"), - }, - ), - ), - ] - + transforms_from( - """ -password-manager-password-manager = {COPY(password_manager, "Password Manager achievement unlocked",)} -""", - password_manager=password_manager, - ) - + [ - FTL.Message( - id=FTL.Identifier("password-manager-give-up-the-memory"), - value=REPLACE( - password_manager, - "Give up the memory game with Firefox Password Manager.", - { - "Firefox": TERM_REFERENCE("brand-name-firefox"), - }, - ), - ), - ] - + transforms_from( - """ -password-manager-password-hero = {COPY(password_manager, "Password hero",)} -""", - password_manager=password_manager, - ) - + [ - FTL.Message( - id=FTL.Identifier("password-manager-forget-the-reset"), - value=REPLACE( - password_manager, - 'Forget the reset. Firefox Password Manager keeps all your passwords so you can log in automatically, or find saved passwords easily. For super security, give your computer a master password.', - { - "%%": "%", - "%(url)s": VARIABLE_REFERENCE("url"), - "Firefox": TERM_REFERENCE("brand-name-firefox"), - }, - ), - ), - ] - + transforms_from( - """ -password-manager-password-ninja = {COPY(password_manager, "Password ninja",)} -""", - password_manager=password_manager, - ) - + [ - FTL.Message( - id=FTL.Identifier("password-manager-no-more-try-again"), - value=REPLACE( - password_manager, - "No more “try again” while you’re trying to get somewhere. Log in to your Firefox Account on your phone, and your passwords come with you. Your login details will simply appear, just like that.", - { - "Firefox Account": TERM_REFERENCE("brand-name-firefox-account"), - }, - ), - ), - ] - + transforms_from( - """ -password-manager-password-master = {COPY(password_manager, "Password master",)} -""", - password_manager=password_manager, - ) - + [ - FTL.Message( - id=FTL.Identifier("password-manager-earn-your-second"), - value=REPLACE( - password_manager, - 'Earn your second security black belt with Firefox’s vast array of password manager add-ons. Choose an existing favorite or find a next-level one through expert community ratings and reviews.', - { - "%%": "%", - "%(addons)s": VARIABLE_REFERENCE("addons"), - "Firefox": TERM_REFERENCE("brand-name-firefox"), - }, - ), - ), - ], - ) diff --git a/lib/fluent_migrations/firefox/features/private-browsing.py b/lib/fluent_migrations/firefox/features/private-browsing.py deleted file mode 100644 index 2d545bacd3..0000000000 --- a/lib/fluent_migrations/firefox/features/private-browsing.py +++ /dev/null @@ -1,109 +0,0 @@ -from __future__ import absolute_import - -import fluent.syntax.ast as FTL -from fluent.migrate import COPY, REPLACE -from fluent.migrate.helpers import TERM_REFERENCE, VARIABLE_REFERENCE, transforms_from - -private_browsing = "firefox/features/private-browsing.lang" -shared = "firefox/shared.lang" - - -def migrate(ctx): - """Migrate bedrock/firefox/templates/firefox/features/private-browsing.html, part {index}.""" - - ctx.add_transforms( - "firefox/features/private-browsing.ftl", - "firefox/features/private-browsing.ftl", - transforms_from( - """ -features-private-browsing-private-browser = {COPY(private_browsing, "Private Browser with extra tracking protection",)} -""", - private_browsing=private_browsing, - ) - + [ - FTL.Message( - id=FTL.Identifier("features-private-browsing-firefox-protects"), - value=REPLACE( - private_browsing, - "Firefox protects your online privacy and blocks trackers that follow you around the web.", - { - "Firefox": TERM_REFERENCE("brand-name-firefox"), - }, - ), - ), - FTL.Message( - id=FTL.Identifier("features-private-browsing-firefox-more-protection"), - value=REPLACE( - private_browsing, - "Firefox: More protection. Less worry.", - { - "Firefox": TERM_REFERENCE("brand-name-firefox"), - }, - ), - ), - FTL.Message( - id=FTL.Identifier("features-private-browsing-were-obsessed-with"), - value=REPLACE( - private_browsing, - "We’re obsessed with protecting your privacy. That’s why we’ve made Firefox Private Browsing more powerful than the others.", - { - "Firefox": TERM_REFERENCE("brand-name-firefox"), - }, - ), - ), - ] - + transforms_from( - """ -features-private-browsing-browse-without = {COPY(private_browsing, "Browse without a trace",)} -""", - private_browsing=private_browsing, - ) - + [ - FTL.Message( - id=FTL.Identifier("features-private-browsing-sharing-is-caring"), - value=REPLACE( - private_browsing, - "Sharing is caring, but that should be your call. Firefox Private Browsing automatically erases your online info like passwords, cookies and history from your computer. So that when you close out, you leave no trace.", - { - "Firefox": TERM_REFERENCE("brand-name-firefox"), - }, - ), - ), - ] - + transforms_from( - """ -features-private-browsing-catch-those-hidden = {COPY(private_browsing, "Catch those hidden trackers",)} -""", - private_browsing=private_browsing, - ) - + [ - FTL.Message( - id=FTL.Identifier("features-private-browsing-some-websites-and"), - value=REPLACE( - private_browsing, - "Some websites and ads attach hidden trackers that collect your browsing info long after you’ve left. Only Firefox Private Browsing has tracking protection to block them automatically.", - { - "Firefox": TERM_REFERENCE("brand-name-firefox"), - }, - ), - ), - ] - + transforms_from( - """ -features-private-browsing-shake-off-tracking = {COPY(private_browsing, "Shake off tracking weight",)} -""", - private_browsing=private_browsing, - ) - + [ - FTL.Message( - id=FTL.Identifier("features-private-browsing-not-only-do-trackers"), - value=REPLACE( - private_browsing, - "Not only do trackers collect info, they can weigh down your browsing speeds. Only Firefox Private Browsing blocks ads with hidden trackers, so you can drop the baggage and browse freely.", - { - "Firefox": TERM_REFERENCE("brand-name-firefox"), - }, - ), - ), - ], - ) diff --git a/lib/fluent_migrations/firefox/firstrun/__init__.py b/lib/fluent_migrations/firefox/firstrun/__init__.py deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/lib/fluent_migrations/firefox/firstrun/firstrun.py b/lib/fluent_migrations/firefox/firstrun/firstrun.py deleted file mode 100644 index 2a37105e9c..0000000000 --- a/lib/fluent_migrations/firefox/firstrun/firstrun.py +++ /dev/null @@ -1,80 +0,0 @@ -from __future__ import absolute_import - -import fluent.syntax.ast as FTL -from fluent.migrate import COPY, REPLACE -from fluent.migrate.helpers import TERM_REFERENCE, VARIABLE_REFERENCE, transforms_from - -firstrun = "firefox/firstrun/firstrun.lang" -quantum = "firefox/new/quantum.lang" - - -def migrate(ctx): - """Migrate bedrock/firefox/templates/firefox/firstrun/firstrun.html, part {index}.""" - - ctx.add_transforms( - "firefox/firstrun.ftl", - "firefox/firstrun.ftl", - transforms_from( - """ -firstrun-firefox-browser = { -brand-name-firefox-browser } -""", - quantum=quantum, - ) - + [ - FTL.Message( - id=FTL.Identifier("firstrun-welcome-to-firefox"), - value=REPLACE( - quantum, - "Welcome to Firefox", - { - "Firefox": TERM_REFERENCE("brand-name-firefox"), - }, - ), - ), - FTL.Message( - id=FTL.Identifier("firstrun-take-firefox-with-you"), - value=REPLACE( - quantum, - "Take Firefox with You", - { - "Firefox": TERM_REFERENCE("brand-name-firefox"), - }, - ), - ), - FTL.Message( - id=FTL.Identifier("firstrun-already-using-firefox"), - value=REPLACE( - quantum, - "Already using Firefox?", - { - "Firefox": TERM_REFERENCE("brand-name-firefox"), - }, - ), - ), - ] - + transforms_from( - """ -firstrun-get-your-bookmarks-history = {COPY(quantum, "Get your bookmarks, history, passwords and other settings on all your devices.",)} -""", - quantum=quantum, - ) - + [ - FTL.Message( - id=FTL.Identifier("firstrun-sign-in-to-your-account"), - value=REPLACE( - quantum, - "Sign in to your account and we’ll sync the bookmarks, passwords and other great things you’ve saved to Firefox on other devices.", - { - "Firefox": TERM_REFERENCE("brand-name-firefox"), - }, - ), - ), - ] - + transforms_from( - """ -firstrun-already-have-an-account = {COPY(quantum, "Already have an account?",)} -firstrun-sign-in = {COPY(quantum, "Sign In",)} -""", - quantum=quantum, - ), - ) diff --git a/lib/fluent_migrations/firefox/fxa-form.py b/lib/fluent_migrations/firefox/fxa-form.py deleted file mode 100644 index 13619bbab9..0000000000 --- a/lib/fluent_migrations/firefox/fxa-form.py +++ /dev/null @@ -1,54 +0,0 @@ -from __future__ import absolute_import - -import fluent.syntax.ast as FTL -from fluent.migrate import COPY, REPLACE -from fluent.migrate.helpers import TERM_REFERENCE, VARIABLE_REFERENCE, transforms_from - -main = "main.lang" - - -def migrate(ctx): - """Migrate bedrock/base/templates/macros.html, part {index}.""" - - ctx.add_transforms( - "fxa_form.ftl", - "fxa_form.ftl", - [ - FTL.Message( - id=FTL.Identifier("fxa-form-enter-your-email"), - value=REPLACE( - "main.lang", - "Enter your email to access Firefox Accounts.", - { - "Firefox Accounts": TERM_REFERENCE("brand-name-firefox-accounts"), - }, - ), - ), - FTL.Message( - id=FTL.Identifier("fxa-form-by-proceeding"), - value=REPLACE( - "main.lang", - 'By proceeding, you agree to the Terms of Service and Privacy Notice.', - { - "%%": "%", - "%(url1)s": VARIABLE_REFERENCE("url1"), - "%(url2)s": VARIABLE_REFERENCE("url2"), - }, - ), - ), - ], - ) - - ctx.add_transforms( - "fxa_form.ftl", - "fxa_form.ftl", - transforms_from( - """ -fxa-form-email-address = {COPY(main, "Email address",)} -fxa-form-continue = {COPY(main, "Continue",)} -fxa-form-create-account = {COPY(main, "Create account",)} -fxa-form-get-the-app = {COPY(main, "Get the app",)} -""", - main=main, - ), - ) diff --git a/lib/fluent_migrations/firefox/home/__init__.py b/lib/fluent_migrations/firefox/home/__init__.py deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/lib/fluent_migrations/firefox/home/index-master.py b/lib/fluent_migrations/firefox/home/index-master.py deleted file mode 100644 index a34dff1377..0000000000 --- a/lib/fluent_migrations/firefox/home/index-master.py +++ /dev/null @@ -1,171 +0,0 @@ -from __future__ import absolute_import - -import fluent.syntax.ast as FTL -from fluent.migrate import COPY, REPLACE -from fluent.migrate.helpers import TERM_REFERENCE, VARIABLE_REFERENCE, transforms_from - -home_master = "firefox/home-master.lang" - - -def migrate(ctx): - """Migrate bedrock/firefox/templates/firefox/home/index-master.html, part {index}.""" - - ctx.add_transforms( - "firefox/home.ftl", - "firefox/home.ftl", - [ - FTL.Message( - id=FTL.Identifier("firefox-home-firefox-protect-your"), - value=REPLACE( - home_master, - "Firefox - Protect your life online with privacy-first products", - { - "Firefox": TERM_REFERENCE("brand-name-firefox"), - }, - ), - ), - FTL.Message( - id=FTL.Identifier("firefox-home-firefox-is-more-than"), - value=REPLACE( - home_master, - "Firefox is more than a browser. Learn more about Firefox products that handle your data with respect and are built for privacy anywhere you go online.", - { - "Firefox": TERM_REFERENCE("brand-name-firefox"), - }, - ), - ), - ] - + transforms_from( - """ -firefox-home-the-browser-is-just = {COPY(home_master, "The browser is just the beginning",)} -firefox-home-meet-our-family-of = {COPY(home_master, "Meet our family of products",)} -""", - home_master=home_master, - ) - + [ - FTL.Message( - id=FTL.Identifier("firefox-home-get-trackers-off"), - value=REPLACE( - home_master, - "Get 2,000+ trackers off your trail — including Facebook", - { - "Facebook": TERM_REFERENCE("brand-name-facebook"), - }, - ), - ), - ] - + transforms_from( - """ -firefox-home-know-when-hackers-strike = {COPY(home_master, "Know when hackers strike — and stay a step ahead",)} -firefox-home-start-getting-breach = {COPY(home_master, "Start getting breach reports",)} -firefox-home-keep-your-passwords = {COPY(home_master, "Keep your passwords safe on every device",)} -""", - home_master=home_master, - ) - + [ - FTL.Message( - id=FTL.Identifier("firefox-home-learn-more-about-lockwise"), - value=REPLACE( - home_master, - "Learn more about Lockwise", - { - "Lockwise": TERM_REFERENCE("brand-name-lockwise"), - }, - ), - ), - ] - + transforms_from( - """ -firefox-home-get-the-respect-you = {COPY(home_master, "Get the respect you deserve",)} -""", - home_master=home_master, - ) - + [ - FTL.Message( - id=FTL.Identifier("firefox-home-every-single-firefox"), - value=REPLACE( - home_master, - "Every single Firefox product honors our Personal Data Promise: Take less. Keep it safe. No secrets.", - { - "Firefox": TERM_REFERENCE("brand-name-firefox"), - }, - ), - ), - ] - + transforms_from( - """ -firefox-home-share-large-files-without = {COPY(home_master, "Share large files without prying eyes",)} -firefox-home-start-sending-files = {COPY(home_master, "Start sending files safely",)} -firefox-home-trade-clickbait-for = {COPY(home_master, "Trade clickbait for quality content",)} -""", - home_master=home_master, - ) - + [ - FTL.Message( - id=FTL.Identifier("firefox-home-learn-more-about-pocket"), - value=REPLACE( - home_master, - "Learn more about Pocket", - { - "Pocket": TERM_REFERENCE("brand-name-pocket"), - }, - ), - ), - ] - + transforms_from( - """ -firefox-home-one-login-all-your = {COPY(home_master, "One login. All your devices. A family of products that respect your privacy.",)} -""", - home_master=home_master, - ) - + [ - FTL.Message( - id=FTL.Identifier("firefox-home-learn-more-about-joining"), - value=REPLACE( - home_master, - "Learn more about joining Firefox", - { - "Firefox": TERM_REFERENCE("brand-name-firefox"), - }, - ), - ), - ] - + transforms_from( - """ -firefox-home-get-the-browser-extension = {COPY(home_master, "Get the browser extension",)} -""", - home_master=home_master, - ) - + [ - FTL.Message( - id=FTL.Identifier("firefox-home-get-the-facebook-container"), - value=REPLACE( - home_master, - "Get the Facebook Container extension", - { - "Facebook Container": TERM_REFERENCE("brand-name-facebook-container"), - }, - ), - ), - ] - + transforms_from( - """ -firefox-home-download-the-browser = {COPY(home_master, "Download the browser",)} -firefox-home-download-the-app = {COPY(home_master, "Download the app",)} -firefox-home-desktop = {COPY(home_master, "Desktop",)} -firefox-home-browsers = {COPY(home_master, "Browsers",)} -firefox-home-android = { -brand-name-android } -firefox-home-ios = { -brand-name-ios } -firefox-home-monitor = { -brand-name-monitor } -firefox-home-lockwise = { -brand-name-lockwise } -firefox-home-send = { -brand-name-send } -firefox-home-mozilla = { -brand-name-mozilla } -firefox-home-firefox-browser = { -brand-name-firefox-browser } -firefox-home-firefox-monitor = { -brand-name-firefox-monitor } -firefox-home-firefox-lockwise = { -brand-name-firefox-lockwise } -firefox-home-firefox-send = { -brand-name-firefox-send } -firefox-home-pocket = { -brand-name-pocket } -""", - home_master=home_master, - ), - ) diff --git a/lib/fluent_migrations/firefox/includes/__init__.py b/lib/fluent_migrations/firefox/includes/__init__.py deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/lib/fluent_migrations/firefox/includes/download-button.py b/lib/fluent_migrations/firefox/includes/download-button.py deleted file mode 100644 index 77128d99cd..0000000000 --- a/lib/fluent_migrations/firefox/includes/download-button.py +++ /dev/null @@ -1,260 +0,0 @@ -from __future__ import absolute_import - -import fluent.syntax.ast as FTL -from fluent.migrate import COPY, REPLACE -from fluent.migrate.helpers import TERM_REFERENCE, VARIABLE_REFERENCE, transforms_from - -download_button = "firefox/includes/download-button.lang" -download_button = "download_button.lang" -main = "main.lang" - - -def migrate(ctx): - """Migrate bedrock/firefox/templates/firefox/includes/download-button.html, part {index}.""" - - ctx.add_transforms( - "download_button.ftl", - "download_button.ftl", - transforms_from( - """ -download-button-download-now = {COPY(download_button, "Download now",)} -download-button-free-download = {COPY(download_button, "Free Download",)} -download-button-firefox-beta = { -brand-name-firefox-beta } -download-button-firefox-aurora = { -brand-name-firefox-aurora } -download-button-firefox-developer-edition = { -brand-name-firefox } { -brand-name-developer-edition } -download-button-firefox-nightly = { -brand-name-firefox-nightly } -download-button-supported-devices = {COPY(download_button, "Supported Devices",)} -download-button-whats-new = {COPY(download_button, "What’s New",)} -download-button-systems-languages = {COPY(download_button, "Systems & Languages",)} -download-button-recommended = {COPY(download_button, "Recommended",)} -""", - download_button=download_button, - ) - + [ - FTL.Message( - id=FTL.Identifier("download-button-mozilla-no-longer-provides"), - value=REPLACE( - download_button, - 'Mozilla no longer provides security updates for Firefox on Windows XP or Vista, but you can still download the final Windows 32-bit version below.', - { - "%%": "%", - "%(url)s": VARIABLE_REFERENCE("url"), - "Mozilla": TERM_REFERENCE("brand-name-mozilla"), - "Firefox": TERM_REFERENCE("brand-name-firefox"), - "Windows": TERM_REFERENCE("brand-name-windows"), - "XP": TERM_REFERENCE("brand-name-xp"), - "Vista": TERM_REFERENCE("brand-name-vista"), - }, - ), - ), - FTL.Message( - id=FTL.Identifier("download-button-please-follow-these"), - value=REPLACE( - download_button, - 'Please follow these instructions to install Firefox.', - { - "%%": "%", - "%(url)s": VARIABLE_REFERENCE("url"), - "Firefox": TERM_REFERENCE("brand-name-firefox"), - }, - ), - ), - FTL.Message( - id=FTL.Identifier("download-button-your-system-does-not"), - value=REPLACE( - download_button, - 'Your system doesn\'t meet the requirements to run Firefox.', - { - "%%": "%", - "%(url)s": VARIABLE_REFERENCE("url"), - "Firefox": TERM_REFERENCE("brand-name-firefox"), - }, - ), - ), - ], - ) - - ctx.add_transforms( - "download_button.ftl", - "download_button.ftl", - [ - FTL.Message( - id=FTL.Identifier("download-button-firefox-other-platforms"), - value=REPLACE( - "download_button.lang", - "Firefox for Other Platforms & Languages", - { - "Firefox": TERM_REFERENCE("brand-name-firefox"), - }, - ), - ), - FTL.Message( - id=FTL.Identifier("download-button-update-your-firefox"), - value=REPLACE( - "download_button.lang", - "Update your Firefox", - { - "Firefox": TERM_REFERENCE("brand-name-firefox"), - }, - ), - ), - FTL.Message( - id=FTL.Identifier("download-button-get-firefox-android"), - value=REPLACE( - "download_button.lang", - "Get Firefox for Android", - { - "Firefox": TERM_REFERENCE("brand-name-firefox"), - "Android": TERM_REFERENCE("brand-name-android"), - }, - ), - ), - FTL.Message( - id=FTL.Identifier("download-button-get-firefox-ios"), - value=REPLACE( - "download_button.lang", - "Get Firefox for iOS", - { - "Firefox": TERM_REFERENCE("brand-name-firefox"), - "iOS": TERM_REFERENCE("brand-name-ios"), - }, - ), - ), - FTL.Message( - id=FTL.Identifier("download-button-google-play"), - value=REPLACE( - "download_button.lang", - "Get it on Google Play", - { - "Google Play": TERM_REFERENCE("brand-name-google-play"), - }, - ), - ), - FTL.Message( - id=FTL.Identifier("download-button-free-google-play"), - value=REPLACE( - "download_button.lang", - "Get it free on Google Play", - { - "Google Play": TERM_REFERENCE("brand-name-google-play"), - }, - ), - ), - FTL.Message( - id=FTL.Identifier("download-button-app-store"), - value=REPLACE( - "download_button.lang", - "Get it free from the App Store", - { - "App Store": TERM_REFERENCE("brand-name-app-store"), - }, - ), - ), - FTL.Message( - id=FTL.Identifier("download-button-download-app-store"), - value=REPLACE( - "download_button.lang", - "Download on the App Store", - { - "App Store": TERM_REFERENCE("brand-name-app-store"), - }, - ), - ), - FTL.Message( - id=FTL.Identifier("download-button-download-firefox"), - value=REPLACE( - "download_button.lang", - "Download Firefox", - { - "Firefox": TERM_REFERENCE("brand-name-firefox"), - }, - ), - ), - FTL.Message( - id=FTL.Identifier("download-button-your-system-may"), - value=REPLACE( - "download_button.lang", - "Your system may not meet the requirements for Firefox, but you can try one of these versions:", - { - "Firefox": TERM_REFERENCE("brand-name-firefox"), - }, - ), - ), - FTL.Message( - id=FTL.Identifier("download-button-firefox-beta-android"), - value=REPLACE( - "download_button.lang", - "Firefox Beta for Android", - { - "Firefox Beta": TERM_REFERENCE("brand-name-firefox-beta"), - "Android": TERM_REFERENCE("brand-name-android"), - }, - ), - ), - FTL.Message( - id=FTL.Identifier("download-button-firefox-aurora-android"), - value=REPLACE( - "download_button.lang", - "Firefox Aurora for Android", - { - "Firefox Aurora": TERM_REFERENCE("brand-name-firefox-aurora"), - "Android": TERM_REFERENCE("brand-name-android"), - }, - ), - ), - FTL.Message( - id=FTL.Identifier("download-button-firefox-nightly-android"), - value=REPLACE( - "download_button.lang", - "Firefox Nightly for Android", - { - "Firefox Nightly": TERM_REFERENCE("brand-name-firefox-nightly"), - "Android": TERM_REFERENCE("brand-name-android"), - }, - ), - ), - FTL.Message( - id=FTL.Identifier("download-button-firefox-android"), - value=REPLACE( - "download_button.lang", - "Firefox for Android", - { - "Firefox": TERM_REFERENCE("brand-name-firefox"), - "Android": TERM_REFERENCE("brand-name-android"), - }, - ), - ), - FTL.Message( - id=FTL.Identifier("download-button-firefox-ios"), - value=REPLACE( - "download_button.lang", - "Firefox for iOS", - { - "Firefox": TERM_REFERENCE("brand-name-firefox"), - "iOS": TERM_REFERENCE("brand-name-ios"), - }, - ), - ), - FTL.Message( - id=FTL.Identifier("download-button-firefox-privacy"), - value=REPLACE( - "download_button.lang", - "Firefox Privacy", - { - "Firefox": TERM_REFERENCE("brand-name-firefox"), - }, - ), - ), - ], - ) - - ctx.add_transforms( - "download_button.ftl", - "download_button.ftl", - transforms_from( - """ -download-button-download = {COPY(main, "Download",)} -""", - main=main, - ), - ) diff --git a/lib/fluent_migrations/firefox/lockwise/__init__.py b/lib/fluent_migrations/firefox/lockwise/__init__.py deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/lib/fluent_migrations/firefox/lockwise/lockwise.py b/lib/fluent_migrations/firefox/lockwise/lockwise.py deleted file mode 100644 index f02f4d0604..0000000000 --- a/lib/fluent_migrations/firefox/lockwise/lockwise.py +++ /dev/null @@ -1,110 +0,0 @@ -from __future__ import absolute_import - -import fluent.syntax.ast as FTL -from fluent.migrate import COPY, REPLACE -from fluent.migrate.helpers import TERM_REFERENCE, VARIABLE_REFERENCE, transforms_from - -lockwise = "firefox/products/lockwise.lang" - - -def migrate(ctx): - """Migrate bedrock/firefox/templates/firefox/lockwise/lockwise.html, part {index}.""" - - ctx.add_transforms( - "firefox/products/lockwise.ftl", - "firefox/products/lockwise.ftl", - [ - FTL.Message( - id=FTL.Identifier("lockwise-firefox-lockwise-password"), - value=REPLACE( - lockwise, - "Firefox Lockwise — password manager — take your passwords everywhere", - { - "Firefox Lockwise": TERM_REFERENCE("brand-name-firefox-lockwise"), - }, - ), - ), - FTL.Message( - id=FTL.Identifier("lockwise-firefox-lockwise-lets-you"), - value=REPLACE( - lockwise, - "Firefox Lockwise lets you securely access the passwords you’ve saved in Firefox from anywhere — even outside of the browser. Features 256-bit encryption and Face/Touch ID.", - { - "Firefox": TERM_REFERENCE("brand-name-firefox"), - "Firefox Lockwise": TERM_REFERENCE("brand-name-firefox-lockwise"), - }, - ), - ), - ] - + transforms_from( - """ -lockwise-firefox-lockwise = { -brand-name-firefox-lockwise } -lockwise-take-your-passwords-everywhere = {COPY(lockwise, "Take your passwords everywhere",)} -""", - lockwise=lockwise, - ) - + [ - FTL.Message( - id=FTL.Identifier("lockwise-securely-access-the-passwords"), - value=REPLACE( - lockwise, - "Securely access the passwords you’ve saved in Firefox from anywhere — even outside of the browser.", - { - "Firefox": TERM_REFERENCE("brand-name-firefox"), - }, - ), - ), - FTL.Message( - id=FTL.Identifier("lockwise-try-lockwise-now"), - value=REPLACE( - lockwise, - "Try Lockwise now", - { - "Lockwise": TERM_REFERENCE("brand-name-lockwise"), - }, - ), - ), - FTL.Message( - id=FTL.Identifier("lockwise-install-for-firefox"), - value=REPLACE( - lockwise, - "Install for Firefox", - { - "Firefox": TERM_REFERENCE("brand-name-firefox"), - }, - ), - ), - FTL.Message( - id=FTL.Identifier("lockwise-open-in-firefox"), - value=REPLACE( - lockwise, - "Open in Firefox", - { - "Firefox": TERM_REFERENCE("brand-name-firefox"), - }, - ), - ), - FTL.Message( - id=FTL.Identifier("lockwise-only-in-the-firefox-browser"), - value=REPLACE( - lockwise, - "Only in the Firefox Browser", - { - "Firefox Browser": TERM_REFERENCE("brand-name-firefox-browser"), - }, - ), - ), - ] - + transforms_from( - """ -lockwise-256-bit-encryption-protects = {COPY(lockwise, "256-bit encryption protects you while syncing",)} -lockwise-get-to-your-passwords-securely = {COPY(lockwise, "Get to your passwords securely with Face or Touch ID",)} -lockwise-your-privacy-comes-first = {COPY(lockwise, "Your privacy comes first.",)} -lockwise-we-keep-your-data-safe = {COPY(lockwise, "We keep your data safe, never sold.",)} -lockwise-support = {COPY(lockwise, "Support",)} -lockwise-your-privacy = {COPY(lockwise, "Your Privacy",)} -lockwise-github = { -brand-name-github } -""", - lockwise=lockwise, - ), - ) diff --git a/lib/fluent_migrations/firefox/mobile/__init__.py b/lib/fluent_migrations/firefox/mobile/__init__.py deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/lib/fluent_migrations/firefox/mobile/index.py b/lib/fluent_migrations/firefox/mobile/index.py deleted file mode 100644 index 05cda23a01..0000000000 --- a/lib/fluent_migrations/firefox/mobile/index.py +++ /dev/null @@ -1,207 +0,0 @@ -from __future__ import absolute_import - -import fluent.syntax.ast as FTL -from fluent.migrate import COPY, REPLACE -from fluent.migrate.helpers import TERM_REFERENCE, VARIABLE_REFERENCE, transforms_from - -index = "firefox/mobile/index.lang" -mobile_2019 = "firefox/mobile-2019.lang" - - -def migrate(ctx): - """Migrate bedrock/firefox/templates/firefox/mobile/index.html, part {index}.""" - - ctx.add_transforms( - "firefox/mobile.ftl", - "firefox/mobile.ftl", - [ - FTL.Message( - id=FTL.Identifier("firefox-mobile-download-the-firefox-browser"), - value=REPLACE( - mobile_2019, - "Download the Firefox Browser on your Mobile for iOS and Android", - { - "Firefox Browser": TERM_REFERENCE("brand-name-firefox-browser"), - "Android": TERM_REFERENCE("brand-name-android"), - "iOS": TERM_REFERENCE("brand-name-ios"), - }, - ), - ), - FTL.Message( - id=FTL.Identifier("firefox-mobile-firefox-browser-for-mobile"), - value=REPLACE( - mobile_2019, - "Firefox Browser for Mobile blocks over 2000 trackers by default, giving you the privacy you deserve and the speed you need in a private mobile browser.", - { - "Firefox Browser": TERM_REFERENCE("brand-name-firefox-browser"), - }, - ), - ), - ] - + transforms_from( - """ -firefox-mobile-firefox = { -brand-name-firefox } -firefox-mobile-firefox-browser = { -brand-name-firefox-browser } -firefox-mobile-get-the-mobile-browser-built = {COPY(mobile_2019, "Get the mobile browser built for you, not advertisers",)} -""", - mobile_2019=mobile_2019, - ) - + [ - FTL.Message( - id=FTL.Identifier("firefox-mobile-check-out-firefox-again-its"), - value=REPLACE( - mobile_2019, - "Check out Firefox again. It’s fast, private and on your side. For iOS and Android.", - { - "Firefox": TERM_REFERENCE("brand-name-firefox"), - "Android": TERM_REFERENCE("brand-name-android"), - "iOS": TERM_REFERENCE("brand-name-ios"), - }, - ), - ), - ] - + transforms_from( - """ -firefox-mobile-get-automatic-privacy-on-mobile = {COPY(mobile_2019, "Get automatic privacy on mobile",)} -firefox-mobile-super-fast-private-by-default = {COPY(mobile_2019, "Super fast. Private by default. Blocks 2000+ online trackers.",)} -""", - mobile_2019=mobile_2019, - ) - + [ - FTL.Message( - id=FTL.Identifier("firefox-mobile-get-firefox-mobile"), - value=REPLACE( - mobile_2019, - "Get Firefox Mobile", - { - "Firefox": TERM_REFERENCE("brand-name-firefox"), - }, - ), - ), - ] - + transforms_from( - """ -firefox-mobile-block-online-trackers-and = {COPY(mobile_2019, "Block online trackers and invasive ads",)} -firefox-mobile-privacy-protection-by-default = {COPY(mobile_2019, "Privacy protection by default",)} -""", - mobile_2019=mobile_2019, - ) - + [ - FTL.Message( - id=FTL.Identifier("firefox-mobile-leave-no-trace-with-private"), - value=REPLACE( - mobile_2019, - 'Leave no trace with Private Browsing mode. When you close out, your history and cookies are deleted.', - { - "%%": "%", - "%s": VARIABLE_REFERENCE("url"), - }, - ), - ), - ] - + transforms_from( - """ -firefox-mobile-stop-companies-from-following = {COPY(mobile_2019, "Stop companies from following you",)} -""", - mobile_2019=mobile_2019, - ) - + [ - FTL.Message( - id=FTL.Identifier("firefox-mobile-stay-off-their-radar-with"), - value=REPLACE( - mobile_2019, - 'Stay off their radar with Firefox Tracking Protection', - { - "%%": "%", - "%s": VARIABLE_REFERENCE("url"), - "Firefox": TERM_REFERENCE("brand-name-firefox"), - }, - ), - ), - ] - + transforms_from( - """ -firefox-mobile-discover-products-that-keep = {COPY(mobile_2019, "Discover products that keep you safe",)} -firefox-mobile-sync-your-history-passwords = {COPY(mobile_2019, "Sync your history, passwords, and bookmarks. Send tabs across all of your devices.",)} -""", - mobile_2019=mobile_2019, - ) - + [ - FTL.Message( - id=FTL.Identifier("firefox-mobile-android-only"), - value=REPLACE( - mobile_2019, - "Android only", - { - "Android": TERM_REFERENCE("brand-name-android"), - }, - ), - ), - FTL.Message( - id=FTL.Identifier("firefox-mobile-make-android-your-own"), - value=REPLACE( - mobile_2019, - "Make Android your own", - { - "Android": TERM_REFERENCE("brand-name-android"), - }, - ), - ), - FTL.Message( - id=FTL.Identifier("firefox-mobile-customize-your-firefox-mobile"), - value=REPLACE( - mobile_2019, - 'Customize your Firefox mobile browser with extensions to block ads, manage passwords, stop Facebook from tracking you and more.', - { - "%%": "%", - "%s": VARIABLE_REFERENCE("url"), - "Facebook": TERM_REFERENCE("brand-name-facebook"), - "Firefox": TERM_REFERENCE("brand-name-firefox"), - }, - ), - ), - ] - + transforms_from( - """ -firefox-mobile-find-it-fast-with-a-smart = {COPY(mobile_2019, "Find it fast with a smart search bar",)} -""", - mobile_2019=mobile_2019, - ) - + [ - FTL.Message( - id=FTL.Identifier("firefox-mobile-firefox-anticipates-your-needs"), - value=REPLACE( - mobile_2019, - "Firefox anticipates your needs with smart search suggestions and quick access to the sites you visit most.", - { - "Firefox": TERM_REFERENCE("brand-name-firefox"), - }, - ), - ), - ] - + transforms_from( - """ -firefox-mobile-the-privacy-you-deserve-the = {COPY(mobile_2019, "The privacy you deserve. The speed you need.",)} -""", - mobile_2019=mobile_2019, - ) - + [ - FTL.Message( - id=FTL.Identifier("firefox-mobile-get-firefox-for-mobile"), - value=REPLACE( - mobile_2019, - "Get Firefox for mobile", - { - "Firefox": TERM_REFERENCE("brand-name-firefox"), - }, - ), - ), - ] - + transforms_from( - """ -firefox-mobile-send-a-download-link-to-your = {COPY(mobile_2019, "Send a download link to your phone.",)} -firefox-mobile-scan-the-qr-code-to-get-started = {COPY(mobile_2019, "Scan the QR code to get started",)} -""", - mobile_2019=mobile_2019, - ), - ) diff --git a/lib/fluent_migrations/firefox/new.py b/lib/fluent_migrations/firefox/new.py deleted file mode 100644 index 4e963b3ff4..0000000000 --- a/lib/fluent_migrations/firefox/new.py +++ /dev/null @@ -1,275 +0,0 @@ -from __future__ import absolute_import - -import fluent.syntax.ast as FTL -from fluent.migrate import COPY, REPLACE -from fluent.migrate.helpers import TERM_REFERENCE, VARIABLE_REFERENCE, transforms_from - -trailhead = "firefox/new/trailhead.lang" - - -def migrate(ctx): - """Migrate bedrock/firefox/templates/firefox/new/trailhead/base.html, part {index}.""" - - ctx.add_transforms( - "firefox/new/download.ftl", - "firefox/new/download.ftl", - [ - FTL.Message( - id=FTL.Identifier("firefox-new-download-firefox"), - value=REPLACE( - "firefox/new/trailhead.lang", - "Download Firefox", - { - "Firefox": TERM_REFERENCE("brand-name-firefox"), - }, - ), - ), - FTL.Message( - id=FTL.Identifier("firefox-new-download-mozilla-firefox"), - value=REPLACE( - "firefox/new/trailhead.lang", - "Download Mozilla Firefox, a free Web browser. Firefox is created by a global non-profit dedicated to putting individuals in control online. Get Firefox for Windows, macOS, Linux, Android and iOS today!", - { - "Mozilla": TERM_REFERENCE("brand-name-mozilla"), - "Firefox": TERM_REFERENCE("brand-name-firefox"), - "Windows": TERM_REFERENCE("brand-name-windows"), - "macOS": TERM_REFERENCE("brand-name-mac"), - "Linux": TERM_REFERENCE("brand-name-linux"), - "Android": TERM_REFERENCE("brand-name-android"), - "iOS": TERM_REFERENCE("brand-name-ios"), - }, - ), - ), - FTL.Message( - id=FTL.Identifier("firefox-new-download-the-fastest-firefox"), - value=REPLACE( - "firefox/new/trailhead.lang", - "Download the fastest Firefox ever", - { - "Firefox": TERM_REFERENCE("brand-name-firefox"), - }, - ), - ), - FTL.Message( - id=FTL.Identifier("firefox-new-faster-page-loading-less-memory"), - value=REPLACE( - "firefox/new/trailhead.lang", - "Faster page loading, less memory usage and packed with features, the new Firefox is here.", - { - "Firefox": TERM_REFERENCE("brand-name-firefox"), - }, - ), - ), - FTL.Message( - id=FTL.Identifier("firefox-new-automatic-privacy-is-here"), - value=REPLACE( - "firefox/new/trailhead.lang", - "Automatic privacy is here. Download Firefox to block over 2000 trackers.", - { - "Firefox": TERM_REFERENCE("brand-name-firefox"), - }, - ), - ), - FTL.Message( - id=FTL.Identifier("firefox-new-get-the-latest-firefox"), - value=REPLACE( - "firefox/new/trailhead.lang", - "Get the latest Firefox browser.", - { - "Firefox": TERM_REFERENCE("brand-name-firefox"), - }, - ), - ), - FTL.Message( - id=FTL.Identifier("firefox-new-firefox-shows-you-how-many"), - value=REPLACE( - "firefox/new/trailhead.lang", - "Firefox shows you how many data-collecting trackers are blocked with Enhanced Tracking Protection.", - { - "Firefox": TERM_REFERENCE("brand-name-firefox"), - }, - ), - ), - FTL.Message( - id=FTL.Identifier("firefox-new-firefox-lockwise-makes-secure"), - value=REPLACE( - "firefox/new/trailhead.lang", - "Firefox Lockwise makes the passwords you save in Firefox secure and available on all your devices.", - { - "Firefox": TERM_REFERENCE("brand-name-firefox"), - "Firefox Lockwise": TERM_REFERENCE("brand-name-firefox-lockwise"), - }, - ), - ), - FTL.Message( - id=FTL.Identifier("firefox-new-firefox-monitor-alerts"), - value=REPLACE( - "firefox/new/trailhead.lang", - "Firefox Monitor alerts you if we know your information is a part of another company’s data breach.", - { - "Firefox Monitor": TERM_REFERENCE("brand-name-firefox-monitor"), - }, - ), - ), - FTL.Message( - id=FTL.Identifier("firefox-new-join-firefox"), - value=REPLACE( - "firefox/new/trailhead.lang", - "Join Firefox", - { - "Firefox": TERM_REFERENCE("brand-name-firefox"), - }, - ), - ), - FTL.Message( - id=FTL.Identifier("firefox-new-firefox-lockwise-makes"), - value=REPLACE( - "firefox/new/trailhead.lang", - "Firefox Lockwise makes the passwords you save in Firefox available on all your devices.", - { - "Firefox": TERM_REFERENCE("brand-name-firefox"), - "Firefox Lockwise": TERM_REFERENCE("brand-name-firefox-lockwise"), - }, - ), - ), - FTL.Message( - id=FTL.Identifier("firefox-new-download-firefox-for-windows"), - value=REPLACE( - "firefox/new/trailhead.lang", - "Download Firefox
for Windows", - { - "Firefox": TERM_REFERENCE("brand-name-firefox"), - "Windows": TERM_REFERENCE("brand-name-windows"), - }, - ), - ), - FTL.Message( - id=FTL.Identifier("firefox-new-download-firefox-for-macos"), - value=REPLACE( - "firefox/new/trailhead.lang", - "Download Firefox
for macOS", - { - "Firefox": TERM_REFERENCE("brand-name-firefox"), - "macOS": TERM_REFERENCE("brand-name-mac"), - }, - ), - ), - FTL.Message( - id=FTL.Identifier("firefox-new-download-firefox-for-linux"), - value=REPLACE( - "firefox/new/trailhead.lang", - "Download Firefox
for Linux", - { - "Firefox": TERM_REFERENCE("brand-name-firefox"), - "Linux": TERM_REFERENCE("brand-name-linux"), - }, - ), - ), - FTL.Message( - id=FTL.Identifier("firefox-new-youve-already-got-the-browser"), - value=REPLACE( - "firefox/new/trailhead.lang", - "You’ve already got the browser. Now get even more from Firefox.", - { - "Firefox": TERM_REFERENCE("brand-name-firefox"), - }, - ), - ), - FTL.Message( - id=FTL.Identifier("firefox-new-watch-for-hackers-with"), - value=REPLACE( - "firefox/new/trailhead.lang", - "Watch for hackers with Firefox Monitor, protect passwords with Firefox Lockwise, and more.", - { - "Firefox Monitor": TERM_REFERENCE("brand-name-firefox-monitor"), - "Firefox Lockwise": TERM_REFERENCE("brand-name-firefox-lockwise"), - }, - ), - ), - FTL.Message( - id=FTL.Identifier("firefox-new-get-more-from-firefox"), - value=REPLACE( - "firefox/new/trailhead.lang", - "Get More From Firefox", - { - "Firefox": TERM_REFERENCE("brand-name-firefox"), - }, - ), - ), - ], - ) - - ctx.add_transforms( - "firefox/new/download.ftl", - "firefox/new/download.ftl", - transforms_from( - """ -firefox-new-free-web-browser = {COPY(trailhead, "Free Web Browser",)} -firefox-new-and-start-getting-the-respect = {COPY(trailhead, "And start getting the respect you deserve with our family of privacy-first products.",)} -firefox-new-advanced-install-options = {COPY(trailhead, "Advanced install options & other platforms",)} -firefox-new-download-in-another-language = {COPY(trailhead, "Download in another language",)} -firefox-new-fix-a-problem = {COPY(trailhead, "Fix a problem",)} -firefox-new-need-help = {COPY(trailhead, "Need help?",)} -firefox-new-see-whats-being-blocked = {COPY(trailhead, "See what’s being blocked",)} -firefox-new-make-your-passwords-portable = {COPY(trailhead, "Make your passwords portable",)} -firefox-new-watch-for-data-breaches = {COPY(trailhead, "Watch for data breaches",)} -firefox-new-connect-to-a-whole-family = {COPY(trailhead, "Connect to a whole family of respectful products, plus all the knowledge you need to protect yourself online.",)} -firefox-new-passwords-made-portable = {COPY(trailhead, "Passwords made portable",)} -firefox-new-protect-your-privacy = {COPY(trailhead, "Protect your privacy",)} -firefox-new-private-browsing-clears = {COPY(trailhead, "Private Browsing clears your history to keep it secret from anyone who uses your computer.",)} -firefox-new-advanced-install-options-heading = {COPY(trailhead, "Advanced Install Options & Other Platforms",)} -firefox-new-just-download-the-browser = {COPY(trailhead, "Just Download The Browser",)} -""", - trailhead=trailhead, - ), - ) - - ctx.add_transforms( - "firefox/new/download.ftl", - "firefox/new/download.ftl", - [ - FTL.Message( - id=FTL.Identifier("firefox-new-youre-using-an-insecure-outdated"), - value=REPLACE( - trailhead, - 'You’re using an insecure, outdated operating system no longer supported by Firefox.', - { - "%%": "%", - "%(url)s": VARIABLE_REFERENCE("url"), - "Firefox": TERM_REFERENCE("brand-name-firefox"), - }, - ), - ), - FTL.Message( - id=FTL.Identifier("firefox-new-your-firefox-new-should-begin"), - value=REPLACE( - trailhead, - 'Your download should begin automatically. Didn’t work? Try downloading again.', - { - "%%": "%", - "%(id)s": VARIABLE_REFERENCE("id"), - "%(fallback_url)s": VARIABLE_REFERENCE("fallback_url"), - }, - ), - ), - FTL.Message( - id=FTL.Identifier("firefox-new-firefox-is-more-than-a-browser"), - value=REPLACE( - trailhead, - "Firefox is more than a browser.", - { - "Firefox": TERM_REFERENCE("brand-name-firefox"), - }, - ), - ), - ] - + transforms_from( - """ -firefox-new-its-privacy-and-peace-of = {COPY(trailhead, "It’s privacy and peace of mind on mobile, too.",)} -firefox-new-its-a-family-of-products = {COPY(trailhead, "It’s a family of products that treat your personal data with respect.",)} -firefox-new-its-everything-you-need-to = {COPY(trailhead, "It’s everything you need to know about staying safe online.",)} -firefox-new-its-a-community-that-believes = {COPY(trailhead, "It’s a community that believes tech can do better.",)} -""", - trailhead=trailhead, - ), - ) diff --git a/lib/fluent_migrations/firefox/new/__init__.py b/lib/fluent_migrations/firefox/new/__init__.py deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/lib/fluent_migrations/firefox/new/protocol/__init__.py b/lib/fluent_migrations/firefox/new/protocol/__init__.py deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/lib/fluent_migrations/firefox/new/protocol/download.py b/lib/fluent_migrations/firefox/new/protocol/download.py deleted file mode 100644 index ddf8b7a229..0000000000 --- a/lib/fluent_migrations/firefox/new/protocol/download.py +++ /dev/null @@ -1,462 +0,0 @@ -from __future__ import absolute_import - -import fluent.syntax.ast as FTL -from fluent.migrate import COPY, REPLACE -from fluent.migrate.helpers import TERM_REFERENCE, VARIABLE_REFERENCE, transforms_from - -base_download = "firefox/new/protocol/base_download.lang" -quantum = "firefox/new/quantum.lang" -main = "main.lang" - - -def migrate(ctx): - """Migrate bedrock/firefox/templates/firefox/new/protocol/base_download.html, part {index}.""" - - ctx.add_transforms( - "firefox/new/platform.ftl", - "firefox/new/platform.ftl", - transforms_from( - """ -new-platform-free-web-browser = {COPY(quantum, "Free Web Browser",)} -""", - quantum=quantum, - ) - + [ - FTL.Message( - id=FTL.Identifier("new-platform-download-firefox"), - value=REPLACE( - quantum, - "Download Firefox", - { - "Firefox": TERM_REFERENCE("brand-name-firefox"), - }, - ), - ), - FTL.Message( - id=FTL.Identifier("new-platform-download-the-fastest"), - value=REPLACE( - quantum, - "Download the fastest Firefox ever", - { - "Firefox": TERM_REFERENCE("brand-name-firefox"), - }, - ), - ), - FTL.Message( - id=FTL.Identifier("new-platform-faster-page-loading"), - value=REPLACE( - quantum, - "Faster page loading, less memory usage and packed with features, the new Firefox is here.", - { - "Firefox": TERM_REFERENCE("brand-name-firefox"), - }, - ), - ), - FTL.Message( - id=FTL.Identifier("new-platform-the-new-firefox"), - value=REPLACE( - quantum, - "The new Firefox", - { - "Firefox": TERM_REFERENCE("brand-name-firefox"), - }, - ), - ), - ] - + transforms_from( - """ -new-platform-2x-faster = {COPY(quantum, "2x Faster",)} -""", - quantum=quantum, - ) - + [ - FTL.Message( - id=FTL.Identifier("new-platform-the-best-firefox-ever"), - value=REPLACE( - quantum, - "The best Firefox ever", - { - "Firefox": TERM_REFERENCE("brand-name-firefox"), - }, - ), - ), - ] - + transforms_from( - """ -new-platform-lightweight = {COPY(quantum, "Lightweight",)} -""", - quantum=quantum, - ) - + [ - FTL.Message( - id=FTL.Identifier("new-platform-uses-30-less-memory"), - value=REPLACE( - quantum, - "Uses 30% less memory than Chrome", - { - "Chrome": TERM_REFERENCE("brand-name-chrome"), - }, - ), - ), - ] - + transforms_from( - """ -new-platform-powerfully-private = {COPY(quantum, "Powerfully private",)} -new-platform-truly-private-browsing = {COPY(quantum, "Truly Private Browsing with Tracking Protection",)} -new-platform-advanced-install-options = {COPY(quantum, "Advanced install options & other platforms",)} -new-platform-download-in-another = {COPY(quantum, "Download in another language",)} -new-platform-fix-a-problem = {COPY(quantum, "Fix a problem",)} -new-platform-need-help = {COPY(main, "Need help?",)} -""", - quantum=quantum, - main=main, - ), - ) - - ctx.add_transforms( - "firefox/new/platform.ftl", - "firefox/new/platform.ftl", - [ - FTL.Message( - id=FTL.Identifier("new-platform-download-mozilla-firefox-title"), - value=REPLACE( - quantum, - "Download Mozilla Firefox, a free Web browser. Firefox is created by a global non-profit dedicated to putting individuals in control online. Get Firefox for Windows, macOS, Linux, Android and iOS today!", - { - "Mozilla": TERM_REFERENCE("brand-name-mozilla"), - "Firefox": TERM_REFERENCE("brand-name-firefox"), - "Android": TERM_REFERENCE("brand-name-android"), - "Windows": TERM_REFERENCE("brand-name-windows"), - "Linux": TERM_REFERENCE("brand-name-linux"), - "macOS": TERM_REFERENCE("brand-name-mac"), - "iOS": TERM_REFERENCE("brand-name-ios"), - }, - ), - ), - ], - ) - - ctx.add_transforms( - "firefox/new/platform.ftl", - "firefox/new/platform.ftl", - [ - FTL.Message( - id=FTL.Identifier("new-platform-download-mozilla-linux"), - value=REPLACE( - quantum, - "Download Mozilla Firefox for Linux", - { - "Mozilla": TERM_REFERENCE("brand-name-mozilla"), - "Firefox": TERM_REFERENCE("brand-name-firefox"), - "Linux": TERM_REFERENCE("brand-name-linux"), - }, - ), - ), - FTL.Message( - id=FTL.Identifier("new-platform-download-mozilla-desc-linux"), - value=REPLACE( - quantum, - "Download Mozilla Firefox for Linux, a free Web browser. Firefox is created by a global non-profit dedicated to putting individuals in control online. Get Firefox for Linux today!", - { - "Mozilla": TERM_REFERENCE("brand-name-mozilla"), - "Firefox": TERM_REFERENCE("brand-name-firefox"), - "Linux": TERM_REFERENCE("brand-name-linux"), - }, - ), - ), - FTL.Message( - id=FTL.Identifier("new-platform-download-the-fastest-linux"), - value=REPLACE( - quantum, - "Download the fastest Firefox for Linux ever", - { - "Firefox": TERM_REFERENCE("brand-name-firefox"), - "Linux": TERM_REFERENCE("brand-name-linux"), - }, - ), - ), - FTL.Message( - id=FTL.Identifier("new-platform-faster-page-loading-linux"), - value=REPLACE( - quantum, - "Faster page loading, less memory usage and packed with features, the new Firefox for Linux is here.", - { - "Firefox": TERM_REFERENCE("brand-name-firefox"), - "Linux": TERM_REFERENCE("brand-name-linux"), - }, - ), - ), - FTL.Message( - id=FTL.Identifier("new-platform-firefox-for-linux"), - value=REPLACE( - quantum, - "Firefox for Linux", - { - "Firefox": TERM_REFERENCE("brand-name-firefox"), - "Linux": TERM_REFERENCE("brand-name-linux"), - }, - ), - ), - ] - + transforms_from( - """ -new-platform-own-your-online-life = {COPY(quantum, "Own your online life.",)} -new-platform-privacy-more-than = {COPY(quantum, "Privacy - more than a policy",)} -""", - quantum=quantum, - ) - + [ - FTL.Message( - id=FTL.Identifier("new-platform-your-life-your-business"), - value=REPLACE( - quantum, - "Your life, your business. Firefox blocks third-party tracking cookies on Linux.", - { - "Firefox": TERM_REFERENCE("brand-name-firefox"), - "Linux": TERM_REFERENCE("brand-name-linux"), - }, - ), - ), - FTL.Message( - id=FTL.Identifier("new-platform-speed-meet-security"), - value=REPLACE( - quantum, - "Speed, meet security. Firefox is two times faster with 30% less memory than Chrome.", - { - "Firefox": TERM_REFERENCE("brand-name-firefox"), - "Chrome": TERM_REFERENCE("brand-name-chrome"), - }, - ), - ), - ] - + transforms_from( - """ -new-platform-open-source = {COPY(quantum, "Open source",)} -""", - quantum=quantum, - ) - + [ - FTL.Message( - id=FTL.Identifier("new-platform-look-under-the-hood"), - value=REPLACE( - quantum, - "Look under the hood. Like Linux, Firefox features are open source.", - { - "Firefox": TERM_REFERENCE("brand-name-firefox"), - "Linux": TERM_REFERENCE("brand-name-linux"), - }, - ), - ), - ], - ) - - ctx.add_transforms( - "firefox/new/platform.ftl", - "firefox/new/platform.ftl", - [ - FTL.Message( - id=FTL.Identifier("new-platform-download-mozilla-firefox-mac"), - value=REPLACE( - quantum, - "Download Mozilla Firefox for Mac", - { - "Mozilla": TERM_REFERENCE("brand-name-mozilla"), - "Firefox": TERM_REFERENCE("brand-name-firefox"), - "Mac": TERM_REFERENCE("brand-name-mac-short"), - }, - ), - ), - FTL.Message( - id=FTL.Identifier("new-platform-download-mozilla-firefox-desc-mac"), - value=REPLACE( - quantum, - "Download Mozilla Firefox for Mac, a free Web browser. Firefox is created by a global non-profit dedicated to putting individuals in control online. Get Firefox for Mac today!", - { - "Mozilla": TERM_REFERENCE("brand-name-mozilla"), - "Firefox": TERM_REFERENCE("brand-name-firefox"), - "Mac": TERM_REFERENCE("brand-name-mac-short"), - }, - ), - ), - FTL.Message( - id=FTL.Identifier("new-platform-download-the-fastest-mac"), - value=REPLACE( - quantum, - "Download the fastest Firefox for Mac ever", - { - "Firefox": TERM_REFERENCE("brand-name-firefox"), - "Mac": TERM_REFERENCE("brand-name-mac-short"), - }, - ), - ), - FTL.Message( - id=FTL.Identifier("new-platform-faster-page-loading-mac"), - value=REPLACE( - quantum, - "Faster page loading, less memory usage and packed with features, the new Firefox for Mac is here.", - { - "Firefox": TERM_REFERENCE("brand-name-firefox"), - "Mac": TERM_REFERENCE("brand-name-mac-short"), - }, - ), - ), - FTL.Message( - id=FTL.Identifier("new-platform-firefox-respects-your"), - value=REPLACE( - quantum, - "Firefox respects your privacy on Mac.", - { - "Firefox": TERM_REFERENCE("brand-name-firefox"), - "Mac": TERM_REFERENCE("brand-name-mac-short"), - }, - ), - ), - ] - + transforms_from( - """ -new-platform-privacy-comes-first = {COPY(quantum, "Privacy comes first",)} -""", - quantum=quantum, - ) - + [ - FTL.Message( - id=FTL.Identifier("new-platform-firefox-doesnt-spy"), - value=REPLACE( - quantum, - "Firefox doesn’t spy on searches. We stop third-party tracking cookies and give you full control.", - { - "Firefox": TERM_REFERENCE("brand-name-firefox"), - }, - ), - ), - FTL.Message( - id=FTL.Identifier("new-platform-get-speed-and-security"), - value=REPLACE( - quantum, - "Get speed and security. Firefox is fast on Mac because we don’t track your moves.", - { - "Firefox": TERM_REFERENCE("brand-name-firefox"), - "Mac": TERM_REFERENCE("brand-name-mac-short"), - }, - ), - ), - ] - + transforms_from( - """ -new-platform-block-trackers = {COPY(quantum, "Block trackers",)} -new-platform-be-the-master-of-your = {COPY(quantum, "Be the master of your domain with strict content blocking. Cut off all cookies and trackers.",)} -""", - quantum=quantum, - ), - ) - - ctx.add_transforms( - "firefox/new/platform.ftl", - "firefox/new/platform.ftl", - [ - FTL.Message( - id=FTL.Identifier("new-platform-download-mozilla-windows"), - value=REPLACE( - quantum, - "Download Mozilla Firefox for Windows", - { - "Mozilla": TERM_REFERENCE("brand-name-mozilla"), - "Firefox": TERM_REFERENCE("brand-name-firefox"), - "Windows": TERM_REFERENCE("brand-name-windows"), - }, - ), - ), - FTL.Message( - id=FTL.Identifier("new-platform-download-mozilla-desc-windows"), - value=REPLACE( - quantum, - "Download Mozilla Firefox for Windows, a free Web browser. Firefox is created by a global non-profit dedicated to putting individuals in control online. Get Firefox for Windows today!", - { - "Mozilla": TERM_REFERENCE("brand-name-mozilla"), - "Firefox": TERM_REFERENCE("brand-name-firefox"), - "Windows": TERM_REFERENCE("brand-name-windows"), - }, - ), - ), - FTL.Message( - id=FTL.Identifier("new-platform-download-the-fastest-windows"), - value=REPLACE( - quantum, - "Download the fastest Firefox for Windows ever", - { - "Firefox": TERM_REFERENCE("brand-name-firefox"), - "Windows": TERM_REFERENCE("brand-name-windows"), - }, - ), - ), - FTL.Message( - id=FTL.Identifier("new-platform-faster-page-loading-windows"), - value=REPLACE( - quantum, - "Faster page loading, less memory usage and packed with features, the new Firefox for Windows is here.", - { - "Firefox": TERM_REFERENCE("brand-name-firefox"), - "Windows": TERM_REFERENCE("brand-name-windows"), - }, - ), - ), - FTL.Message( - id=FTL.Identifier("new-platform-firefox-fights"), - value=REPLACE( - quantum, - "Firefox fights for you on Windows.", - { - "Firefox": TERM_REFERENCE("brand-name-firefox"), - "Windows": TERM_REFERENCE("brand-name-windows"), - }, - ), - ), - FTL.Message( - id=FTL.Identifier("new-platform-firefox-moves-fast"), - value=REPLACE( - quantum, - "Firefox moves fast and treats your data with care - no ad tracking and no slowdown.", - { - "Firefox": TERM_REFERENCE("brand-name-firefox"), - }, - ), - ), - ] - + transforms_from( - """ -new-platform-common-sense-privacy = {COPY(quantum, "Common sense privacy",)} -""", - quantum=quantum, - ) - + [ - FTL.Message( - id=FTL.Identifier("new-platform-live-your-life"), - value=REPLACE( - quantum, - "Live your life, Firefox isn’t watching. Choose what to share and when to share it.", - { - "Firefox": TERM_REFERENCE("brand-name-firefox"), - }, - ), - ), - ] - + transforms_from( - """ -new-platform-seamless-setup = {COPY(quantum, "Seamless setup",)} -""", - quantum=quantum, - ) - + [ - FTL.Message( - id=FTL.Identifier("new-platform-easy-migration"), - value=REPLACE( - quantum, - "Easy migration of preferences and bookmarks when you download Firefox for Windows.", - { - "Firefox": TERM_REFERENCE("brand-name-firefox"), - "Windows": TERM_REFERENCE("brand-name-windows"), - }, - ), - ), - ], - ) diff --git a/lib/fluent_migrations/firefox/nightly_firstrun.py b/lib/fluent_migrations/firefox/nightly_firstrun.py deleted file mode 100644 index 26fabd2d95..0000000000 --- a/lib/fluent_migrations/firefox/nightly_firstrun.py +++ /dev/null @@ -1,95 +0,0 @@ -from __future__ import absolute_import - -import fluent.syntax.ast as FTL -from fluent.migrate import COPY, REPLACE -from fluent.migrate.helpers import TERM_REFERENCE, VARIABLE_REFERENCE, transforms_from - -nightly_firstrun = "firefox/nightly_firstrun.lang" - - -def migrate(ctx): - """Migrate bedrock/firefox/templates/firefox/nightly_firstrun.html, part {index}.""" - - ctx.add_transforms( - "firefox/nightly/firstrun.ftl", - "firefox/nightly/firstrun.ftl", - [ - FTL.Message( - id=FTL.Identifier("nightly-firstrun-firefox-nightly"), - value=REPLACE( - nightly_firstrun, - "Firefox Nightly First Run Page", - { - "Firefox Nightly": TERM_REFERENCE("brand-name-firefox-nightly"), - }, - ), - ), - FTL.Message( - id=FTL.Identifier("nightly-firstrun-thank-you-for-using"), - value=REPLACE( - nightly_firstrun, - "Thank you for using Firefox Nightly", - { - "Firefox Nightly": TERM_REFERENCE("brand-name-firefox-nightly"), - }, - ), - ), - FTL.Message( - id=FTL.Identifier("nightly-firstrun-choose-an-area"), - value=REPLACE( - nightly_firstrun, - "Choose an area to get involved below and help make Firefox better for users everywhere", - { - "Firefox": TERM_REFERENCE("brand-name-firefox"), - }, - ), - ), - ] - + transforms_from( - """ -nightly-firstrun-test = {COPY(nightly_firstrun, "Test",)} -nightly-firstrun-find-and-file-bugs = {COPY(nightly_firstrun, "Find and file bugs and generally make sure things work as they should.",)} -nightly-firstrun-start-testing = {COPY(nightly_firstrun, "Start testing",)} -nightly-firstrun-code = {COPY(nightly_firstrun, "Code",)} -""", - nightly_firstrun=nightly_firstrun, - ) - + [ - FTL.Message( - id=FTL.Identifier("nightly-firstrun-file-bugs-and-work"), - value=REPLACE( - nightly_firstrun, - "File bugs and work on the building blocks of the Firefox browser.", - { - "Firefox": TERM_REFERENCE("brand-name-firefox"), - }, - ), - ), - ] - + transforms_from( - """ -nightly-firstrun-start-coding = {COPY(nightly_firstrun, "Start coding",)} -nightly-firstrun-localize = {COPY(nightly_firstrun, "Localize",)} -""", - nightly_firstrun=nightly_firstrun, - ) - + [ - FTL.Message( - id=FTL.Identifier("nightly-firstrun-make-firefox-available"), - value=REPLACE( - nightly_firstrun, - "Make Firefox available (and better) in more languages around the world.", - { - "Firefox": TERM_REFERENCE("brand-name-firefox"), - }, - ), - ), - ] - + transforms_from( - """ -nightly-firstrun-contribute-link = {COPY(nightly_firstrun, "https://wiki.mozilla.org/L10n:Contribute",)} -nightly-firstrun-start-localizing = {COPY(nightly_firstrun, "Start localizing",)} -""", - nightly_firstrun=nightly_firstrun, - ), - ) diff --git a/lib/fluent_migrations/firefox/nightly_whatsnew.py b/lib/fluent_migrations/firefox/nightly_whatsnew.py deleted file mode 100644 index be42c5d1e4..0000000000 --- a/lib/fluent_migrations/firefox/nightly_whatsnew.py +++ /dev/null @@ -1,129 +0,0 @@ -from __future__ import absolute_import - -import fluent.syntax.ast as FTL -from fluent.migrate import COPY, REPLACE -from fluent.migrate.helpers import TERM_REFERENCE, VARIABLE_REFERENCE, transforms_from - -nightly_whatsnew = "firefox/nightly_whatsnew.lang" - - -def migrate(ctx): - """Migrate bedrock/firefox/templates/firefox/nightly_whatsnew.html, part {index}.""" - - ctx.add_transforms( - "firefox/nightly/whatsnew.ftl", - "firefox/nightly/whatsnew.ftl", - [ - FTL.Message( - id=FTL.Identifier("nightly-whatsnew-youve-just-been"), - value=REPLACE( - nightly_whatsnew, - "You’ve just been upgraded to Firefox Nightly %(version)s!", - { - "%%": "%", - "%(version)s": VARIABLE_REFERENCE("version"), - "Firefox Nightly": TERM_REFERENCE("brand-name-firefox-nightly"), - }, - ), - ), - FTL.Message( - id=FTL.Identifier("nightly-whatsnew-your-firefox-nightly"), - value=REPLACE( - nightly_whatsnew, - "Your Firefox Nightly has been updated.", - { - "Firefox Nightly": TERM_REFERENCE("brand-name-firefox-nightly"), - }, - ), - ), - ] - + transforms_from( - """ -nightly-whatsnew-firefox-nightly = { -brand-name-firefox-nightly } -""", - nightly_whatsnew=nightly_whatsnew, - ) - + [ - FTL.Message( - id=FTL.Identifier("nightly-whatsnew-every-4-to-5-weeks"), - value=REPLACE( - nightly_whatsnew, - "Every 4 to 5 weeks, a new major version of Firefox is released and as a result, the Nightly version increases as well.", - { - "Firefox": TERM_REFERENCE("brand-name-firefox"), - "Nightly": TERM_REFERENCE("brand-name-nightly"), - }, - ), - ), - FTL.Message( - id=FTL.Identifier("nightly-whatsnew-every-6-to-8-weeks"), - value=REPLACE( - nightly_whatsnew, - "Every 6 to 8 weeks, a new major version of Firefox is released and as a result, the Nightly version increases as well.", - { - "Firefox": TERM_REFERENCE("brand-name-firefox"), - "Nightly": TERM_REFERENCE("brand-name-nightly"), - }, - ), - ), - FTL.Message( - id=FTL.Identifier("nightly-whatsnew-this-is-a-good"), - value=REPLACE( - nightly_whatsnew, - "This is a good time to thank you for helping us make Firefox better and to give you some pointers to documentation, communication channels and news sites related to Nightly that may be of interest to you.", - { - "Firefox": TERM_REFERENCE("brand-name-firefox"), - "Nightly": TERM_REFERENCE("brand-name-nightly"), - }, - ), - ), - FTL.Message( - id=FTL.Identifier("nightly-whatsnew-if-you-want-to"), - value=REPLACE( - nightly_whatsnew, - 'If you want to know what’s happening around Nightly and its community, reading our blog and following us on Twitter are good starting points!', - { - "%%": "%", - "%(blog)s": VARIABLE_REFERENCE("blog"), - "%(twitter)s": VARIABLE_REFERENCE("twitter"), - "Twitter": TERM_REFERENCE("brand-name-twitter"), - "Nightly": TERM_REFERENCE("brand-name-nightly"), - }, - ), - ), - FTL.Message( - id=FTL.Identifier("nightly-whatsnew-want-to-know-which"), - value=REPLACE( - nightly_whatsnew, - 'Want to know which platform features you could test on Nightly and can’t see yet on other Firefox channels? Then have a look at the Experimental Features page on MDN.', - { - "%%": "%", - "%(mdn)s": VARIABLE_REFERENCE("mdn"), - "Mozilla Developer Network": TERM_REFERENCE("brand-name-mozilla-developer-network"), - "Firefox": TERM_REFERENCE("brand-name-firefox"), - "Nightly": TERM_REFERENCE("brand-name-nightly"), - "MDN": TERM_REFERENCE("brand-name-mdn"), - }, - ), - ), - FTL.Message( - id=FTL.Identifier("nightly-whatsnew-do-you-experience"), - value=REPLACE( - nightly_whatsnew, - 'Do you experience crashes? Unexpected behavior? Web compatibility regressions? We’d love to get them filed in Bugzilla to make sure they don’t make it to the final release (extra karma if you add the nightly-community keyword to your bug reports)!', - { - "%%": "%", - "%(bugzilla)s": VARIABLE_REFERENCE("bugzilla"), - "Bugzilla": TERM_REFERENCE("brand-name-bugzilla"), - "nightly": TERM_REFERENCE("brand-name-nightly"), - }, - ), - ), - ] - + transforms_from( - """ -nightly-whatsnew-go-community = {COPY(nightly_whatsnew, "Go community!",)} -""", - nightly_whatsnew=nightly_whatsnew, - ), - ) diff --git a/lib/fluent_migrations/firefox/privacy.py b/lib/fluent_migrations/firefox/privacy.py deleted file mode 100644 index 203562f18a..0000000000 --- a/lib/fluent_migrations/firefox/privacy.py +++ /dev/null @@ -1,412 +0,0 @@ -from __future__ import absolute_import - -import fluent.syntax.ast as FTL -from fluent.migrate import COPY, REPLACE -from fluent.migrate.helpers import TERM_REFERENCE, VARIABLE_REFERENCE, transforms_from - -privacy_hub = "firefox/privacy-hub.lang" - - -def migrate(ctx): - """Migrate bedrock/firefox/templates/firefox/privacy/base.html, part {index}.""" - - ctx.add_transforms( - "firefox/privacy-hub.ftl", - "firefox/privacy-hub.ftl", - [ - FTL.Message( - id=FTL.Identifier("firefox-privacy-hub-firefox-privacy-promise"), - value=REPLACE( - privacy_hub, - "Firefox Privacy Promise", - { - "Firefox": TERM_REFERENCE("brand-name-firefox"), - }, - ), - ), - FTL.Message( - id=FTL.Identifier("firefox-privacy-hub-firefox-takes-less-data-keeps"), - value=REPLACE( - privacy_hub, - "Firefox takes less data, keeps it safe, and with no secrets.", - { - "Firefox": TERM_REFERENCE("brand-name-firefox"), - }, - ), - ), - FTL.Message( - id=FTL.Identifier("firefox-privacy-hub-firefox-products-are-designed"), - value=REPLACE( - privacy_hub, - "Firefox products are designed to protect your privacy", - { - "Firefox": TERM_REFERENCE("brand-name-firefox"), - }, - ), - ), - ] - + transforms_from( - """ -firefox-privacy-privacy = {COPY(privacy_hub, "Privacy",)} -firefox-privacy-our-promise = {COPY(privacy_hub, "Our Promise",)} -firefox-privacy-our-products = {COPY(privacy_hub, "Our Products",)} -firefox-privacy-hub-you-should-be-able-to-decide = {COPY(privacy_hub, "You should be able to decide who sees your personal info. Not just among your friends, but with every advertiser and company on the internet — including us.",)} -firefox-privacy-hub-thats-why-everything-we-make = {COPY(privacy_hub, "That’s why everything we make and do honors our Personal Data Promise",)} -firefox-privacy-hub-take-less = {COPY(privacy_hub, "Take Less",)} -firefox-privacy-hub-we-make-a-point-of-knowing = {COPY(privacy_hub, "We make a point of knowing less about you",)} -firefox-privacy-hub-all-tech-companies-collect = {COPY(privacy_hub, "All tech companies collect data to improve their products. But it doesn’t need to include so much of your personal info. The only data we want is the data that serves you in the end. We ask ourselves: do we actually need this? What do we need it for? And when can we delete it?",)} -firefox-privacy-hub-keep-it-safe = {COPY(privacy_hub, "Keep it safe",)} -firefox-privacy-hub-we-do-the-hard-work-to-protect = {COPY(privacy_hub, "We do the hard work to protect your personal info",)} -firefox-privacy-hub-data-security-is-complicated = {COPY(privacy_hub, "Data security is complicated — or at least it should be. Which is why we take the extra steps to classify the data we have, maintain rules for how we store and protect each type, and never stop iterating on our processes. We prioritize your privacy. We invest in it. We’re committed to it. We even teach other companies how to do it.",)} -firefox-privacy-hub-no-secrets = {COPY(privacy_hub, "No secrets",)} -firefox-privacy-hub-youll-always-know-where-you = {COPY(privacy_hub, "You’ll always know where you stand with us",)} -""", - privacy_hub=privacy_hub, - ) - + [ - FTL.Message( - id=FTL.Identifier("firefox-privacy-hub-theres-no-hidden-agenda-here"), - value=REPLACE( - privacy_hub, - 'There’s no hidden agenda here. Our business doesn’t depend on secretly abusing your trust. Our Privacy Notice is actually readable. Anyone in the world can attend our weekly company meetings. If you want to dig into every datapoint we collect, our code is open. And so are we.', - { - "%%": "%", - "%(privacy)s": VARIABLE_REFERENCE("privacy"), - "%(meetings)s": VARIABLE_REFERENCE("meetings"), - }, - ), - ), - FTL.Message( - id=FTL.Identifier("firefox-privacy-hub-why-trust-firefox"), - value=REPLACE( - privacy_hub, - "Why trust Firefox?", - { - "Firefox": TERM_REFERENCE("brand-name-firefox"), - }, - ), - ), - FTL.Message( - id=FTL.Identifier("firefox-privacy-hub-because-we-put-people-first"), - value=REPLACE( - privacy_hub, - 'Because we put people first. In fact, we’re backed by a non-profit. From day one, it’s been our mission to protect the internet and everyone on it', - { - "%%": "%", - "%(foundation)s": VARIABLE_REFERENCE("foundation"), - }, - ), - ), - ] - + transforms_from( - """ -firefox-privacy-hub-learn-more-about-our-mission = {COPY(privacy_hub, "Learn more about our mission",)} -firefox-privacy-hub-your-privacy-by-the-product = {COPY(privacy_hub, "Your privacy, by the product",)} -""", - privacy_hub=privacy_hub, - ) - + [ - FTL.Message( - id=FTL.Identifier("firefox-privacy-hub-firefox-products-work-differently"), - value=REPLACE( - privacy_hub, - "Firefox products work differently — because they’re designed to protect your privacy first.", - { - "Firefox": TERM_REFERENCE("brand-name-firefox"), - }, - ), - ), - ] - + transforms_from( - """ -firefox-privacy-hub-learn-about-our-products = {COPY(privacy_hub, "Learn about our products",)} -""", - privacy_hub=privacy_hub, - ) - + [ - FTL.Message( - id=FTL.Identifier("firefox-privacy-hub-firefox-privacy-by-the"), - value=REPLACE( - privacy_hub, - "Firefox privacy, by the product", - { - "Firefox": TERM_REFERENCE("brand-name-firefox"), - }, - ), - ), - FTL.Message( - id=FTL.Identifier("firefox-privacy-hub-firefox-protects-your-privacy"), - value=REPLACE( - privacy_hub, - "Firefox protects your privacy in every product.", - { - "Firefox": TERM_REFERENCE("brand-name-firefox"), - }, - ), - ), - FTL.Message( - id=FTL.Identifier("firefox-privacy-hub-firefox-protects-your-privacy-strong"), - value=REPLACE( - privacy_hub, - "Firefox protects your privacy in every product", - { - "Firefox": TERM_REFERENCE("brand-name-firefox"), - }, - ), - ), - ] - + transforms_from( - """ -firefox-privacy-hub-firefox-browser = { -brand-name-firefox-browser } -firefox-privacy-hub-2000-trackers-blocked-automatically = {COPY(privacy_hub, "2,000+ trackers blocked — automatically",)} -""", - privacy_hub=privacy_hub, - ) - + [ - FTL.Message( - id=FTL.Identifier("firefox-privacy-hub-tracking-has-become-an"), - value=REPLACE( - privacy_hub, - "Tracking has become an epidemic online: companies follow every move, click and purchase, collecting data to predict and influence what you’ll do next. We think that’s a gross invasion of your privacy. That’s why Firefox mobile and desktop browsers have Enhanced Tracking Protection on by default.", - { - "Firefox": TERM_REFERENCE("brand-name-firefox"), - }, - ), - ), - FTL.Message( - id=FTL.Identifier("firefox-privacy-hub-if-you-want-to-see-what"), - value=REPLACE( - privacy_hub, - "If you want to see what Firefox is blocking for you, visit this page on your Firefox desktop browser.", - { - "Firefox": TERM_REFERENCE("brand-name-firefox"), - }, - ), - ), - FTL.Message( - id=FTL.Identifier("firefox-privacy-hub-see-what-firefox-has-blocked"), - value=REPLACE( - privacy_hub, - "See what Firefox has blocked for you", - { - "Firefox": TERM_REFERENCE("brand-name-firefox"), - }, - ), - ), - ] - + transforms_from( - """ -firefox-privacy-hub-get-enhanced-tracking-protection = {COPY(privacy_hub, "Get Enhanced Tracking Protection",)} -""", - privacy_hub=privacy_hub, - ) - + [ - FTL.Message( - id=FTL.Identifier("firefox-privacy-hub-download-the-firefox-browser"), - value=REPLACE( - privacy_hub, - "Download the Firefox browser", - { - "Firefox": TERM_REFERENCE("brand-name-firefox"), - }, - ), - ), - FTL.Message( - id=FTL.Identifier("firefox-privacy-hub-update-your-firefox-browser"), - value=REPLACE( - privacy_hub, - "Update your Firefox browser", - { - "Firefox": TERM_REFERENCE("brand-name-firefox"), - }, - ), - ), - ] - + transforms_from( - """ -firefox-privacy-hub-invisible-to-the-top-trackers = {COPY(privacy_hub, "Invisible to the top trackers",)} -firefox-privacy-hub-meet-four-of-the-most-common = {COPY(privacy_hub, "Meet four of the most common categories of trackers — who won’t meet you.",)} -firefox-privacy-hub-always-in-your-control = {COPY(privacy_hub, "Always in your control",)} -firefox-privacy-hub-want-to-customize-what = {COPY(privacy_hub, "Want to customize what gets blocked? Your settings are only one click away.",)} -firefox-privacy-hub-protection-beyond-tracking = {COPY(privacy_hub, "Protection beyond tracking",)} -""", - privacy_hub=privacy_hub, - ) - + [ - FTL.Message( - id=FTL.Identifier("firefox-privacy-hub-if-you-have-a-firefox-account"), - value=REPLACE( - privacy_hub, - "If you have a Firefox account, you can also see how we’re helping you protect your personal info and passwords.", - { - "Firefox account": TERM_REFERENCE("brand-name-firefox-account"), - "Firefox Account": TERM_REFERENCE("brand-name-firefox-account"), - }, - ), - ), - FTL.Message( - id=FTL.Identifier("firefox-privacy-hub-more-than-s-trackers-blocked"), - value=REPLACE( - privacy_hub, - "More than %s trackers blocked each day for Firefox users worldwide", - { - "%%": "%", - "%s": VARIABLE_REFERENCE("trackers"), - "Firefox": TERM_REFERENCE("brand-name-firefox"), - }, - ), - ), - ] - + transforms_from( - """ -firefox-privacy-hub-firefox-monitor = { -brand-name-firefox-monitor } -""", - privacy_hub=privacy_hub, - ) - + [ - FTL.Message( - id=FTL.Identifier("firefox-privacy-hub-when-you-enter-your-email"), - value=REPLACE( - privacy_hub, - "When you enter your email address in Firefox Monitor, we forget it immediately after we’ve checked for a match in known data breaches — unless you authorize us to continue monitoring new breaches for your personal information.", - { - "Firefox Monitor": TERM_REFERENCE("brand-name-firefox-monitor"), - }, - ), - ), - ] - + transforms_from( - """ -firefox-privacy-hub-check-for-breaches = {COPY(privacy_hub, "Check for breaches",)} -firefox-privacy-hub-firefox-lockwise = { -brand-name-firefox-lockwise } -""", - privacy_hub=privacy_hub, - ) - + [ - FTL.Message( - id=FTL.Identifier("firefox-privacy-hub-the-passwords-and-credentials"), - value=REPLACE( - privacy_hub, - "The passwords and credentials you save in Firefox Lockwise are encrypted on all your devices, so not even we can see them.", - { - "Firefox Lockwise": TERM_REFERENCE("brand-name-firefox-lockwise"), - }, - ), - ), - FTL.Message( - id=FTL.Identifier("firefox-privacy-hub-learn-more-about-lockwise"), - value=REPLACE( - privacy_hub, - "Learn more about Lockwise", - { - "Lockwise": TERM_REFERENCE("brand-name-lockwise"), - }, - ), - ), - ] - + transforms_from( - """ -firefox-privacy-hub-firefox-send = { -brand-name-firefox-send } -""", - privacy_hub=privacy_hub, - ) - + [ - FTL.Message( - id=FTL.Identifier("firefox-privacy-hub-we-cant-see-the-names-or"), - value=REPLACE( - privacy_hub, - "We can’t see the names or content of the large files you share through Firefox Send because they’re encrypted end-to-end — you choose who sees what you send, and you can even set an expiration date and password.", - { - "Firefox Send": TERM_REFERENCE("brand-name-firefox-send"), - }, - ), - ), - ] - + transforms_from( - """ -firefox-privacy-hub-send-a-file = {COPY(privacy_hub, "Send a file",)} -firefox-privacy-hub-pocket = { -brand-name-pocket } -""", - privacy_hub=privacy_hub, - ) - + [ - FTL.Message( - id=FTL.Identifier("firefox-privacy-hub-pocket-recommends-high"), - value=REPLACE( - privacy_hub, - "Pocket recommends high-quality, human-curated articles without collecting your browsing history or sharing your personal information with advertisers.", - { - "Pocket": TERM_REFERENCE("brand-name-pocket"), - }, - ), - ), - FTL.Message( - id=FTL.Identifier("firefox-privacy-hub-get-pocket"), - value=REPLACE( - privacy_hub, - "Get Pocket", - { - "Pocket": TERM_REFERENCE("brand-name-pocket"), - }, - ), - ), - FTL.Message( - id=FTL.Identifier("firefox-privacy-hub-your-firefox-account"), - value=REPLACE( - privacy_hub, - "Your Firefox account", - { - "Firefox account": TERM_REFERENCE("brand-name-firefox-account"), - "Firefox Account": TERM_REFERENCE("brand-name-firefox-account"), - }, - ), - ), - FTL.Message( - id=FTL.Identifier("firefox-privacy-hub-all-the-information-synced"), - value=REPLACE( - privacy_hub, - "All the information synced through your Firefox account — from browser history to passwords — is encrypted. And your account password is the only key.", - { - "Firefox account": TERM_REFERENCE("brand-name-firefox-account"), - "Firefox Account": TERM_REFERENCE("brand-name-firefox-account"), - }, - ), - ), - FTL.Message( - id=FTL.Identifier("firefox-privacy-hub-take-your-privacy-and-bookmarks"), - value=REPLACE( - privacy_hub, - "Take your privacy and bookmarks everywhere with a Firefox account.", - { - "Firefox account": TERM_REFERENCE("brand-name-firefox-account"), - "Firefox Account": TERM_REFERENCE("brand-name-firefox-account"), - }, - ), - ), - FTL.Message( - id=FTL.Identifier("firefox-privacy-hub-already-have-an-account"), - value=REPLACE( - privacy_hub, - 'Already have an account? Sign In or learn more about joining Firefox.', - { - "%%": "%", - "%(sign_in)s": VARIABLE_REFERENCE("sign_in"), - "%(class_name)s": VARIABLE_REFERENCE("class_name"), - "%(learn_more)s": VARIABLE_REFERENCE("learn_more"), - "Firefox": TERM_REFERENCE("brand-name-firefox"), - }, - ), - ), - FTL.Message( - id=FTL.Identifier("firefox-privacy-hub-read-the-privacy-notice-for"), - value=REPLACE( - privacy_hub, - 'Read the Privacy Notice for our products', - { - "%%": "%", - "%s": VARIABLE_REFERENCE("url"), - }, - ), - ), - ], - ) diff --git a/lib/fluent_migrations/firefox/products/__init__.py b/lib/fluent_migrations/firefox/products/__init__.py deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/lib/fluent_migrations/firefox/products/index.py b/lib/fluent_migrations/firefox/products/index.py deleted file mode 100644 index 7112b24618..0000000000 --- a/lib/fluent_migrations/firefox/products/index.py +++ /dev/null @@ -1,175 +0,0 @@ -from __future__ import absolute_import - -import fluent.syntax.ast as FTL -from fluent.migrate import COPY, REPLACE -from fluent.migrate.helpers import TERM_REFERENCE, VARIABLE_REFERENCE, transforms_from - -products = "firefox/products.lang" - - -def migrate(ctx): - """Migrate bedrock/firefox/templates/firefox/products/index.html, part {index}.""" - - ctx.add_transforms( - "firefox/products.ftl", - "firefox/products.ftl", - [ - FTL.Message( - id=FTL.Identifier("firefox-products-firefox-is-more-than-a-browser"), - value=REPLACE( - products, - "Firefox is more than a browser", - { - "Firefox": TERM_REFERENCE("brand-name-firefox"), - }, - ), - ), - ] - + transforms_from( - """ -firefox-products-its-a-whole-family-of-products = {COPY(products, "It’s a whole family of products designed to keep you safer and smarter online.",)} -""", - products=products, - ) - + [ - FTL.Message( - id=FTL.Identifier("firefox-products-firefox-is-more-than-a-browser-emphasis"), - value=REPLACE( - products, - "Firefox is more than a browser", - { - "Firefox": TERM_REFERENCE("brand-name-firefox"), - }, - ), - ), - ] - + transforms_from( - """ -firefox-products-firefox-monitor = { -brand-name-firefox-monitor } -firefox-products-see-if-your-personal-information = {COPY(products, "See if your personal information has been compromised in a corporate data breach, and sign up for future alerts.",)} -firefox-products-check-for-breaches = {COPY(products, "Check for breaches",)} -firefox-products-sign-up-for-breach-alerts = {COPY(products, "Sign up for breach alerts",)} -""", - products=products, - ) - + [ - FTL.Message( - id=FTL.Identifier("firefox-products-firefox-browsers"), - value=REPLACE( - products, - "Firefox browsers", - { - "Firefox": TERM_REFERENCE("brand-name-firefox"), - }, - ), - ), - FTL.Message( - id=FTL.Identifier("firefox-products-get-the-browsers-that-block"), - value=REPLACE( - products, - "Get the browsers that block 2000+ data trackers automatically. Enhanced Tracking Protection comes standard in every Firefox browser.", - { - "Firefox": TERM_REFERENCE("brand-name-firefox"), - }, - ), - ), - ] - + transforms_from( - """ -firefox-products-desktop = {COPY(products, "Desktop",)} -firefox-products-android = { -brand-name-android } -firefox-products-ios = { -brand-name-ios } -firefox-products-see-all-browsers = {COPY(products, "See all browsers",)} -firefox-products-firefox-lockwise = { -brand-name-firefox-lockwise } -firefox-products-keep-your-passwords-safe-and = {COPY(products, "Keep your passwords safe, and access them across all your synced devices.",)} -""", - products=products, - ) - + [ - FTL.Message( - id=FTL.Identifier("firefox-products-download-lockwise"), - value=REPLACE( - products, - "Download Lockwise", - { - "Lockwise": TERM_REFERENCE("brand-name-lockwise"), - }, - ), - ), - FTL.Message( - id=FTL.Identifier("firefox-products-open-in-firefox"), - value=REPLACE( - products, - "Open in Firefox", - { - "Firefox": TERM_REFERENCE("brand-name-firefox"), - }, - ), - ), - FTL.Message( - id=FTL.Identifier("firefox-products-learn-more-about-lockwise"), - value=REPLACE( - products, - "Learn more about Lockwise", - { - "Lockwise": TERM_REFERENCE("brand-name-lockwise"), - }, - ), - ), - ] - + transforms_from( - """ -firefox-products-firefox-send = { -brand-name-firefox-send } -firefox-products-send-your-large-files-and = {COPY(products, "Send your large files and sensitive documents safely, up to 2.5G.",)} -firefox-products-send-a-file = {COPY(products, "Send a file",)} -firefox-products-pocket = { -brand-name-pocket } -firefox-products-discover-the-best-content = {COPY(products, "Discover the best content on the web — and consume it wherever and whenever you want.",)} -""", - products=products, - ) - + [ - FTL.Message( - id=FTL.Identifier("firefox-products-get-pocket"), - value=REPLACE( - products, - "Get Pocket", - { - "Pocket": TERM_REFERENCE("brand-name-pocket"), - }, - ), - ), - FTL.Message( - id=FTL.Identifier("firefox-products-learn-more-about-pocket"), - value=REPLACE( - products, - "Learn more about Pocket", - { - "Pocket": TERM_REFERENCE("brand-name-pocket"), - }, - ), - ), - FTL.Message( - id=FTL.Identifier("firefox-products-join-firefox-and-get-the-most"), - value=REPLACE( - products, - "Join Firefox and get the most out of every product — across every device.", - { - "Firefox": TERM_REFERENCE("brand-name-firefox"), - }, - ), - ), - FTL.Message( - id=FTL.Identifier("firefox-products-already-have-an-account-sign"), - value=REPLACE( - products, - "Already have an account? Sign In or learn more about joining Firefox.", - { - "%%": "%", - "%(fxa_attr)s": VARIABLE_REFERENCE("fxa_attr"), - "%(accounts_attr)s": VARIABLE_REFERENCE("accounts_attr"), - "Firefox": TERM_REFERENCE("brand-name-firefox"), - }, - ), - ), - ], - ) diff --git a/lib/fluent_migrations/firefox/retention/__init__.py b/lib/fluent_migrations/firefox/retention/__init__.py deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/lib/fluent_migrations/firefox/retention/thank-you.py b/lib/fluent_migrations/firefox/retention/thank-you.py deleted file mode 100644 index 93cf97c556..0000000000 --- a/lib/fluent_migrations/firefox/retention/thank-you.py +++ /dev/null @@ -1,133 +0,0 @@ -from __future__ import absolute_import - -import fluent.syntax.ast as FTL -from fluent.migrate import COPY, REPLACE -from fluent.migrate.helpers import TERM_REFERENCE, VARIABLE_REFERENCE, transforms_from - -thank_you = "firefox/retention/thank-you.lang" - - -def migrate(ctx): - """Migrate bedrock/firefox/templates/firefox/retention/thank-you.html, part {index}.""" - - ctx.add_transforms( - "firefox/retention/thank-you.ftl", - "firefox/retention/thank-you.ftl", - transforms_from( - """ -thank-you-thank-you = {COPY(thank_you, "Thank You",)} -thank-you-thank-you-page = {COPY(thank_you, "Thank you page.",)} -thank-you-its-all-thanks-to-you = {COPY(thank_you, "It’s all thanks to you",)} -""", - thank_you=thank_you, - ) - + [ - FTL.Message( - id=FTL.Identifier("thank-you-choosing-firefox-helps"), - value=REPLACE( - thank_you, - "Choosing Firefox helps Mozilla make the Internet a better place. Here’s what you can do next:", - { - "Mozilla": TERM_REFERENCE("brand-name-mozilla"), - "Firefox": TERM_REFERENCE("brand-name-firefox"), - }, - ), - ), - FTL.Message( - id=FTL.Identifier("thank-you-make-firefox-your-default"), - value=REPLACE( - thank_you, - "Make Firefox your default browser", - { - "Firefox": TERM_REFERENCE("brand-name-firefox"), - }, - ), - ), - ] - + transforms_from( - """ -thank-you-1-min-action = {COPY(thank_you, "1 min action",)} -thank-you-set-as-your-default = {COPY(thank_you, "Set as your default",)} -""", - thank_you=thank_you, - ) - + [ - FTL.Message( - id=FTL.Identifier("thank-you-get-firefox-on-your-phone"), - value=REPLACE( - thank_you, - "Get Firefox on your phone", - { - "Firefox": TERM_REFERENCE("brand-name-firefox"), - }, - ), - ), - ] - + transforms_from( - """ -thank-you-2-min-install = {COPY(thank_you, "2 min install",)} -""", - thank_you=thank_you, - ) - + [ - FTL.Message( - id=FTL.Identifier("thank-you-download-firefox"), - value=REPLACE( - thank_you, - "Download Firefox", - { - "Firefox": TERM_REFERENCE("brand-name-firefox"), - }, - ), - ), - FTL.Message( - id=FTL.Identifier("thank-you-tell-your-friends-about"), - value=REPLACE( - thank_you, - "Tell your friends about Firefox", - { - "Firefox": TERM_REFERENCE("brand-name-firefox"), - }, - ), - ), - ] - + transforms_from( - """ -thank-you-1-min-share = {COPY(thank_you, "1 min share",)} -""", - thank_you=thank_you, - ) - + [ - FTL.Message( - id=FTL.Identifier("thank-you-join-me-in-the-fight-for"), - value=REPLACE( - thank_you, - "Join me in the fight for an open web by choosing Firefox!", - { - "Firefox": TERM_REFERENCE("brand-name-firefox"), - }, - ), - ), - ] - + transforms_from( - """ -thank-you-send-a-tweet = {COPY(thank_you, "Send a tweet",)} -thank-you-make-the-internet-a-safer = {COPY(thank_you, "Make the Internet a safer place",)} -thank-you-4-min-read = {COPY(thank_you, "4 min read",)} -thank-you-stay-in-touch-for-more = {COPY(thank_you, "Stay in touch for more cool stuff",)} -""", - thank_you=thank_you, - ) - + [ - FTL.Message( - id=FTL.Identifier("thank-you-get-the-latest-greatest"), - value=REPLACE( - thank_you, - "Get the latest & greatest from Firefox delivered straight to your inbox.", - { - "Firefox": TERM_REFERENCE("brand-name-firefox"), - }, - ), - ), - ], - ) diff --git a/lib/fluent_migrations/firefox/send-to-device.py b/lib/fluent_migrations/firefox/send-to-device.py deleted file mode 100644 index f66a84b619..0000000000 --- a/lib/fluent_migrations/firefox/send-to-device.py +++ /dev/null @@ -1,54 +0,0 @@ -from __future__ import absolute_import - -import fluent.syntax.ast as FTL -from fluent.migrate import COPY, REPLACE -from fluent.migrate.helpers import TERM_REFERENCE, VARIABLE_REFERENCE, transforms_from - -send_to = "firefox/sendto.lang" - - -def migrate(ctx): - """Migrate bedrock/base/templates/macros.html, part {index}.""" - - ctx.add_transforms( - "send_to_device.ftl", - "send_to_device.ftl", - [ - FTL.Message( - id=FTL.Identifier("send-to-device-send-firefox"), - value=REPLACE( - "firefox/sendto.lang", - "Send Firefox to your smartphone or tablet", - { - "Firefox": TERM_REFERENCE("brand-name-firefox"), - }, - ), - ), - ], - ) - - ctx.add_transforms( - "send_to_device.ftl", - "send_to_device.ftl", - transforms_from( - """ -send-to-device-your-download-link = {COPY(send_to, "Your download link was sent.",)} -send-to-device-sorry-we-cant-send = {COPY(send_to, "Sorry, we can’t send SMS messages to this phone number.",)} -send-to-device-sorry-this-number = {COPY(send_to, "Sorry. This number isn’t valid. Please enter a U.S. phone number.",)} -send-to-device-please-enter-an-email = {COPY(send_to, "Please enter an email address.",)} -send-to-device-an-error-occured = {COPY(send_to, "An error occurred in our system. Please try again later.",)} -send-to-device-enter-your-email = {COPY(send_to, "Enter your email",)} -send-to-device-enter-your-email-or-phone = {COPY(send_to, "Enter your email or phone number",)} -send-to-device-enter-your-email-or-phone-10-digit = {COPY(send_to, "Enter your email or 10-digit phone number",)} -send-to-device-send = {COPY(send_to, "Send",)} -send-to-device-sms-service-available-in-select = {COPY(send_to, "SMS service available in select countries only. SMS & data rates may apply.",)} -send-to-device-sms-service-available-to-us = {COPY(send_to, "SMS service available to U.S. phone numbers only. SMS & data rates may apply.",)} -send-to-device-intended-recipient-email-sms = {COPY(send_to, "The intended recipient of the email or SMS must have consented.",)} -send-to-device-intended-recipient-email = {COPY(send_to, "The intended recipient of the email must have consented.",)} -send-to-device-check-your-device-email-sms = {COPY(send_to, "Check your device for the email or text message!",)} -send-to-device-check-your-device-email = {COPY(send_to, "Check your device for the email!",)} -send-to-device-send-to-another= {COPY(send_to, "Send to another device",)} -""", - send_to=send_to, - ), - ) diff --git a/lib/fluent_migrations/firefox/set-as-default/__init__.py b/lib/fluent_migrations/firefox/set-as-default/__init__.py deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/lib/fluent_migrations/firefox/set-as-default/landing.py b/lib/fluent_migrations/firefox/set-as-default/landing.py deleted file mode 100644 index f8b1f1e89a..0000000000 --- a/lib/fluent_migrations/firefox/set-as-default/landing.py +++ /dev/null @@ -1,146 +0,0 @@ -from __future__ import absolute_import - -import fluent.syntax.ast as FTL -from fluent.migrate import COPY, REPLACE -from fluent.migrate.helpers import TERM_REFERENCE, VARIABLE_REFERENCE, transforms_from - -whatsnew_73 = "firefox/whatsnew_73.lang" - - -def migrate(ctx): - """Migrate bedrock/firefox/templates/firefox/set-as-default/landing-page.html, part {index}.""" - - ctx.add_transforms( - "firefox/set-as-default/landing.ftl", - "firefox/set-as-default/landing.ftl", - [ - FTL.Message( - id=FTL.Identifier("set-as-default-landing-make-firefox-your-default"), - value=REPLACE( - whatsnew_73, - "Make Firefox your default browser", - { - "Firefox": TERM_REFERENCE("brand-name-firefox"), - }, - ), - ), - ] - + transforms_from( - """ -set-as-default-landing-make-sure-youre-protected = {COPY(whatsnew_73, "Make sure you’re protected, every time you get online",)} -""", - whatsnew_73=whatsnew_73, - ) - + [ - FTL.Message( - id=FTL.Identifier("set-as-default-landing-thanks-for-using-the"), - value=REPLACE( - whatsnew_73, - "Thanks for using the latest Firefox browser. When you choose Firefox, you support a better web for you and everyone else. Now take the next step to protect yourself.", - { - "Firefox": TERM_REFERENCE("brand-name-firefox"), - }, - ), - ), - ] - + transforms_from( - """ -set-as-default-landing-choose-automatic-privacy = {COPY(whatsnew_73, "Choose automatic privacy",)} -""", - whatsnew_73=whatsnew_73, - ) - + [ - FTL.Message( - id=FTL.Identifier("set-as-default-landing-companies-keep-finding"), - value=REPLACE( - whatsnew_73, - "Companies keep finding new ways to poach your personal data. Firefox is the browser with a mission of finding new ways to protect you.", - { - "Firefox": TERM_REFERENCE("brand-name-firefox"), - }, - ), - ), - ] - + transforms_from( - """ -set-as-default-landing-choose-freedom-on-every = {COPY(whatsnew_73, "Choose freedom on every device",)} -""", - whatsnew_73=whatsnew_73, - ) - + [ - FTL.Message( - id=FTL.Identifier("set-as-default-landing-firefox-is-fast-and"), - value=REPLACE( - whatsnew_73, - "Firefox is fast and safe on Windows, iOS, Android, Linux…and across them all. You deserve choices in browsers and devices, instead of decisions made for you.", - { - "Firefox": TERM_REFERENCE("brand-name-firefox"), - "Windows": TERM_REFERENCE("brand-name-windows"), - "iOS": TERM_REFERENCE("brand-name-ios"), - "Android": TERM_REFERENCE("brand-name-android"), - "Linux": TERM_REFERENCE("brand-name-linux"), - }, - ), - ), - ] - + transforms_from( - """ -set-as-default-landing-choose-corporate-independence = {COPY(whatsnew_73, "Choose corporate independence",)} -""", - whatsnew_73=whatsnew_73, - ) - + [ - FTL.Message( - id=FTL.Identifier("set-as-default-landing-firefox-is-the-only"), - value=REPLACE( - whatsnew_73, - "Firefox is the only major independent browser. Chrome, Edge and Brave are all built on Google code, which means giving Google even more control of the internet.", - { - "Firefox": TERM_REFERENCE("brand-name-firefox"), - "Chrome": TERM_REFERENCE("brand-name-chrome"), - "Edge": TERM_REFERENCE("brand-name-edge"), - "Brave": TERM_REFERENCE("brand-name-brave"), - "Google": TERM_REFERENCE("brand-name-google"), - }, - ), - ), - FTL.Message( - id=FTL.Identifier("set-as-default-landing-the-internet-keeps"), - value=REPLACE( - whatsnew_73, - "The internet keeps finding new ways to poach your personal data. Firefox is the only browser with a mission of finding new ways to protect you.", - { - "Firefox": TERM_REFERENCE("brand-name-firefox"), - }, - ), - ), - FTL.Message( - id=FTL.Identifier("set-as-default-landing-firefox-is-fast-no-interest"), - value=REPLACE( - whatsnew_73, - "Firefox is fast and safe on Windows, iOS, Android, Linux...and across them all. We have no interest in locking you in or resetting your preferences.", - { - "Firefox": TERM_REFERENCE("brand-name-firefox"), - "Windows": TERM_REFERENCE("brand-name-windows"), - "iOS": TERM_REFERENCE("brand-name-ios"), - "Android": TERM_REFERENCE("brand-name-android"), - "Linux": TERM_REFERENCE("brand-name-linux"), - }, - ), - ), - FTL.Message( - id=FTL.Identifier("set-as-default-landing-firefox-is-the-only-major"), - value=REPLACE( - whatsnew_73, - "Firefox is the only major independent browser. Chrome, Edge and Brave are all built with code from Google, the world’s largest ad network.", - { - "Firefox": TERM_REFERENCE("brand-name-firefox"), - "Chrome": TERM_REFERENCE("brand-name-chrome"), - "Edge": TERM_REFERENCE("brand-name-edge"), - "Brave": TERM_REFERENCE("brand-name-brave"), - "Google": TERM_REFERENCE("brand-name-google"), - }, - ), - ), - ], - ) diff --git a/lib/fluent_migrations/firefox/set-as-default/thanks.py b/lib/fluent_migrations/firefox/set-as-default/thanks.py deleted file mode 100644 index d567a417e8..0000000000 --- a/lib/fluent_migrations/firefox/set-as-default/thanks.py +++ /dev/null @@ -1,147 +0,0 @@ -from __future__ import absolute_import - -import fluent.syntax.ast as FTL -from fluent.migrate import COPY, REPLACE -from fluent.migrate.helpers import TERM_REFERENCE, VARIABLE_REFERENCE, transforms_from - -set_default_thanks = "firefox/set-default-thanks.lang" - - -def migrate(ctx): - """Migrate bedrock/firefox/templates/firefox/set-as-default/thanks.html, part {index}.""" - - ctx.add_transforms( - "firefox/set-as-default/thanks.ftl", - "firefox/set-as-default/thanks.ftl", - [ - FTL.Message( - id=FTL.Identifier("set-as-default-thanks-set-as-default-thanks-for-choosing-firefox"), - value=REPLACE( - set_default_thanks, - "Thanks for choosing Firefox", - { - "Firefox": TERM_REFERENCE("brand-name-firefox"), - }, - ), - ), - FTL.Message( - id=FTL.Identifier("set-as-default-thanks-success-your-default-browser"), - value=REPLACE( - set_default_thanks, - "Success! Your default browser is set to Firefox.", - { - "Firefox": TERM_REFERENCE("brand-name-firefox"), - }, - ), - ), - FTL.Message( - id=FTL.Identifier("set-as-default-thanks-looks-like-youre-using-a"), - value=REPLACE( - set_default_thanks, - "Looks like you’re using a different browser right now. Make sure you have Firefox downloaded on your device.", - { - "Firefox": TERM_REFERENCE("brand-name-firefox"), - }, - ), - ), - FTL.Message( - id=FTL.Identifier("set-as-default-thanks-youre-almost-done-just-change"), - value=REPLACE( - set_default_thanks, - "You’re almost done. Just change your default browser to Firefox in the settings panel on your screen.", - { - "Firefox": TERM_REFERENCE("brand-name-firefox"), - }, - ), - ), - ] - + transforms_from( - """ -set-as-default-thanks-having-trouble-setting-your = {COPY(set_default_thanks, "Having trouble setting your default browser?",)} -""", - set_default_thanks=set_default_thanks, - ) - + [ - FTL.Message( - id=FTL.Identifier("set-as-default-thanks-heres-everything-you-need-android"), - value=REPLACE( - set_default_thanks, - 'Here’s everything you need to know about setting your default browser on Android devices.', - { - "%%": "%", - "%(android)s": VARIABLE_REFERENCE("android"), - }, - ), - ), - FTL.Message( - id=FTL.Identifier("set-as-default-thanks-heres-everything-you-need-ios"), - value=REPLACE( - set_default_thanks, - 'Here’s everything you need to know about setting your default browser on iOS devices.', - { - "%%": "%", - "%(ios)s": VARIABLE_REFERENCE("ios"), - }, - ), - ), - ] - + transforms_from( - """ -set-as-default-thanks-youre-all-set = {COPY(set_default_thanks, "You’re all set.",)} -""", - set_default_thanks=set_default_thanks, - ) - + [ - FTL.Message( - id=FTL.Identifier("set-as-default-thanks-get-firefox-for-mobile"), - value=REPLACE( - set_default_thanks, - "Get Firefox for mobile", - { - "Firefox": TERM_REFERENCE("brand-name-firefox"), - }, - ), - ), - ] - + transforms_from( - """ -set-as-default-thanks-travel-the-internet-with = {COPY(set_default_thanks, "Travel the internet with protection on all your devices.",)} -set-as-default-thanks-download-the-app = {COPY(set_default_thanks, "Download the app",)} -""", - set_default_thanks=set_default_thanks, - ) - + [ - FTL.Message( - id=FTL.Identifier("set-as-default-thanks-join-firefox"), - value=REPLACE( - set_default_thanks, - "Join Firefox", - { - "Firefox": TERM_REFERENCE("brand-name-firefox"), - }, - ), - ), - ] - + transforms_from( - """ -set-as-default-thanks-sign-up-for-a-free-account = {COPY(set_default_thanks, "Sign up for a free account and sync all your passwords, browsing history, and preferences across your devices.",)} -set-as-default-thanks-get-an-account = {COPY(set_default_thanks, "Get an Account",)} -set-as-default-thanks-having-trouble = {COPY(set_default_thanks, "Having trouble?",)} -""", - set_default_thanks=set_default_thanks, - ) - + [ - FTL.Message( - id=FTL.Identifier("set-as-default-thanks-heres-everything-you-need-android-desktop"), - value=REPLACE( - set_default_thanks, - 'Here’s everything you need to know about setting your default browser on Android devices or desktop computers.', - { - "%%": "%", - "%(android)s": VARIABLE_REFERENCE("android"), - "%(desktop)s": VARIABLE_REFERENCE("desktop"), - }, - ), - ), - ], - ) diff --git a/lib/fluent_migrations/firefox/switch.py b/lib/fluent_migrations/firefox/switch.py deleted file mode 100644 index 13e908eb92..0000000000 --- a/lib/fluent_migrations/firefox/switch.py +++ /dev/null @@ -1,107 +0,0 @@ -from __future__ import absolute_import - -import fluent.syntax.ast as FTL -from fluent.migrate import COPY, REPLACE -from fluent.migrate.helpers import TERM_REFERENCE, VARIABLE_REFERENCE, transforms_from - -switch = "firefox/switch.lang" - - -def migrate(ctx): - """Migrate bedrock/firefox/templates/firefox/switch.html, part {index}.""" - - ctx.add_transforms( - "firefox/switch.ftl", - "firefox/switch.ftl", - [ - FTL.Message( - id=FTL.Identifier("switch-switch-from-chrome"), - value=REPLACE( - "firefox/switch.lang", - "Switch from Chrome to Firefox in just a few minutes", - {"Firefox": TERM_REFERENCE("brand-name-firefox"), "Chrome": TERM_REFERENCE("brand-name-chrome")}, - ), - ), - FTL.Message( - id=FTL.Identifier("switch-switching-to-firefox-is-fast"), - value=REPLACE( - "firefox/switch.lang", - "Switching to Firefox is fast, easy and risk-free, because Firefox imports your bookmarks, autofills, passwords and preferences from Chrome.", - {"Firefox": TERM_REFERENCE("brand-name-firefox"), "Chrome": TERM_REFERENCE("brand-name-chrome")}, - ), - ), - FTL.Message( - id=FTL.Identifier("switch-switching-to-firefox-page-description"), - value=REPLACE( - "firefox/switch.lang", - "Switching to Firefox is fast, easy and risk-free. Firefox imports your bookmarks, autofills, passwords and preferences from Chrome.", - {"Firefox": TERM_REFERENCE("brand-name-firefox"), "Chrome": TERM_REFERENCE("brand-name-chrome")}, - ), - ), - FTL.Message( - id=FTL.Identifier("switch-select-what-to-take"), - value=REPLACE("firefox/switch.lang", "Select what to take from Chrome.", {"Chrome": TERM_REFERENCE("brand-name-chrome")}), - ), - FTL.Message( - id=FTL.Identifier("switch-let-firefox-do-the-rest"), - value=REPLACE("firefox/switch.lang", "Let Firefox do the rest.", {"Firefox": TERM_REFERENCE("brand-name-firefox")}), - ), - FTL.Message( - id=FTL.Identifier("switch-use-firefox-and-still-chrome"), - value=REPLACE( - "firefox/switch.lang", - "You can use Firefox and still have Chrome. Chrome won’t change on your machine one bit.", - {"Firefox": TERM_REFERENCE("brand-name-firefox"), "Chrome": TERM_REFERENCE("brand-name-chrome")}, - ), - ), - FTL.Message( - id=FTL.Identifier("switch-share-with-your-friends"), - value=REPLACE( - "firefox/switch.lang", "Share with your friends how to switch to Firefox", {"Firefox": TERM_REFERENCE("brand-name-firefox")} - ), - ), - FTL.Message( - id=FTL.Identifier("switch-firefox-makes-switching-fast-tweet"), - value=REPLACE( - "firefox/switch.lang", - "🔥 Firefox makes switching from Chrome really fast. Try it out!", - {"Firefox": TERM_REFERENCE("brand-name-firefox"), "Chrome": TERM_REFERENCE("brand-name-chrome")}, - ), - ), - FTL.Message( - id=FTL.Identifier("switch-switch-to-firefox"), - value=REPLACE("firefox/switch.lang", "Switch to Firefox", {"Firefox": TERM_REFERENCE("brand-name-firefox")}), - ), - FTL.Message( - id=FTL.Identifier("switch-firefox-makes-switching-fast-email"), - value=REPLACE( - "firefox/switch.lang", - "Firefox makes switching from Chrome really fast. I like it a lot, and you should try it.", - {"Firefox": TERM_REFERENCE("brand-name-firefox"), "Chrome": TERM_REFERENCE("brand-name-chrome")}, - ), - ), - FTL.Message( - id=FTL.Identifier("switch-still-not-convinced"), - value=REPLACE( - "firefox/switch.lang", "Still not convinced that switching to Firefox is easy?", {"Firefox": TERM_REFERENCE("brand-name-firefox")} - ), - ), - ], - ) - - ctx.add_transforms( - "firefox/switch.ftl", - "firefox/switch.ftl", - transforms_from( - """ -switch-enjoy-the-web-faster = {COPY(switch, "Enjoy the web faster, all set up for you.",)} -switch-download-and-switch = {COPY(switch, "Download and switch",)} -switch-share-to-facebook = {COPY(switch, "Share to Facebook",)} -switch-send-a-tweet = {COPY(switch, "Send a tweet",)} -switch-hey = {COPY(switch, "Hey,",)} -switch-check-it-out = {COPY(switch, "Check it out and let me know what you think:",)} -switch-send-an-email = {COPY(switch, "Send an email",)} -""", - switch=switch, - ), - ) diff --git a/lib/fluent_migrations/firefox/welcome/__init__.py b/lib/fluent_migrations/firefox/welcome/__init__.py deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/lib/fluent_migrations/firefox/welcome/page1.py b/lib/fluent_migrations/firefox/welcome/page1.py deleted file mode 100644 index 6af9d367fd..0000000000 --- a/lib/fluent_migrations/firefox/welcome/page1.py +++ /dev/null @@ -1,114 +0,0 @@ -from __future__ import absolute_import - -import fluent.syntax.ast as FTL -from fluent.migrate import COPY, REPLACE -from fluent.migrate.helpers import TERM_REFERENCE, VARIABLE_REFERENCE, transforms_from - -page1 = "firefox/welcome/page1.lang" - - -def migrate(ctx): - """Migrate bedrock/firefox/templates/firefox/welcome/page1.html, part {index}.""" - - ctx.add_transforms( - "firefox/welcome/page1.ftl", - "firefox/welcome/page1.ftl", - [ - FTL.Message( - id=FTL.Identifier("welcome-page1-more-than-a-browser-firefox"), - value=REPLACE( - page1, - "More than a browser - Firefox Monitor is your lookout for hackers", - { - "Firefox Monitor": TERM_REFERENCE("brand-name-firefox-monitor"), - }, - ), - ), - FTL.Message( - id=FTL.Identifier("welcome-page1-take-the-next-step-to-protect"), - value=REPLACE( - page1, - "Take the next step to protect your privacy online with the Firefox family of products.", - { - "Firefox": TERM_REFERENCE("brand-name-firefox"), - }, - ), - ), - FTL.Message( - id=FTL.Identifier("welcome-page1-stay-ahead-of-hackers-check"), - value=REPLACE( - page1, - "Stay ahead of hackers. Check for data breaches with Firefox Monitor.", - { - "Firefox Monitor": TERM_REFERENCE("brand-name-firefox-monitor"), - }, - ), - ), - ] - + transforms_from( - """ -welcome-page1-youre-on-track-to-stay-protected = {COPY(page1, "You’re on track to stay protected",)} -welcome-page1-youve-got-the-web-browser = {COPY(page1, "You’ve got the web browser that protects your privacy — now it’s time to get a lookout for hackers.",)} -welcome-page1-check-your-breach-report = {COPY(page1, "Check Your Breach Report",)} -welcome-page1-firefox-monitor = { -brand-name-firefox-monitor } -""", - page1=page1, - ) - + [ - FTL.Message( - id=FTL.Identifier("welcome-page1-firefox-monitor-shows-you"), - value=REPLACE( - page1, - "Firefox Monitor shows you if your information has been leaked in a known data breach, and alerts you in case it happens in the future.", - { - "Firefox Monitor": TERM_REFERENCE("brand-name-firefox-monitor"), - }, - ), - ), - ] - + transforms_from( - """ -welcome-page1-stay-ahead-of-hackers = {COPY(page1, "Stay ahead of hackers",)} -""", - page1=page1, - ) - + [ - FTL.Message( - id=FTL.Identifier("welcome-page1-find-ways-to-protect-your"), - value=REPLACE( - page1, - 'Find ways to protect your info with Monitor Security Tips.', - { - "%%": "%", - "%(security_tips)s": VARIABLE_REFERENCE("security_tips"), - "Monitor": TERM_REFERENCE("brand-name-monitor"), - }, - ), - ), - ] - + transforms_from( - """ -welcome-page1-stay-in-the-know = {COPY(page1, "Stay in the know",)} -""", - page1=page1, - ) - + [ - FTL.Message( - id=FTL.Identifier("welcome-page1-were-you-one-of-many"), - value=REPLACE( - page1, - 'Were you one of 100,985,047 invited to the Evite data breach “party”?', - { - "%%": "%", - "%(evite_breach)s": VARIABLE_REFERENCE("evite_breach"), - }, - ), - ), - ] - + transforms_from( - """ -welcome-page1-why-am-i-seeing-this = {COPY(page1, "Why am I seeing this?",)} -""", - page1=page1, - ), - ) diff --git a/lib/fluent_migrations/firefox/welcome/page2.py b/lib/fluent_migrations/firefox/welcome/page2.py deleted file mode 100644 index fe2687ecc0..0000000000 --- a/lib/fluent_migrations/firefox/welcome/page2.py +++ /dev/null @@ -1,117 +0,0 @@ -from __future__ import absolute_import - -import fluent.syntax.ast as FTL -from fluent.migrate import COPY, REPLACE -from fluent.migrate.helpers import TERM_REFERENCE, VARIABLE_REFERENCE, transforms_from - -page2 = "firefox/welcome/page2.lang" - - -def migrate(ctx): - """Migrate bedrock/firefox/templates/firefox/welcome/page2.html, part {index}.""" - - ctx.add_transforms( - "firefox/welcome/page2.ftl", - "firefox/welcome/page2.ftl", - [ - FTL.Message( - id=FTL.Identifier("welcome-page2-pocket-save-news-videos-stories"), - value=REPLACE( - page2, - "Pocket - Save news, videos, stories and more", - { - "Pocket": TERM_REFERENCE("brand-name-pocket"), - }, - ), - ), - ] - + transforms_from( - """ -welcome-page2-your-time-online-is-worth = {COPY(page2, "Your time online is worth protecting",)} -""", - page2=page2, - ) - + [ - FTL.Message( - id=FTL.Identifier("welcome-page2-discover-and-save-stories"), - value=REPLACE( - page2, - "Discover and save stories in Pocket — and come back to them when you’re free.", - { - "Pocket": TERM_REFERENCE("brand-name-pocket"), - }, - ), - ), - FTL.Message( - id=FTL.Identifier("welcome-page2-activate-pocket"), - value=REPLACE( - page2, - "Activate Pocket", - { - "Pocket": TERM_REFERENCE("brand-name-pocket"), - }, - ), - ), - ] - + transforms_from( - """ -welcome-page2-pocket = { -brand-name-pocket } -""", - page2=page2, - ) - + [ - FTL.Message( - id=FTL.Identifier("welcome-page2-pocket-is-built-right-into"), - value=REPLACE( - page2, - "Pocket is built right into Firefox, so you can easily save stories as you find them, then read them later on any device.", - { - "Pocket": TERM_REFERENCE("brand-name-pocket"), - "Firefox": TERM_REFERENCE("brand-name-firefox"), - }, - ), - ), - ] - + transforms_from( - """ -welcome-page2-save-content-from-everywhere = {COPY(page2, "Save content from everywhere",)} -""", - page2=page2, - ) - + [ - FTL.Message( - id=FTL.Identifier("welcome-page2-grab-articles-videos-and-links"), - value=REPLACE( - page2, - "Grab articles, videos, and links from any website by clicking the Pocket icon in your browser toolbar.", - { - "Pocket": TERM_REFERENCE("brand-name-pocket"), - }, - ), - ), - ] - + transforms_from( - """ -welcome-page2-discover-new-stories = {COPY(page2, "Discover new stories",)} -""", - page2=page2, - ) - + [ - FTL.Message( - id=FTL.Identifier("welcome-page2-pocket-shows-recommended-stories"), - value=REPLACE( - page2, - "Pocket shows recommended stories every time you open a new tab. Save the ones that interest you.", - { - "Pocket": TERM_REFERENCE("brand-name-pocket"), - }, - ), - ), - ] - + transforms_from( - """ -welcome-page2-why-am-i-seeing-this = {COPY(page2, "Why am I seeing this?",)} -""", - page2=page2, - ), - ) diff --git a/lib/fluent_migrations/firefox/welcome/page3.py b/lib/fluent_migrations/firefox/welcome/page3.py deleted file mode 100644 index e71250cb02..0000000000 --- a/lib/fluent_migrations/firefox/welcome/page3.py +++ /dev/null @@ -1,79 +0,0 @@ -from __future__ import absolute_import - -import fluent.syntax.ast as FTL -from fluent.migrate import COPY, REPLACE -from fluent.migrate.helpers import TERM_REFERENCE, VARIABLE_REFERENCE, transforms_from - -page3 = "firefox/welcome/page3.lang" - - -def migrate(ctx): - """Migrate bedrock/firefox/templates/firefox/welcome/page3.html, part {index}.""" - - ctx.add_transforms( - "firefox/welcome/page3.ftl", - "firefox/welcome/page3.ftl", - [ - FTL.Message( - id=FTL.Identifier("welcome-page3-get-the-free-account-that"), - value=REPLACE( - page3, - "Get the free account that protects your privacy. Join Firefox.", - { - "Firefox": TERM_REFERENCE("brand-name-firefox"), - }, - ), - ), - ] - + transforms_from( - """ -welcome-page3-no-account-required-but-you = {COPY(page3, "No account required. But you might want one.",)} -""", - page3=page3, - ) - + [ - FTL.Message( - id=FTL.Identifier("welcome-page3-the-firefox-browser-collects"), - value=REPLACE( - page3, - "The Firefox browser collects so little data about you, we don’t even require your email address. But when you use it to create a Firefox account, we can protect your privacy across more of your online life.", - { - "Firefox": TERM_REFERENCE("brand-name-firefox"), - "Firefox account": TERM_REFERENCE("brand-name-firefox-account"), - }, - ), - ), - ] - + transforms_from( - """ -welcome-page3-firefox-monitor = { -brand-name-firefox-monitor } -welcome-page3-have-at-least-one-company = {COPY(page3, "Have at least one company looking out for your data, instead of leaking it.",)} -welcome-page3-firefox-lockwise = { -brand-name-firefox-lockwise } -welcome-page3-never-forget-reset-or-travel = {COPY(page3, "Never forget, reset or travel without your passwords again.",)} -welcome-page3-facebook-container = { -brand-name-facebook-container } -""", - page3=page3, - ) - + [ - FTL.Message( - id=FTL.Identifier("welcome-page3-get-a-container-to-keep-facebook"), - value=REPLACE( - page3, - "Get a container to keep Facebook out of your business.", - { - "Facebook": TERM_REFERENCE("brand-name-facebook"), - }, - ), - ), - ] - + transforms_from( - """ -welcome-page3-pocket = { -brand-name-pocket } -welcome-page3-trade-clickbait-and-fake-news = {COPY(page3, "Trade clickbait and fake news for quality content.",)} -welcome-page3-firefox-send = { -brand-name-firefox-send } -welcome-page3-send-huge-files-to-anyone = {COPY(page3, "Send huge files to anyone you want, with self-destructing links.",)} -welcome-page3-why-am-i-seeing-this = {COPY(page3, "Why am I seeing this?",)} -""", - page3=page3, - ), - ) diff --git a/lib/fluent_migrations/firefox/welcome/page4.py b/lib/fluent_migrations/firefox/welcome/page4.py deleted file mode 100644 index 504bd12811..0000000000 --- a/lib/fluent_migrations/firefox/welcome/page4.py +++ /dev/null @@ -1,127 +0,0 @@ -from __future__ import absolute_import - -import fluent.syntax.ast as FTL -from fluent.migrate import COPY, REPLACE -from fluent.migrate.helpers import TERM_REFERENCE, VARIABLE_REFERENCE, transforms_from - -page4 = "firefox/welcome/page4.lang" - - -def migrate(ctx): - """Migrate bedrock/firefox/templates/firefox/welcome/page4.html, part {index}.""" - - ctx.add_transforms( - "firefox/welcome/page4.ftl", - "firefox/welcome/page4.ftl", - [ - FTL.Message( - id=FTL.Identifier("welcome-page4-download-the-firefox-browser"), - value=REPLACE( - page4, - "Download the Firefox Browser on your Mobile for iOS and Android", - { - "Firefox Browser": TERM_REFERENCE("brand-name-firefox-browser"), - "iOS": TERM_REFERENCE("brand-name-ios"), - "Android": TERM_REFERENCE("brand-name-android"), - }, - ), - ), - FTL.Message( - id=FTL.Identifier("welcome-page4-wallet-keys-phone-firefox"), - value=REPLACE( - page4, - "Wallet. Keys. Phone. Firefox.", - { - "Firefox": TERM_REFERENCE("brand-name-firefox"), - }, - ), - ), - ] - + transforms_from( - """ -welcome-page4-take-privacy-with-you-on-every = {COPY(page4, "Take privacy with you on every device — and leave the data trackers behind.",)} -""", - page4=page4, - ) - + [ - FTL.Message( - id=FTL.Identifier("welcome-page4-get-the-firefox-app"), - value=REPLACE( - page4, - "Get the Firefox App", - { - "Firefox": TERM_REFERENCE("brand-name-firefox"), - }, - ), - ), - FTL.Message( - id=FTL.Identifier("welcome-page4-get-firefox-on-your-phone"), - value=REPLACE( - page4, - "Get Firefox on your Phone", - { - "Firefox": TERM_REFERENCE("brand-name-firefox"), - }, - ), - ), - ] - + transforms_from( - """ -welcome-page4-send-the-download-link-right = {COPY(page4, "Send the download link right to your phone or email.",)} -""", - page4=page4, - ) - + [ - FTL.Message( - id=FTL.Identifier("welcome-page4-download-firefox-for-your"), - value=REPLACE( - page4, - "Download Firefox for your smartphone and tablet.", - { - "Firefox": TERM_REFERENCE("brand-name-firefox"), - }, - ), - ), - FTL.Message( - id=FTL.Identifier("welcome-page4-firefox-private-safe-browser"), - value=REPLACE( - page4, - "“Firefox: Private, Safe Browser” on iOS or Android.", - { - "Firefox": TERM_REFERENCE("brand-name-firefox"), - "iOS": TERM_REFERENCE("brand-name-ios"), - "Android": TERM_REFERENCE("brand-name-android"), - }, - ), - ), - ] - + transforms_from( - """ -welcome-page4-get-data-trackers-off-your = {COPY(page4, "Get data trackers off your trail",)} -""", - page4=page4, - ) - + [ - FTL.Message( - id=FTL.Identifier("welcome-page4-enhanced-tracking-protection"), - value=REPLACE( - page4, - 'Enhanced Tracking Protection blocks 2000+ trackers from chasing you around the web.', - { - "%%": "%", - "%(privacy)s": VARIABLE_REFERENCE("privacy"), - }, - ), - ), - ] - + transforms_from( - """ -welcome-page4-leave-no-trace = {COPY(page4, "Leave no trace",)} -welcome-page4-automatically-clear-your-history = {COPY(page4, "Automatically clear your history and cookies with Private Browsing mode.",)} -welcome-page4-take-it-all-with-you = {COPY(page4, "Take it all with you",)} -welcome-page4-dont-walk-out-the-door-without = {COPY(page4, "Don’t walk out the door without your bookmarks, tabs, notes, and passwords.",)} -welcome-page4-why-am-i-seeing-this = {COPY(page4, "Why am I seeing this?",)} -""", - page4=page4, - ), - ) diff --git a/lib/fluent_migrations/firefox/welcome/page5.py b/lib/fluent_migrations/firefox/welcome/page5.py deleted file mode 100644 index 44784ee405..0000000000 --- a/lib/fluent_migrations/firefox/welcome/page5.py +++ /dev/null @@ -1,131 +0,0 @@ -from __future__ import absolute_import - -import fluent.syntax.ast as FTL -from fluent.migrate import COPY, REPLACE -from fluent.migrate.helpers import TERM_REFERENCE, VARIABLE_REFERENCE, transforms_from - -page5 = "firefox/welcome/page5.lang" - - -def migrate(ctx): - """Migrate bedrock/firefox/templates/firefox/welcome/page5.html, part {index}.""" - - ctx.add_transforms( - "firefox/welcome/page5.ftl", - "firefox/welcome/page5.ftl", - [ - FTL.Message( - id=FTL.Identifier("welcome-page5-firefox-lockwise-password"), - value=REPLACE( - page5, - "Firefox Lockwise — password manager — take your passwords everywhere", - { - "Firefox Lockwise": TERM_REFERENCE("brand-name-firefox-lockwise"), - }, - ), - ), - ] - + transforms_from( - """ -welcome-page5-theres-an-easier-way-to-deal = {COPY(page5, "There’s an easier way to deal with your passwords",)} -""", - page5=page5, - ) - + [ - FTL.Message( - id=FTL.Identifier("welcome-page5-let-firefox-save-them-for"), - value=REPLACE( - page5, - "Let Firefox save them for you. Then use Firefox Lockwise to safely access your passwords across all your apps, on all of your devices.", - { - "Firefox": TERM_REFERENCE("brand-name-firefox"), - "Firefox Lockwise": TERM_REFERENCE("brand-name-firefox-lockwise"), - }, - ), - ), - FTL.Message( - id=FTL.Identifier("welcome-page5-get-the-lockwise-app"), - value=REPLACE( - page5, - "Get the Lockwise App", - { - "Lockwise": TERM_REFERENCE("brand-name-lockwise"), - }, - ), - ), - FTL.Message( - id=FTL.Identifier("welcome-page5-get-firefox-lockwise-on-your"), - value=REPLACE( - page5, - "Get Firefox Lockwise on your Phone", - { - "Firefox Lockwise": TERM_REFERENCE("brand-name-firefox-lockwise"), - }, - ), - ), - ] - + transforms_from( - """ -welcome-page5-send-the-download-link-right = {COPY(page5, "Send the download link right to your phone or email.",)} -""", - page5=page5, - ) - + [ - FTL.Message( - id=FTL.Identifier("welcome-page5-download-firefox-lockwise"), - value=REPLACE( - page5, - "Download Firefox Lockwise for your smartphone and tablet.", - { - "Firefox Lockwise": TERM_REFERENCE("brand-name-firefox-lockwise"), - }, - ), - ), - ] - + transforms_from( - """ -welcome-page5-scan-this-qr-code = {COPY(page5, "Scan this QR code",)} -welcome-page5-firefox-lockwise = { -brand-term-firefox-lockwise } -welcome-page5-sync-up-safely = {COPY(page5, "Sync up safely",)} -welcome-page5-with-256-bit-encryption-your = {COPY(page5, "With 256-bit encryption, your passwords always travel to your devices securely.",)} -welcome-page5-no-more-making-up-new-passwords = {COPY(page5, "No more making up new passwords",)} -""", - page5=page5, - ) - + [ - FTL.Message( - id=FTL.Identifier("welcome-page5-lockwise-will-recommend-new"), - value=REPLACE( - page5, - "Lockwise will recommend new, strong passwords whenever you set up a new login.", - { - "Lockwise": TERM_REFERENCE("brand-name-lockwise"), - }, - ), - ), - ] - + transforms_from( - """ -welcome-page5-help-during-a-breach = {COPY(page5, "Help during a breach",)} -""", - page5=page5, - ) - + [ - FTL.Message( - id=FTL.Identifier("welcome-page5-lockwise-will-let-you-know"), - value=REPLACE( - page5, - "Lockwise will let you know if your saved logins have been part of a corporate data breach, so you can change them asap.", - { - "Lockwise": TERM_REFERENCE("brand-name-lockwise"), - }, - ), - ), - ] - + transforms_from( - """ -welcome-page5-why-am-i-seeing-this = {COPY(page5, "Why am I seeing this?",)} -""", - page5=page5, - ), - ) diff --git a/lib/fluent_migrations/firefox/welcome/page6.py b/lib/fluent_migrations/firefox/welcome/page6.py deleted file mode 100644 index 32cdb2d6d6..0000000000 --- a/lib/fluent_migrations/firefox/welcome/page6.py +++ /dev/null @@ -1,152 +0,0 @@ -from __future__ import absolute_import - -import fluent.syntax.ast as FTL -from fluent.migrate import COPY, REPLACE -from fluent.migrate.helpers import TERM_REFERENCE, VARIABLE_REFERENCE, transforms_from - -page6 = "firefox/welcome/page6.lang" - - -def migrate(ctx): - """Migrate bedrock/firefox/templates/firefox/welcome/page6.html, part {index}.""" - - ctx.add_transforms( - "firefox/welcome/page6.ftl", - "firefox/welcome/page6.ftl", - [ - FTL.Message( - id=FTL.Identifier("welcome-page6-make-firefox-your-default"), - value=REPLACE( - page6, - "Make Firefox your default browser", - { - "Firefox": TERM_REFERENCE("brand-name-firefox"), - }, - ), - ), - ] - + transforms_from( - """ -welcome-page6-make-sure-youre-protected = {COPY(page6, "Make sure you’re protected, every time you get online",)} -""", - page6=page6, - ) - + [ - FTL.Message( - id=FTL.Identifier("welcome-page6-when-you-choose-firefox-you"), - value=REPLACE( - page6, - "When you choose Firefox, you support a better web for you and everyone else. Now take the next step to protect yourself.", - { - "Firefox": TERM_REFERENCE("brand-name-firefox"), - }, - ), - ), - FTL.Message( - id=FTL.Identifier("welcome-page6-get-the-firefox-app"), - value=REPLACE( - page6, - "Get the Firefox App", - { - "Firefox": TERM_REFERENCE("brand-name-firefox"), - }, - ), - ), - FTL.Message( - id=FTL.Identifier("welcome-page6-get-firefox-on-your-phone"), - value=REPLACE( - page6, - "Get Firefox on your Phone", - { - "Firefox": TERM_REFERENCE("brand-name-firefox"), - }, - ), - ), - ] - + transforms_from( - """ -welcome-page6-scan-the-qr-code-to-get-started = {COPY(page6, "Scan the QR code to get started",)} -""", - page6=page6, - ) - + [ - FTL.Message( - id=FTL.Identifier("welcome-page6-qr-code-to-scan-for-firefox"), - value=REPLACE( - page6, - "QR code to scan for Firefox", - { - "Firefox": TERM_REFERENCE("brand-name-firefox"), - }, - ), - ), - ] - + transforms_from( - """ -welcome-page6-choose-automatic-privacy = {COPY(page6, "Choose automatic privacy",)} -""", - page6=page6, - ) - + [ - FTL.Message( - id=FTL.Identifier("welcome-page6-companies-keep-finding-new"), - value=REPLACE( - page6, - "Companies keep finding new ways to poach your personal data. Firefox is the browser with a mission of finding new ways to protect you.", - { - "Firefox": TERM_REFERENCE("brand-name-firefox"), - }, - ), - ), - ] - + transforms_from( - """ -welcome-page6-choose-freedom-on-every-device = {COPY(page6, "Choose freedom on every device",)} -""", - page6=page6, - ) - + [ - FTL.Message( - id=FTL.Identifier("welcome-page6-firefox-is-fast-and-safe-on"), - value=REPLACE( - page6, - "Firefox is fast and safe on Windows, iOS, Android, Linux… and across them all. You deserve choices in browsers and devices, instead of decisions made for you.", - { - "Firefox": TERM_REFERENCE("brand-name-firefox"), - "Android": TERM_REFERENCE("brand-name-android"), - "Windows": TERM_REFERENCE("brand-name-windows"), - "Linux": TERM_REFERENCE("brand-name-linux"), - "iOS": TERM_REFERENCE("brand-name-ios"), - }, - ), - ), - ] - + transforms_from( - """ -welcome-page6-choose-corporate-independence = {COPY(page6, "Choose corporate independence",)} -""", - page6=page6, - ) - + [ - FTL.Message( - id=FTL.Identifier("welcome-page6-firefox-is-the-only-major"), - value=REPLACE( - page6, - "Firefox is the only major independent browser. Chrome, Edge and Brave are all built on Google code, which means giving Google even more control of the internet.", - { - "Firefox": TERM_REFERENCE("brand-name-firefox"), - "Google": TERM_REFERENCE("brand-name-google"), - "Chrome": TERM_REFERENCE("brand-name-chrome"), - "Brave": TERM_REFERENCE("brand-name-brave"), - "Edge": TERM_REFERENCE("brand-name-edge"), - }, - ), - ), - ] - + transforms_from( - """ -welcome-page6-why-am-i-seeing-this = {COPY(page6, "Why am I seeing this?",)} -""", - page6=page6, - ), - ) diff --git a/lib/fluent_migrations/firefox/welcome/page7.py b/lib/fluent_migrations/firefox/welcome/page7.py deleted file mode 100644 index d89ccaa7e4..0000000000 --- a/lib/fluent_migrations/firefox/welcome/page7.py +++ /dev/null @@ -1,136 +0,0 @@ -from __future__ import absolute_import - -import fluent.syntax.ast as FTL -from fluent.migrate import COPY, REPLACE -from fluent.migrate.helpers import TERM_REFERENCE, VARIABLE_REFERENCE, transforms_from - -page7 = "firefox/welcome/page7.lang" - - -def migrate(ctx): - """Migrate bedrock/firefox/templates/firefox/welcome/page7.html, part {index}.""" - - ctx.add_transforms( - "firefox/welcome/page7.ftl", - "firefox/welcome/page7.ftl", - [ - FTL.Message( - id=FTL.Identifier("page7-make-it-harder-for-facebook"), - value=REPLACE( - page7, - "Make it harder for Facebook to track you", - { - "Facebook": TERM_REFERENCE("brand-name-facebook"), - }, - ), - ), - FTL.Message( - id=FTL.Identifier("page7-its-okay-to-like-facebook"), - value=REPLACE( - page7, - "It’s okay to like Facebook", - { - "Facebook": TERM_REFERENCE("brand-name-facebook"), - }, - ), - ), - FTL.Message( - id=FTL.Identifier("page7-if-you-still-kinda-like-facebook"), - value=REPLACE( - page7, - "If you still kinda like Facebook but don’t trust them, then try the Facebook Container extension by Firefox and make it harder for them to track you around the web.", - { - "Facebook": TERM_REFERENCE("brand-name-facebook"), - "Firefox": TERM_REFERENCE("brand-name-firefox"), - "Facebook Container": TERM_REFERENCE("brand-name-facebook-container"), - }, - ), - ), - FTL.Message( - id=FTL.Identifier("page7-get-facebook-container"), - value=REPLACE( - page7, - "Get Facebook Container", - { - "Facebook Container": TERM_REFERENCE("brand-name-facebook-container"), - }, - ), - ), - ] - + transforms_from( - """ -page7-do-it-for-the-gram = {COPY(page7, "Do it for the ’Gram",)} -""", - page7=page7, - ) - + [ - FTL.Message( - id=FTL.Identifier("page7-facebook-container-also-works"), - value=REPLACE( - page7, - "Facebook Container also works on other Facebook owned sites like Instagram, Facebook Messenger and Workplace.", - { - "Facebook": TERM_REFERENCE("brand-name-facebook"), - "Facebook Container": TERM_REFERENCE("brand-name-facebook-container"), - "Facebook Messenger": TERM_REFERENCE("brand-name-facebook-messenger"), - "Instagram": TERM_REFERENCE("brand-name-instagram"), - "Workplace": TERM_REFERENCE("brand-name-workplace"), - }, - ), - ), - ] - + transforms_from( - """ -page7-make-them-unfollow-you = {COPY(page7, "Make them unfollow you",)} -page7-that-sneaky-little-button = {COPY(page7, "That sneaky little button",)} -""", - page7=page7, - ) - + [ - FTL.Message( - id=FTL.Identifier("page7-those-innocent-looking-f-buttons"), - value=REPLACE( - page7, - "Those innocent-looking F buttons from Facebook track your web activity, even if you don’t have an account. Facebook Container blocks them.", - { - "Facebook": TERM_REFERENCE("brand-name-facebook"), - "Facebook Container": TERM_REFERENCE("brand-name-facebook-container"), - }, - ), - ), - ] - + transforms_from( - """ -page7-stay-ahead-of-hackers = {COPY(page7, "Stay ahead of hackers",)} -""", - page7=page7, - ) - + [ - FTL.Message( - id=FTL.Identifier("page7-firefox-monitor-lets-you-find"), - value=REPLACE( - page7, - "Firefox Monitor lets you find out what hackers might already know about you and helps you stay a step ahead of them. (And it’s free.)", - { - "Firefox Monitor": TERM_REFERENCE("brand-name-firefox-monitor"), - }, - ), - ), - FTL.Message( - id=FTL.Identifier("page7-get-firefox-monitor"), - value=REPLACE( - page7, - "Get Firefox Monitor", - { - "Firefox Monitor": TERM_REFERENCE("brand-name-firefox-monitor"), - }, - ), - ), - ] - + transforms_from( - """ -page7-why-am-i-seeing-this = {COPY(page7, "Why am I seeing this?",)} -""", - page7=page7, - ), - ) diff --git a/lib/fluent_migrations/firefox/whatsnew/__init__.py b/lib/fluent_migrations/firefox/whatsnew/__init__.py deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/lib/fluent_migrations/firefox/whatsnew/index.py b/lib/fluent_migrations/firefox/whatsnew/index.py deleted file mode 100644 index d9bca49b75..0000000000 --- a/lib/fluent_migrations/firefox/whatsnew/index.py +++ /dev/null @@ -1,65 +0,0 @@ -from __future__ import absolute_import - -import fluent.syntax.ast as FTL -from fluent.migrate import COPY, REPLACE -from fluent.migrate.helpers import TERM_REFERENCE, VARIABLE_REFERENCE, transforms_from - -index = "firefox/whatsnew/index.lang" -whatsnew = "firefox/whatsnew.lang" - - -def migrate(ctx): - """Migrate bedrock/firefox/templates/firefox/whatsnew/index.html, part {index}.""" - - ctx.add_transforms( - "firefox/whatsnew/whatsnew-s2d.ftl", - "firefox/whatsnew/whatsnew-s2d.ftl", - [ - FTL.Message( - id=FTL.Identifier("whatsnew-s2d-download-firefox-for-android"), - value=REPLACE( - whatsnew, - "Download Firefox for Android and iOS", - { - "Firefox": TERM_REFERENCE("brand-name-firefox"), - "Android": TERM_REFERENCE("brand-name-android"), - "iOS": TERM_REFERENCE("brand-name-ios"), - }, - ), - ), - ] - + transforms_from( - """ -whatsnew-s2d-want-privacy-on-every-device = {COPY(whatsnew, "Want privacy on every device?",)} -""", - whatsnew=whatsnew, - ) - + [ - FTL.Message( - id=FTL.Identifier("whatsnew-s2d-you-got-it-get-firefox-for"), - value=REPLACE( - whatsnew, - "You got it. Get Firefox for mobile.", - { - "Firefox": TERM_REFERENCE("brand-name-firefox"), - }, - ), - ), - FTL.Message( - id=FTL.Identifier("whatsnew-s2d-send-firefox-to-your-phone"), - value=REPLACE( - whatsnew, "Send Firefox to your phone
and unleash your Internet.", {"Firefox": TERM_REFERENCE("brand-name-firefox")} - ), - ), - FTL.Message( - id=FTL.Identifier("whatsnew-s2d-download-firefox-for-your"), - value=REPLACE( - whatsnew, - "Download Firefox for your smartphone and tablet.", - { - "Firefox": TERM_REFERENCE("brand-name-firefox"), - }, - ), - ), - ], - ) diff --git a/lib/fluent_migrations/includes/__init__.py b/lib/fluent_migrations/includes/__init__.py deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/lib/fluent_migrations/includes/protocol/__init__.py b/lib/fluent_migrations/includes/protocol/__init__.py deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/lib/fluent_migrations/includes/protocol/footer/__init__.py b/lib/fluent_migrations/includes/protocol/footer/__init__.py deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/lib/fluent_migrations/includes/protocol/footer/footer.py b/lib/fluent_migrations/includes/protocol/footer/footer.py deleted file mode 100644 index 1d41e549fc..0000000000 --- a/lib/fluent_migrations/includes/protocol/footer/footer.py +++ /dev/null @@ -1,134 +0,0 @@ -from __future__ import absolute_import - -import fluent.syntax.ast as FTL -from fluent.migrate import COPY, REPLACE -from fluent.migrate.helpers import TERM_REFERENCE, VARIABLE_REFERENCE, transforms_from - -footer = "footer.lang" -main = "main.lang" - - -def migrate(ctx): - """Migrate bedrock/base/templates/includes/protocol/footer/footer.html, part {index}.""" - - ctx.add_transforms( - "footer.ftl", - "footer.ftl", - transforms_from( - """ -footer-firefox = { -brand-name-firefox } -footer-privacy = {COPY(main, "Privacy",)} -footer-press = {COPY(footer, "Press",)} -footer-brand-standards = {COPY(footer, "Brand Standards",)} -footer-browsers = {COPY(footer, "Browsers",)} -footer-desktop = {COPY(main, "Desktop",)} -footer-mobile = {COPY(main, "Mobile",)} -footer-reality = { -brand-name-reality } -footer-enterprise = { -brand-name-enterprise } -footer-products = {COPY(footer, "Products",)} -footer-lockwise = { -brand-name-lockwise } -footer-monitor = { -brand-name-monitor } -footer-send = { -brand-name-send } -footer-pocket = { -brand-name-pocket } -footer-join = {COPY(footer, "Join",)} -footer-sign-up = {COPY(footer, "Sign Up",)} -footer-sign-in = {COPY(footer, "Sign In",)} -footer-benefits = {COPY(footer, "Benefits",)} -footer-developers = {COPY(footer, "Developers",)} -footer-developer-edition = { -brand-name-developer-edition } -footer-beta = { -brand-name-beta } -footer-nightly = { -brand-name-nightly } -""", - footer=footer, - main=main, - ), - ) - - ctx.add_transforms( - "footer.ftl", - "footer.ftl", - [ - FTL.Message( - id=FTL.Identifier("footer-nightly-for-android"), - value=REPLACE( - "footer.lang", - "Nightly for Android", - { - "Nightly": TERM_REFERENCE("brand-name-nightly"), - "Android": TERM_REFERENCE("brand-name-android"), - }, - ), - ), - FTL.Message( - id=FTL.Identifier("footer-beta-for-android"), - value=REPLACE( - "footer.lang", - "Beta for Android", - { - "Beta": TERM_REFERENCE("brand-name-beta"), - "Android": TERM_REFERENCE("brand-name-android"), - }, - ), - ), - FTL.Message( - id=FTL.Identifier("footer-visit-mozilla-corporations"), - value=REPLACE( - "footer.lang", - "Visit Mozilla Corporation’s not-for-profit parent, the Mozilla Foundation.", - { - "%%": "%", - "%(moco_link)s": VARIABLE_REFERENCE("moco_link"), - "%(mofo_link)s": VARIABLE_REFERENCE("mofo_link"), - "Mozilla Corporation": TERM_REFERENCE("brand-name-mozilla-corporation"), - "Mozilla Foundation": TERM_REFERENCE("brand-name-mozilla-foundation"), - }, - ), - ), - FTL.Message( - id=FTL.Identifier("footer-portions-of-this-content"), - value=REPLACE( - "footer.lang", - 'Portions of this content are ©1998–%(current_year)s by individual mozilla.org contributors. Content available under a Creative Commons license.', - { - "%%": "%", - "%(current_year)s": VARIABLE_REFERENCE("current_year"), - "%(url)s": VARIABLE_REFERENCE("url"), - "Creative Commons": TERM_REFERENCE("brand-name-creative-commons"), - }, - ), - ), - ], - ) - - ctx.add_transforms( - "footer.ftl", - "footer.ftl", - transforms_from( - """ -footer-mozilla = { -brand-name-mozilla } -footer-company = {COPY(footer, "Company",)} -footer-about = {COPY(main, "About",)} -footer-press-center = {COPY(main, "Press Center",)} -footer-careers = {COPY(footer, "Careers",)} -footer-test-new-features = {COPY(footer, "Test New Features",)} -footer-mdn-web-docs = { -brand-name-mdn-web-docs } -footer-tools = {COPY(footer, "Tools",)} -footer-resources = {COPY(footer, "Resources",)} -footer-contact = {COPY(footer, "Contact",)} -footer-product-help = {COPY(footer, "Product Help",)} -footer-support = {COPY(footer, "Support",)} -footer-file-a-bug = {COPY(footer, "File a Bug",)} -footer-community-participation-guidelines = {COPY(footer, "Community Participation Guidelines",)} -footer-websites-privacy-notice = {COPY(main, "Website Privacy Notice",)} -footer-websites-cookies = {COPY(main, "Cookies",)} -footer-websites-legal = {COPY(main, "Legal",)} -footer-language = {COPY(main, "Language",)} -footer-go = {COPY(main, "Go",)} -footer-twitter = { -brand-name-twitter } -footer-instagram = { -brand-name-instagram } -footer-youtube = { -brand-name-youtube } -""", - footer=footer, - main=main, - ), - ) diff --git a/lib/fluent_migrations/includes/protocol/navigation/__init__.py b/lib/fluent_migrations/includes/protocol/navigation/__init__.py deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/lib/fluent_migrations/includes/protocol/navigation/navigation.py b/lib/fluent_migrations/includes/protocol/navigation/navigation.py deleted file mode 100644 index 62a14a6f52..0000000000 --- a/lib/fluent_migrations/includes/protocol/navigation/navigation.py +++ /dev/null @@ -1,371 +0,0 @@ -from __future__ import absolute_import - -import fluent.syntax.ast as FTL -from fluent.migrate import COPY, REPLACE -from fluent.migrate.helpers import TERM_REFERENCE, VARIABLE_REFERENCE, transforms_from - -navigation = "navigation.lang" -main = "main.lang" - - -def migrate(ctx): - """Migrate bedrock/base/templates/includes/protocol/navigation/navigation.html, part {index}.""" - - ctx.add_transforms( - "navigation.ftl", - "navigation.ftl", - [ - FTL.Message( - id=FTL.Identifier("navigation-download-firefox"), - value=REPLACE("navigation.lang", "Download Firefox", {"Firefox": TERM_REFERENCE("brand-name-firefox")}), - ), - FTL.Message( - id=FTL.Identifier("navigation-get-a-firefox-account"), - value=REPLACE("navigation.lang", "Get a Firefox Account", {"Firefox Account": TERM_REFERENCE("brand-name-firefox-account")}), - ), - FTL.Message( - id=FTL.Identifier("navigation-firefox-browser-for-desktop"), - value=REPLACE("navigation.lang", "Firefox Browser for Desktop", {"Firefox Browser": TERM_REFERENCE("brand-name-firefox-browser")}), - ), - FTL.Message( - id=FTL.Identifier("navigation-get-the-browser-that-respects"), - value=REPLACE( - "navigation.lang", - "Get the browser that respects your privacy automatically. On Windows, macOS or Linux.", - { - "Windows": TERM_REFERENCE("brand-name-windows"), - "macOS": TERM_REFERENCE("brand-name-mac"), - "Linux": TERM_REFERENCE("brand-name-linux"), - }, - ), - ), - FTL.Message( - id=FTL.Identifier("navigation-firefox-browser-for-mobile"), - value=REPLACE("navigation.lang", "Firefox Browser for Mobile", {"Firefox Browser": TERM_REFERENCE("brand-name-firefox-browser")}), - ), - FTL.Message( - id=FTL.Identifier("navigation-take-speed-privacy-and"), - value=REPLACE( - "navigation.lang", - "Take speed, privacy and peace of mind with you. On Android and iOS.", - {"Android": TERM_REFERENCE("brand-name-android"), "iOS": TERM_REFERENCE("brand-name-ios")}, - ), - ), - FTL.Message( - id=FTL.Identifier("navigation-download-for-ios"), - value=REPLACE("navigation.lang", "Download for iOS", {"iOS": TERM_REFERENCE("brand-name-ios")}), - ), - FTL.Message( - id=FTL.Identifier("navigation-download-for-android"), - value=REPLACE("navigation.lang", "Download for Android", {"Android": TERM_REFERENCE("brand-name-android")}), - ), - FTL.Message( - id=FTL.Identifier("navigation-ios-support"), - value=REPLACE("navigation.lang", "iOS Support", {"iOS": TERM_REFERENCE("brand-name-ios")}), - ), - FTL.Message( - id=FTL.Identifier("navigation-android-support"), - value=REPLACE("navigation.lang", "Android Support", {"Android": TERM_REFERENCE("brand-name-android")}), - ), - FTL.Message( - id=FTL.Identifier("navigation-firefox-browser-for-enterprise"), - value=REPLACE("navigation.lang", "Firefox Browser for Enterprise", {"Firefox Browser": TERM_REFERENCE("brand-name-firefox-browser")}), - ), - FTL.Message( - id=FTL.Identifier("navigation-strap-on-your-goggles"), - value=REPLACE( - "navigation.lang", - "Strap on your goggles and step into the immersive web with Firefox Browser for VR.", - {"Firefox Browser": TERM_REFERENCE("brand-name-firefox-browser")}, - ), - ), - FTL.Message( - id=FTL.Identifier("navigation-firefox-for-fire-tv"), - value=REPLACE( - "navigation.lang", - "Firefox for Fire TV", - {"Firefox": TERM_REFERENCE("brand-name-firefox"), "Fire TV": TERM_REFERENCE("brand-name-fire-tv")}, - ), - ), - FTL.Message( - id=FTL.Identifier("navigation-watch-videos-and-browse"), - value=REPLACE( - "navigation.lang", - "Watch videos and browse the internet on your Amazon Fire TV.", - {"Amazon": TERM_REFERENCE("brand-name-amazon"), "Fire TV": TERM_REFERENCE("brand-name-fire-tv")}, - ), - ), - FTL.Message( - id=FTL.Identifier("navigation-firefox-browsers-put"), - value=REPLACE( - "navigation.lang", "Firefox browsers put your privacy first — and always have.", {"Firefox": TERM_REFERENCE("brand-name-firefox")} - ), - ), - FTL.Message( - id=FTL.Identifier("navigation-take-the-passwords-youve"), - value=REPLACE( - "navigation.lang", - "Take the passwords you’ve saved in Firefox with you everywhere.", - {"Firefox": TERM_REFERENCE("brand-name-firefox")}, - ), - ), - FTL.Message( - id=FTL.Identifier("navigation-firefox-is-a-whole-family"), - value=REPLACE( - "navigation.lang", - "Firefox is a whole family of products designed to keep you safer and smarter online.", - {"Firefox": TERM_REFERENCE("brand-name-firefox")}, - ), - ), - FTL.Message( - id=FTL.Identifier("navigation-join-firefox"), - value=REPLACE("navigation.lang", "Join Firefox", {"Firefox": TERM_REFERENCE("brand-name-firefox")}), - ), - FTL.Message( - id=FTL.Identifier("navigation-access-all-of-firefox"), - value=REPLACE( - "navigation.lang", - "Access all of Firefox with a single login — and get more from every product when you do.", - {"Firefox": TERM_REFERENCE("brand-name-firefox")}, - ), - ), - FTL.Message( - id=FTL.Identifier("navigation-meet-the-firefox-family"), - value=REPLACE("navigation.lang", "Meet the Firefox Family", {"Firefox": TERM_REFERENCE("brand-name-firefox")}), - ), - FTL.Message( - id=FTL.Identifier("navigation-firefox-blog"), - value=REPLACE("navigation.lang", "Firefox Blog", {"Firefox": TERM_REFERENCE("brand-name-firefox")}), - ), - FTL.Message( - id=FTL.Identifier("navigation-read-about-new-firefox"), - value=REPLACE( - "navigation.lang", - "Read about new Firefox features, and get tips for staying safer online.", - {"Firefox": TERM_REFERENCE("brand-name-firefox")}, - ), - ), - FTL.Message( - id=FTL.Identifier("navigation-the-non-profit-behind"), - value=REPLACE( - "navigation.lang", - "The non-profit behind Firefox is fighting for a healthy internet for all.", - {"Firefox": TERM_REFERENCE("brand-name-firefox")}, - ), - ), - FTL.Message( - id=FTL.Identifier("navigation-learn-how-firefox-treats"), - value=REPLACE( - "navigation.lang", "Learn how Firefox treats your data with respect.", {"Firefox": TERM_REFERENCE("brand-name-firefox")} - ), - ), - FTL.Message( - id=FTL.Identifier("navigation-mozilla-careers"), - value=REPLACE("navigation.lang", "Mozilla Careers", {"Mozilla": TERM_REFERENCE("brand-name-mozilla")}), - ), - FTL.Message( - id=FTL.Identifier("navigation-approach-your-career"), - value=REPLACE( - "navigation.lang", - "Approach your career with a sense of purpose. Find worthy work at Mozilla.", - {"Mozilla": TERM_REFERENCE("brand-name-mozilla")}, - ), - ), - FTL.Message( - id=FTL.Identifier("navigation-close-firefox-menu"), - value=REPLACE("navigation.lang", "Close Firefox menu", {"Firefox": TERM_REFERENCE("brand-name-firefox")}), - ), - FTL.Message( - id=FTL.Identifier("navigation-get-the-browser-that-gives"), - value=REPLACE( - "navigation.lang", - "Get the browser that gives more power to you on Windows, macOS or Linux.", - { - "Windows": TERM_REFERENCE("brand-name-windows"), - "macOS": TERM_REFERENCE("brand-name-mac"), - "Linux": TERM_REFERENCE("brand-name-linux"), - }, - ), - ), - FTL.Message( - id=FTL.Identifier("navigation-take-firefox-and-firefox"), - value=REPLACE( - "navigation.lang", - "Take Firefox and Firefox Focus with you. For Android and iOS.", - { - "Firefox": TERM_REFERENCE("brand-name-firefox"), - "Firefox Focus": TERM_REFERENCE("brand-name-firefox-focus"), - "Android": TERM_REFERENCE("brand-name-android"), - "iOS": TERM_REFERENCE("brand-name-ios"), - }, - ), - ), - FTL.Message( - id=FTL.Identifier("navigation-get-firefox"), - value=REPLACE("navigation.lang", "Get Firefox", {"Firefox": TERM_REFERENCE("brand-name-firefox")}), - ), - FTL.Message( - id=FTL.Identifier("navigation-get-firefox-focus"), - value=REPLACE("navigation.lang", "Get Firefox Focus", {"Firefox Focus": TERM_REFERENCE("brand-name-firefox-focus")}), - ), - FTL.Message( - id=FTL.Identifier("navigation-android-extensions"), - value=REPLACE("navigation.lang", "Android Extensions", {"Android": TERM_REFERENCE("brand-name-android")}), - ), - FTL.Message( - id=FTL.Identifier("navigation-your-firefox-account"), - value=REPLACE("navigation.lang", "Your Firefox Account", {"Firefox Account": TERM_REFERENCE("brand-name-firefox-account")}), - ), - FTL.Message( - id=FTL.Identifier("navigation-make-the-most-of-your"), - value=REPLACE( - "navigation.lang", - "Make the most of your Firefox experience, across every device.", - {"Firefox": TERM_REFERENCE("brand-name-firefox")}, - ), - ), - FTL.Message( - id=FTL.Identifier("navigation-learn-how-to-customize"), - value=REPLACE("navigation.lang", "Learn how to customize the way Firefox works.", {"Firefox": TERM_REFERENCE("brand-name-firefox")}), - ), - FTL.Message( - id=FTL.Identifier("navigation-experience-augmented"), - value=REPLACE( - "navigation.lang", "Experience augmented and virtual reality with Firefox.", {"Firefox": TERM_REFERENCE("brand-name-firefox")} - ), - ), - FTL.Message( - id=FTL.Identifier("navigation-meet-people-in-experimental"), - value=REPLACE( - "navigation.lang", - "Meet people in experimental Mixed Reality chatrooms with Firefox.", - {"Firefox": TERM_REFERENCE("brand-name-firefox")}, - ), - ), - FTL.Message( - id=FTL.Identifier("navigation-mozilla-webvr"), - value=REPLACE("navigation.lang", "Mozilla WebVR", {"Mozilla": TERM_REFERENCE("brand-name-mozilla")}), - ), - FTL.Message( - id=FTL.Identifier("navigation-mozilla-brings-firefox"), - value=REPLACE( - "navigation.lang", - "Mozilla brings Firefox to augmented and virtual reality.", - {"Mozilla": TERM_REFERENCE("brand-name-mozilla"), "Firefox": TERM_REFERENCE("brand-name-firefox")}, - ), - ), - FTL.Message( - id=FTL.Identifier("navigation-firefox-built-just-for"), - value=REPLACE("navigation.lang", "Firefox, built just for developers.", {"Firefox": TERM_REFERENCE("brand-name-firefox")}), - ), - FTL.Message( - id=FTL.Identifier("navigation-preview-the-latest-build"), - value=REPLACE( - "navigation.lang", - "Preview the latest build of Firefox and help us make it the best.", - {"Firefox": TERM_REFERENCE("brand-name-firefox")}, - ), - ), - FTL.Message( - id=FTL.Identifier("navigation-firefox-playground"), - value=REPLACE("navigation.lang", "Firefox Playground", {"Firefox": TERM_REFERENCE("brand-name-firefox")}), - ), - FTL.Message( - id=FTL.Identifier("navigation-mozilla-open-source-support"), - value=REPLACE("navigation.lang", "Mozilla Open Source Support (MOSS)", {"Mozilla": TERM_REFERENCE("brand-name-mozilla")}), - ), - FTL.Message( - id=FTL.Identifier("navigation-mozilla-manifesto"), - value=REPLACE("navigation.lang", "Mozilla Manifesto", {"Mozilla": TERM_REFERENCE("brand-name-mozilla")}), - ), - ], - ) - - ctx.add_transforms( - "navigation.ftl", - "navigation.ftl", - transforms_from( - """ -navigation-menu = {COPY(navigation, "Menu",)} -navigation-check-out-the-benefits = {COPY(navigation, "Check out the Benefits",)} -navigation-browsers = {COPY(navigation, "Browsers",)} -navigation-close-browsers-menu = {COPY(navigation, "Close Browsers menu",)} -navigation-download = {COPY(navigation, "Download",)} -navigation-extensions = {COPY(navigation, "Extensions",)} -navigation-support = {COPY(navigation, "Support",)} -navigation-privacy = {COPY(navigation, "Privacy",)} -navigation-get-unmatched-data-protection = {COPY(navigation, "Get unmatched data protection on the release cadence that suits your organization.",)} -navigation-made-with-respect = {COPY(navigation, "Made with respect",)} -navigation-close-products-menu = {COPY(navigation, "Close Products menu",)} -navigation-see-if-your-personal = {COPY(navigation, "See if your personal info has been leaked online, and sign up for future breach alerts.",)} -navigation-check-for-breaches = {COPY(navigation, "Check for Breaches",)} -navigation-see-breaches = {COPY(navigation, "See Breaches",)} -navigation-security-tips = {COPY(navigation, "Security Tips",)} -navigation-share-large-files-safely = {COPY(navigation, "Share large files safely, with links that ‘self-destruct’.",)} -navigation-save-quality-content = {COPY(navigation, "Save quality content from anywhere. Fuel your mind everywhere.",)} -navigation-sign-up = {COPY(navigation, "Sign Up",)} -navigation-connected-and-protected = {COPY(navigation, "Connected and protected",)} -navigation-join = {COPY(navigation, "Join",)} -navigation-close-join-menu = {COPY(navigation, "Close Join menu",)} -navigation-sign-in = {COPY(navigation, "Sign In",)} -navigation-benefits = {COPY(navigation, "Benefits",)} -navigation-protect-your-life-online = {COPY(navigation, "Protect your life online with a whole family of privacy-first products.",)} -navigation-about = {COPY(navigation, "About",)} -navigation-close-about-menu = {COPY(navigation, "Close About menu",)} -navigation-meet-the-technology-company = {COPY(navigation, "Meet the technology company that puts people before profit.",)} -navigation-new-features = {COPY(navigation, "New Features",)} -navigation-save-content-absorb-knowledge = {COPY(navigation, "Save content. Absorb knowledge.",)} -navigation-same-speed-and-safety = {COPY(navigation, "Same speed and safety you trust, designed just for business.",)} -navigation-add-ons = {COPY(navigation, "Add-ons",)} -navigation-projects = {COPY(navigation, "Projects",)} -navigation-close-projects-menu = {COPY(navigation, "Close Projects menu",)} -navigation-donate-your-voice-to = {COPY(navigation, "Donate your voice to help make voice recognition open to everyone.",)} -navigation-web-of-things-iot = {COPY(navigation, "Web of Things (IoT)",)} -navigation-make-devices-connected = {COPY(navigation, "Make devices connected to the internet safe, secure and interoperable.",)} -navigation-developers = {COPY(navigation, "Developers",)} -navigation-close-developers-menu = {COPY(navigation, "Close Developers menu",)} -navigation-test-soon-to-be-released = {COPY(navigation, "Test soon-to-be-released features in our most stable pre-release build.",)} -navigation-developer-innovations = {COPY(navigation, "Developer Innovations",)} -navigation-projects-that-help-keep = {COPY(navigation, "Projects that help keep the internet open and accessible for all.",)} -navigation-mixed-reality = {COPY(navigation, "Mixed Reality",)} -navigation-resources = {COPY(navigation, "Resources",)} -navigation-resources-for-developers = {COPY(navigation, "Resources for developers, by developers.",)} -navigation-developer-blog = {COPY(navigation, "Developer Blog",)} -navigation-build-test-scale-and = {COPY(navigation, "Build, test, scale and more with the only browser built just for developers.",)} -navigation-leadership = {COPY(navigation, "Leadership",)} -navigation-mission = {COPY(navigation, "Mission",)} -navigation-press-center = {COPY(navigation, "Press Center",)} -navigation-contact = {COPY(navigation, "Contact",)} -navigation-careers = {COPY(navigation, "Careers",)} -navigation-work-for-a-mission-driven = {COPY(navigation, "Work for a mission-driven organization that builds purpose-driven products.",)} -navigation-get-involved = {COPY(navigation, "Get involved",)} -navigation-join-the-fight-for-a = {COPY(navigation, "Join the fight for a healthy internet.",)} -navigation-events = {COPY(navigation, "Events",)} -navigation-donate = {COPY(navigation, "Donate",)} -navigation-your-right-to-security = {COPY(navigation, "Your right to security and privacy on the internet is fundamental – never optional.",)} - -navigation-release-notes = {COPY(main, "Release Notes",)} -navigation-features = {COPY(main, "Features",)} -navigation-products = {COPY(main, "Products",)} - -navigation-mozilla = { -brand-name-mozilla } -navigation-mozilla-foundation = { -brand-name-mozilla-foundation } -navigation-mozilla-corporation = { -brand-name-mozilla-corporation } -navigation-firefox-developer-edition = { -brand-name-firefox-developer-edition } -navigation-firefox-beta = { -brand-name-firefox-beta } -navigation-firefox-nightly = { -brand-name-firefox-nightly } -navigation-firefox-reality = { -brand-name-firefox-reality } -navigation-firefox-lockwise = { -brand-name-firefox-lockwise } -navigation-firefox-monitor = { -brand-name-firefox-monitor } -navigation-firefox-send = { -brand-name-firefox-send } -navigation-pocket = { -brand-name-pocket } -navigation-common-voice = { -brand-name-common-voice } -navigation-hubs = { -brand-name-hubs } -navigation-rust = { -brand-name-rust } -navigation-web-assembly = { -brand-name-web-assembly } -navigation-mdn-web-docs = { -brand-name-mdn-web-docs } -""", - navigation=navigation, - main=main, - ), - ) diff --git a/lib/fluent_migrations/legal/__init__.py b/lib/fluent_migrations/legal/__init__.py deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/lib/fluent_migrations/legal/index.py b/lib/fluent_migrations/legal/index.py deleted file mode 100644 index 5308f46cc1..0000000000 --- a/lib/fluent_migrations/legal/index.py +++ /dev/null @@ -1,116 +0,0 @@ -from __future__ import absolute_import - -import fluent.syntax.ast as FTL -from fluent.migrate import COPY, REPLACE -from fluent.migrate.helpers import TERM_REFERENCE, VARIABLE_REFERENCE, transforms_from - -index = "legal/index.lang" - - -def migrate(ctx): - """Migrate bedrock/legal/templates/legal/index.html, part {index}.""" - - ctx.add_transforms( - "mozorg/about/legal.ftl", - "mozorg/about/legal.ftl", - transforms_from( - """ -legal-legal = {COPY(index, "Legal",)} -legal-get-involved = {COPY(index, "Get involved",)} -legal-protect-the-fox = {COPY(index, "Protect the Fox",)} -legal-takedown-requests = {COPY(index, "Takedown requests",)} -legal-back-to-legal = {COPY(index, "Back to Legal",)} -""", - index=index, - ) - + [ - FTL.Message( - id=FTL.Identifier("legal-special-thanks-to-all-of-you"), - value=REPLACE( - index, - "Special thanks to all of you who help report abuses of Mozilla marks, participate in governance forums, give feedback on our localizations & legal terms, and contribute your skills to the success of the Mozilla project.", - { - "Mozilla": TERM_REFERENCE("brand-name-mozilla"), - }, - ), - ), - ] - + transforms_from( - """ -legal-terms = {COPY(index, "Terms",)} -legal-our-websites = {COPY(index, "Our Websites",)} -""", - index=index, - ) - + [ - FTL.Message( - id=FTL.Identifier("legal-firefox-services"), - value=REPLACE( - index, - "Firefox Services", - { - "Firefox": TERM_REFERENCE("brand-name-firefox"), - }, - ), - ), - FTL.Message( - id=FTL.Identifier("legal-webmaker"), - value=REPLACE( - index, - "Webmaker", - { - "Webmaker": TERM_REFERENCE("brand-name-webmaker"), - }, - ), - ), - ] - + transforms_from( - """ -legal-privacy-trademarks = {COPY(index, "Privacy & trademarks",)} -legal-privacy-notices-and-policy = {COPY(index, "Privacy Notices and Policy",)} -legal-downloadable-software-notices = {COPY(index, "Downloadable software notices",)} -""", - index=index, - ) - + [ - FTL.Message( - id=FTL.Identifier("legal-firefox"), - value=REPLACE( - index, - "Firefox", - { - "Firefox": TERM_REFERENCE("brand-name-firefox"), - }, - ), - ), - FTL.Message( - id=FTL.Identifier("legal-thunderbird"), - value=REPLACE( - index, - "Thunderbird", - { - "Thunderbird": TERM_REFERENCE("brand-name-thunderbird"), - }, - ), - ), - ] - + transforms_from( - """ -legal-websites-and-communications = {COPY(index, "Websites & Communications Terms of Use",)} -legal-acceptable-use-policy = {COPY(index, "Acceptable Use Policy",)} -""", - index=index, - ) - + [ - FTL.Message( - id=FTL.Identifier("legal-firefox-cloud-services"), - value=REPLACE( - index, - "Firefox Cloud Services: Terms of Service", - { - "Firefox": TERM_REFERENCE("brand-name-firefox"), - }, - ), - ), - ], - ) diff --git a/lib/fluent_migrations/mozorg/__init__.py b/lib/fluent_migrations/mozorg/__init__.py deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/lib/fluent_migrations/mozorg/about/__init__.py b/lib/fluent_migrations/mozorg/about/__init__.py deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/lib/fluent_migrations/mozorg/about/governance/__init__.py b/lib/fluent_migrations/mozorg/about/governance/__init__.py deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/lib/fluent_migrations/mozorg/about/governance/policies/__init__.py b/lib/fluent_migrations/mozorg/about/governance/policies/__init__.py deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/lib/fluent_migrations/mozorg/about/governance/policies/community-hotline.py b/lib/fluent_migrations/mozorg/about/governance/policies/community-hotline.py deleted file mode 100644 index c8c0286138..0000000000 --- a/lib/fluent_migrations/mozorg/about/governance/policies/community-hotline.py +++ /dev/null @@ -1,53 +0,0 @@ -from __future__ import absolute_import - -import fluent.syntax.ast as FTL -from fluent.migrate import COPY, REPLACE -from fluent.migrate.helpers import TERM_REFERENCE, VARIABLE_REFERENCE, transforms_from - -community_hotline = "mozorg/about/governance/policies/community-hotline.lang" - - -def migrate(ctx): - """Migrate bedrock/mozorg/templates/mozorg/about/governance/policies/community-hotline.html, part {index}.""" - - ctx.add_transforms( - "mozorg/about/governance/policies/community-hotline.ftl", - "mozorg/about/governance/policies/community-hotline.ftl", - transforms_from( - """ -community-hotline-community-participation = {COPY(community_hotline, "Community Participation Guidelines - How to Report",)} -community-hotline-community-participation = {COPY(community_hotline, "Community Participation Guidelines Hotline",)} -""", - community_hotline=community_hotline, - ) - + [ - FTL.Message( - id=FTL.Identifier("community-hotline-the-heart-of-mozilla"), - value=REPLACE( - community_hotline, - "The heart of Mozilla is people. We put people first and do our best to recognize, appreciate and respect the diversity of our global contributors. The Mozilla Project welcomes contributions from everyone who shares our goals and wants to contribute in a healthy and constructive manner within our community.", - { - "Mozilla": TERM_REFERENCE("brand-name-mozilla"), - }, - ), - ), - FTL.Message( - id=FTL.Identifier("community-hotline-to-report-violations"), - value=REPLACE( - community_hotline, - 'To report violations of the Community Participation Guidelines in Mozilla’s communities, please click the “Report” button below. For more information on how to take and give a report, please read “How to Report”.', - { - "%%": "%", - "%(howto)s": VARIABLE_REFERENCE("howto"), - "Mozilla": TERM_REFERENCE("brand-name-mozilla"), - }, - ), - ), - ] - + transforms_from( - """ -community-hotline-report = {COPY(community_hotline, "Report",)} -""", - community_hotline=community_hotline, - ), - ) diff --git a/lib/fluent_migrations/mozorg/about/governance/policies/participation.py b/lib/fluent_migrations/mozorg/about/governance/policies/participation.py deleted file mode 100644 index df778488d0..0000000000 --- a/lib/fluent_migrations/mozorg/about/governance/policies/participation.py +++ /dev/null @@ -1,485 +0,0 @@ -from __future__ import absolute_import - -import fluent.syntax.ast as FTL -from fluent.migrate import COPY, REPLACE -from fluent.migrate.helpers import TERM_REFERENCE, VARIABLE_REFERENCE, transforms_from - -participation = "mozorg/about/governance/policies/participation.lang" - - -def migrate(ctx): - """Migrate bedrock/mozorg/templates/mozorg/about/governance/policies/participation.html, part {index}.""" - - ctx.add_transforms( - "mozorg/about/governance/policies/participation.ftl", - "mozorg/about/governance/policies/participation.ftl", - transforms_from( - """ -participation-community-participation = {COPY(participation, "Community Participation Guidelines",)} -""", - participation=participation, - ) - + [ - FTL.Message( - id=FTL.Identifier("participation-mozilla-community"), - value=REPLACE( - participation, - "Mozilla Community Participation Guidelines", - { - "Mozilla": TERM_REFERENCE("brand-name-mozilla"), - }, - ), - ), - ] - + transforms_from( - """ -participation-version-31-updated = {COPY(participation, "Version 3.1 – Updated January 16, 2020",)} -""", - participation=participation, - ) - + [ - FTL.Message( - id=FTL.Identifier("participation-the-heart-of-mozilla"), - value=REPLACE( - participation, - "The heart of Mozilla is people. We put people first and do our best to recognize, appreciate and respect the diversity of our global contributors. The Mozilla Project welcomes contributions from everyone who shares our goals and wants to contribute in a healthy and constructive manner within our community. As such, we have adopted this code of conduct and require all those who participate to agree and adhere to these Community Participation Guidelines in order to help us create a safe and positive community experience for all.", - { - "Mozilla": TERM_REFERENCE("brand-name-mozilla"), - }, - ), - ), - ] - + transforms_from( - """ -participation-these-guidelines-aim = {COPY(participation, "These guidelines aim to support a community where all people should feel safe to participate, introduce new ideas and inspire others, regardless of:",)} -participation-background = {COPY(participation, "Background",)} -participation-family-status = {COPY(participation, "Family status",)} -participation-gender = {COPY(participation, "Gender",)} -participation-gender-identity-or = {COPY(participation, "Gender identity or expression",)} -participation-marital-status = {COPY(participation, "Marital status",)} -participation-sex = {COPY(participation, "Sex",)} -participation-sexual-orientation = {COPY(participation, "Sexual orientation",)} -participation-native-language = {COPY(participation, "Native language",)} -participation-age = {COPY(participation, "Age",)} -participation-ability = {COPY(participation, "Ability",)} -participation-race-andor-ethnicity = {COPY(participation, "Race and/or ethnicity",)} -participation-caste = {COPY(participation, "Caste",)} -participation-national-origin = {COPY(participation, "National origin",)} -participation-socioeconomic-status = {COPY(participation, "Socioeconomic status",)} -participation-religion = {COPY(participation, "Religion",)} -participation-geographic-location = {COPY(participation, "Geographic location",)} -participation-any-other-dimension = {COPY(participation, "Any other dimension of diversity",)} -""", - participation=participation, - ) - + [ - FTL.Message( - id=FTL.Identifier("participation-openness-collaboration"), - value=REPLACE( - participation, - "Openness, collaboration and participation are core aspects of our work — from development on Firefox to collaboratively designing curriculum. We gain strength from diversity and actively seek participation from those who enhance it. These guidelines exist to enable diverse individuals and groups to interact and collaborate to mutual advantage. This document outlines both expected and prohibited behavior.", - { - "Firefox": TERM_REFERENCE("brand-name-firefox"), - }, - ), - ), - ] - + transforms_from( - """ -participation-when-and-how-to-use = {COPY(participation, "When and How to Use These Guidelines",)} -""", - participation=participation, - ) - + [ - FTL.Message( - id=FTL.Identifier("participation-these-guidelines-outline"), - value=REPLACE( - participation, - "These guidelines outline our behavior expectations as members of the Mozilla community in all Mozilla activities, both offline and online. Your participation is contingent upon following these guidelines in all Mozilla activities, including but not limited to:", - { - "Mozilla": TERM_REFERENCE("brand-name-mozilla"), - }, - ), - ), - FTL.Message( - id=FTL.Identifier("participation-working-in-mozilla"), - value=REPLACE( - participation, - "Working in Mozilla spaces.", - { - "Mozilla": TERM_REFERENCE("brand-name-mozilla"), - }, - ), - ), - FTL.Message( - id=FTL.Identifier("participation-working-with-other"), - value=REPLACE( - participation, - "Working with other Mozillians and other Mozilla community participants virtually or co-located.", - { - "Mozilla": TERM_REFERENCE("brand-name-mozilla"), - }, - ), - ), - FTL.Message( - id=FTL.Identifier("participation-representing-mozilla"), - value=REPLACE( - participation, - "Representing Mozilla at public events.", - { - "Mozilla": TERM_REFERENCE("brand-name-mozilla"), - }, - ), - ), - FTL.Message( - id=FTL.Identifier("participation-representing-mozilla-social"), - value=REPLACE( - participation, - "Representing Mozilla in social media (official accounts, staff accounts, personal accounts, Facebook pages).", - { - "Facebook": TERM_REFERENCE("brand-name-facebook"), - "Mozilla": TERM_REFERENCE("brand-name-mozilla"), - }, - ), - ), - FTL.Message( - id=FTL.Identifier("participation-participating-in-mozilla"), - value=REPLACE( - participation, - "Participating in Mozilla offsites and trainings.", - { - "Mozilla": TERM_REFERENCE("brand-name-mozilla"), - }, - ), - ), - FTL.Message( - id=FTL.Identifier("participation-participating-in-mozilla-related"), - value=REPLACE( - participation, - "Participating in Mozilla-related forums, mailing lists, wikis, websites, chat channels, bugs, group or person-to-person meetings, and Mozilla-related correspondence.", - { - "Mozilla": TERM_REFERENCE("brand-name-mozilla"), - }, - ), - ), - FTL.Message( - id=FTL.Identifier("participation-these-guidelines-work"), - value=REPLACE( - participation, - 'These guidelines work in conjunction with our Anti-Harassment/Discrimination Policies[1], which sets out protections for, and obligations of, Mozilla employees. The Anti-Harassment/Discrimination Policy is crafted with specific legal definitions and requirements in mind.', - { - "%%": "%", - "%(note1)s": VARIABLE_REFERENCE("note1"), - "Mozilla": TERM_REFERENCE("brand-name-mozilla"), - }, - ), - ), - FTL.Message( - id=FTL.Identifier("participation-while-these-guidelines"), - value=REPLACE( - participation, - "While these guidelines / code of conduct are specifically aimed at Mozilla’s work and community, we recognize that it is possible for actions taken outside of Mozilla’s online or inperson spaces to have a deep impact on community health. (For example, in the past, we publicly identified an anonymous posting aimed at a Mozilla employee in a non-Mozilla forum as clear grounds for removal from the Mozilla community.) This is an active topic in the diversity and inclusion realm. We anticipate wide-ranging discussions among our communities about appropriate boundaries.", - { - "Mozilla": TERM_REFERENCE("brand-name-mozilla"), - }, - ), - ), - ] - + transforms_from( - """ -participation-expected-behavior = {COPY(participation, "Expected Behavior",)} -participation-the-following-behaviors = {COPY(participation, "The following behaviors are expected of all Mozillians:",)} -participation-be-respectful = {COPY(participation, "Be Respectful",)} -participation-value-each-others = {COPY(participation, "Value each other’s ideas, styles and viewpoints. We may not always agree, but disagreement is no excuse for poor manners. Be open to different possibilities and to being wrong. Be respectful in all interactions and communications, especially when debating the merits of different options. Be aware of your impact and how intense interactions may be affecting people. Be direct, constructive and positive. Take responsibility for your impact and your mistakes – if someone says they have been harmed through your words or actions, listen carefully, apologize sincerely, and correct the behavior going forward.",)} -participation-be-direct-but-professional = {COPY(participation, "Be Direct but Professional",)} -participation-we-are-likely-to-have = {COPY(participation, "We are likely to have some discussions about if and when criticism is respectful and when it’s not. We must be able to speak directly when we disagree and when we think we need to improve. We cannot withhold hard truths. Doing so respectfully is hard, doing so when others don’t seem to be listening is harder, and hearing such comments when one is the recipient can be even harder still. We need to be honest and direct, as well as respectful.",)} -participation-be-inclusive = {COPY(participation, "Be Inclusive",)} -participation-seek-diverse-perspectives = {COPY(participation, "Seek diverse perspectives. Diversity of views and of people on teams powers innovation, even if it is not always comfortable. Encourage all voices. Help new perspectives be heard and listen actively. If you find yourself dominating a discussion, it is especially important to step back and encourage other voices to join in. Be aware of how much time is taken up by dominant members of the group. Provide alternative ways to contribute or participate when possible.",)} -participation-be-inclusive-of-everyone = {COPY(participation, "Be inclusive of everyone in an interaction, respecting and facilitating people’s participation whether they are:",)} -participation-remote-on-video-or = {COPY(participation, "Remote (on video or phone)",)} -participation-not-native-language = {COPY(participation, "Not native language speakers",)} -participation-coming-from-a-different = {COPY(participation, "Coming from a different culture",)} -participation-using-pronouns-other = {COPY(participation, "Using pronouns other than “he” or “she”",)} -participation-living-in-a-different = {COPY(participation, "Living in a different time zone",)} -participation-facing-other-challenges = {COPY(participation, "Facing other challenges to participate",)} -participation-think-about-how-you = {COPY(participation, "Think about how you might facilitate alternative ways to contribute or participate. If you find yourself dominating a discussion, step back. Make way for other voices and listen actively to them.",)} -participation-understand-different = {COPY(participation, "Understand Different Perspectives",)} -participation-our-goal-should-not = {COPY(participation, "Our goal should not be to “win” every disagreement or argument. A more productive goal is to be open to ideas that make our own ideas better. Strive to be an example for inclusive thinking. “Winning” is when different perspectives make our work richer and stronger.",)} -participation-appreciate-and-accommodate = {COPY(participation, "Appreciate and Accommodate Our Similarities and Differences",)} -participation-mozillians-come-from = {COPY(participation, "Mozillians come from many cultures and backgrounds. Cultural differences can encompass everything from official religious observances to personal habits to clothing. Be respectful of people with different cultural practices, attitudes and beliefs. Work to eliminate your own biases, prejudices and discriminatory practices. Think of others’ needs from their point of view. Use preferred titles (including pronouns) and the appropriate tone of voice. Respect people’s right to privacy and confidentiality. Be open to learning from and educating others as well as educating yourself; it is unrealistic to expect Mozillians to know the cultural practices of every ethnic and cultural group, but everyone needs to recognize one’s native culture is only part of positive interactions.",)} -participation-lead-by-example = {COPY(participation, "Lead by Example",)} -""", - participation=participation, - ) - + [ - FTL.Message( - id=FTL.Identifier("participation-by-matching-your-actions"), - value=REPLACE( - participation, - 'By matching your actions with your words, you become a person others want to follow. Your actions influence others to behave and respond in ways that are valuable and appropriate for our organizational outcomes. Design your community and your work for inclusion. Hold yourself and others accountable for inclusive behaviors. Make decisions based on the highest good for Mozilla’s mission.', - { - "%%": "%", - "%(mission)s": VARIABLE_REFERENCE("mission"), - "Mozilla": TERM_REFERENCE("brand-name-mozilla"), - }, - ), - ), - ] - + transforms_from( - """ -participation-behavior-that-will = {COPY(participation, "Behavior That Will Not Be Tolerated",)} -participation-the-following-behaviors-are = {COPY(participation, "The following behaviors are considered to be unacceptable under these guidelines.",)} -participation-violence-and-threats = {COPY(participation, "Violence and Threats of Violence",)} -participation-violence-and-threats-of = {COPY(participation, "Violence and threats of violence are not acceptable - online or offline. This includes incitement of violence toward any individual, including encouraging a person to commit self-harm. This also includes posting or threatening to post other people’s personally identifying information (“doxxing”) online.",)} -participation-personal-attacks = {COPY(participation, "Personal Attacks",)} -participation-conflicts-will-inevitably = {COPY(participation, "Conflicts will inevitably arise, but frustration should never turn into a personal attack. It is not okay to insult, demean or belittle others. Attacking someone for their opinions, beliefs and ideas is not acceptable. It is important to speak directly when we disagree and when we think we need to improve, but such discussions must be conducted respectfully and professionally, remaining focused on the issue at hand.",)} -participation-derogatory-language = {COPY(participation, "Derogatory Language",)} -participation-hurtful-or-harmful = {COPY(participation, "Hurtful or harmful language related to:",)} -participation-other-attributes = {COPY(participation, "Other attributes",)} -participation-is-not-acceptable = {COPY(participation, "is not acceptable. This includes deliberately referring to someone by a gender that they do not identify with, and/or questioning the legitimacy of an individual’s gender identity. If you’re unsure if a word is derogatory, don’t use it. This also includes repeated subtle and/or indirect discrimination; when asked to stop, stop the behavior in question.",)} -participation-unwelcome-sexual-attention = {COPY(participation, "Unwelcome Sexual Attention or Physical Contact",)} -participation-unwelcome-sexual-attention-or = {COPY(participation, "Unwelcome sexual attention or unwelcome physical contact is not acceptable. This includes sexualized comments, jokes or imagery in interactions, communications or presentation materials, as well as inappropriate touching, groping, or sexual advances. This includes touching a person without permission, including sensitive areas such as their hair, pregnant stomach, mobility device (wheelchair, scooter, etc) or tattoos. This also includes physically blocking or intimidating another person. Physical contact or simulated physical contact (such as emojis like “kiss”) without affirmative consent is not acceptable. This includes sharing or distribution of sexualized images or text.",)} -participation-disruptive-behavior = {COPY(participation, "Disruptive Behavior",)} -participation-sustained-disruption = {COPY(participation, "Sustained disruption of events, forums, or meetings, including talks and presentations, will not be tolerated. This includes:",)} -participation-talking-over-or-heckling = {COPY(participation, "‘Talking over’ or ‘heckling’ speakers.",)} -participation-drinking-alcohol-to = {COPY(participation, "Drinking alcohol to excess or using recreational drugs to excess, or pushing others to do so.",)} -participation-making-derogatory = {COPY(participation, "Making derogatory comments about those who abstain from alcohol or other substances, pushing people to drink, talking about their abstinence or preferences to others, or pressuring them to drink - physically or through jeering.",)} -participation-otherwise-influencing = {COPY(participation, "Otherwise influencing crowd actions that cause hostility in the session.",)} -participation-influencing-unacceptable = {COPY(participation, "Influencing Unacceptable Behavior",)} -participation-we-will-treat-influencing = {COPY(participation, "We will treat influencing or leading such activities the same way we treat the activities themselves, and thus the same consequences apply.",)} -participation-consequences-of-unacceptable = {COPY(participation, "Consequences of Unacceptable Behavior",)} -""", - participation=participation, - ) - + [ - FTL.Message( - id=FTL.Identifier("participation-bad-behavior-from"), - value=REPLACE( - participation, - "Bad behavior from any Mozillian, including those with decision-making authority, will not be tolerated. Intentional efforts to exclude people (except as part of a consequence of the guidelines or other official action) from Mozilla activities are not acceptable and will be dealt with appropriately.", - { - "Mozilla": TERM_REFERENCE("brand-name-mozilla"), - }, - ), - ), - ] - + transforms_from( - """ -participation-reports-of-harassmentdiscrimination = {COPY(participation, "Reports of harassment/discrimination will be promptly and thoroughly investigated by the people responsible for the safety of the space, event or activity. Appropriate measures will be taken to address the situation.",)} -participation-anyone-asked-to-stop = {COPY(participation, "Anyone asked to stop unacceptable behavior is expected to comply immediately. Violation of these guidelines can result in you being ask to leave an event or online space, either temporarily or for the duration of the event, or being banned from participation in spaces, or future events and activities in perpetuity.",)} -""", - participation=participation, - ) - + [ - FTL.Message( - id=FTL.Identifier("participation-mozilla-staff-are"), - value=REPLACE( - participation, - 'Mozilla Staff are held accountable, in addition to these guidelines, to Mozilla’s staff Anti-Harassment/Discrimination Policies [1]. Mozilla staff in violation of these guidelines may be subject to further consequences, such as disciplinary action, up to and including termination of employment. For contractors or vendors, violation of these guidelines may affect continuation or renewal of contract.', - { - "%%": "%", - "%(note1)s": VARIABLE_REFERENCE("note1"), - "Mozilla": TERM_REFERENCE("brand-name-mozilla"), - }, - ), - ), - ] - + transforms_from( - """ -participation-in-addition-any-participants = {COPY(participation, "In addition, any participants who abuse the reporting process will be considered to be in violation of these guidelines and subject to the same consequences. False reporting, especially to retaliate or exclude, will not be accepted or tolerated.",)} -participation-reporting = {COPY(participation, "Reporting",)} -""", - participation=participation, - ) - + [ - FTL.Message( - id=FTL.Identifier("participation-if-you-believe-youre"), - value=REPLACE( - participation, - 'If you believe you’re experiencing unacceptable behavior that will not be tolerated as outlined above, please use our hotline to report. Reports go directly to Mozilla’s Employment Counsel and HR People Partners and are triaged by the Community Participation Guidelines Response Lead.', - { - "%%": "%", - "%(hotline)s": VARIABLE_REFERENCE("hotline"), - "Mozilla": TERM_REFERENCE("brand-name-mozilla"), - }, - ), - ), - ] - + transforms_from( - """ -participation-after-receiving-a = {COPY(participation, "After receiving a concise description of your situation, they will review and determine next steps. In addition to conducting any investigation, they can provide a range of resources, from a private consultation to other community resources. They will involve other colleagues or outside specialists (such as legal counsel), as needed to appropriately address each situation.",)} -""", - participation=participation, - ) - + [ - FTL.Message( - id=FTL.Identifier("participation-additional-resources"), - value=REPLACE( - participation, - 'Additional Resources: How to Report', - { - "%%": "%", - "%s": VARIABLE_REFERENCE("missing-var"), - }, - ), - ), - FTL.Message( - id=FTL.Identifier("participation-questions-cpg-questionsmozillacom"), - value=REPLACE( - participation, - 'Questions: cpg-questions@mozilla.com', - { - "%%": "%", - "%s": VARIABLE_REFERENCE("missing-var"), - }, - ), - ), - ] - + transforms_from( - """ -participation-please-also-report = {COPY(participation, "Please also report to us if you observe a potentially dangerous situation, someone in distress, or violations of these guidelines, even if the situation is not happening to you.",)} -participation-if-you-feel-you-have = {COPY(participation, "If you feel you have been unfairly accused of violating these guidelines, please follow the same reporting process.",)} -""", - participation=participation, - ) - + [ - FTL.Message( - id=FTL.Identifier("participation-mozilla-spaces"), - value=REPLACE( - participation, - "Mozilla Spaces", - { - "Mozilla": TERM_REFERENCE("brand-name-mozilla"), - }, - ), - ), - FTL.Message( - id=FTL.Identifier("participation-each-physical-or-virtual"), - value=REPLACE( - participation, - "Each physical or virtual Mozilla space shall have a designated contact.", - { - "Mozilla": TERM_REFERENCE("brand-name-mozilla"), - }, - ), - ), - FTL.Message( - id=FTL.Identifier("participation-mozilla-events"), - value=REPLACE( - participation, - "Mozilla Events", - { - "Mozilla": TERM_REFERENCE("brand-name-mozilla"), - }, - ), - ), - FTL.Message( - id=FTL.Identifier("participation-all-mozilla-events"), - value=REPLACE( - participation, - "All Mozilla events will have designated a specific safety guideline with emergency and anti-abuse contacts at the event as well as online. These contacts will be posted prominently throughout the event, and in print and online materials. Event leaders are requested to speak at the event about the guidelines and to ask participants to review and agree to them when they sign up for the event.", - { - "Mozilla": TERM_REFERENCE("brand-name-mozilla"), - }, - ), - ), - FTL.Message( - id=FTL.Identifier("participation-reports-will-receive"), - value=REPLACE( - participation, - 'Reports will receive an email notice of receipt. Once an incident has been investigated and a decision has been communicated to the relevant parties, all have the opportunity to appeal this decision by sending an email to cpg-questions@mozilla.com.', - { - "%%": "%", - "%(mailto_questions)s": VARIABLE_REFERENCE("mailto_questions"), - }, - ), - ), - ] - + transforms_from( - """ -participation-ask-questions = {COPY(participation, "Ask questions",)} -""", - participation=participation, - ) - + [ - FTL.Message( - id=FTL.Identifier("participation-everyone-is-encouraged"), - value=REPLACE( - participation, - 'Everyone is encouraged to ask questions about these guidelines. If you are organizing an event or activity, reach out for tips building inclusion for your event, activity or space. Your input is welcome and you will always get a response within 24 hours (or on the next weekday, if it is the weekend) if you reach out to cpg-questions@mozilla.com. Please review this change log for updates to this document.', - { - "%%": "%", - "%(mailto_questions)s": VARIABLE_REFERENCE("mailto_questions"), - "%(changelog)s": VARIABLE_REFERENCE("changelog"), - }, - ), - ), - ] - + transforms_from( - """ -participation-license-and-attribution = {COPY(participation, "License and attribution",)} -""", - participation=participation, - ) - + [ - FTL.Message( - id=FTL.Identifier("participation-this-set-of-guidelines"), - value=REPLACE( - participation, - 'This set of guidelines is distributed under a Creative Commons Attribution-ShareAlike license.', - { - "%%": "%", - "%(license)s": VARIABLE_REFERENCE("license"), - "Creative Commons": TERM_REFERENCE("brand-name-creative-commons"), - }, - ), - ), - FTL.Message( - id=FTL.Identifier("participation-these-guidelines-have"), - value=REPLACE( - participation, - 'These guidelines have been adapted with modifications from Mozilla’s original Community Participation Guidelines, the Ubuntu Code of Conduct, Mozilla’s View Source Conference Code of Conduct, and the Rust Language Code of Conduct, which are based on Stumptown Syndicate’s Citizen Code of Conduct. Additional text from the LGBTQ in Technology Code of Conduct and the WisCon code of conduct. This document and all associated processes are only possible with the hard work of many, many Mozillians.', - { - "%%": "%", - "%(ubuntu_coc)s": VARIABLE_REFERENCE("ubuntu_coc"), - "%(viewsource_coc)s": VARIABLE_REFERENCE("viewsource_coc"), - "%(rustlang_coc)s": VARIABLE_REFERENCE("rustlang_coc"), - "%(citizen_coc)s": VARIABLE_REFERENCE("citizen_coc"), - "%(lgbtqtech_coc)s": VARIABLE_REFERENCE("lgbtqtech_coc"), - "%(wiscon_coc)s": VARIABLE_REFERENCE("wiscon_coc"), - "Mozilla": TERM_REFERENCE("brand-name-mozilla"), - "Rust": TERM_REFERENCE("brand-name-rust"), - }, - ), - ), - ] - + transforms_from( - """ -participation-modifications-to-these = {COPY(participation, "Modifications to these guidelines",)} -""", - participation=participation, - ) - + [ - FTL.Message( - id=FTL.Identifier("participation-mozilla-may-amend"), - value=REPLACE( - participation, - "Mozilla may amend the guidelines from time to time and may also vary the procedures it sets out where appropriate in a particular case. Your agreement to comply with the guidelines will be deemed agreement to any changes to it. This policy does not form part of any Mozilla employee’s contract of employment or otherwise have contractual effect.", - { - "Mozilla": TERM_REFERENCE("brand-name-mozilla"), - }, - ), - ), - FTL.Message( - id=FTL.Identifier("participation-1-the-anti-harassment"), - value=REPLACE( - participation, - '[1] The anti-harassment policy is accessible to paid staff here.', - { - "%%": "%", - "%s": VARIABLE_REFERENCE("missing-var"), - }, - ), - ), - ], - ) diff --git a/lib/fluent_migrations/mozorg/about/governance/policies/reporting.py b/lib/fluent_migrations/mozorg/about/governance/policies/reporting.py deleted file mode 100644 index 0917740542..0000000000 --- a/lib/fluent_migrations/mozorg/about/governance/policies/reporting.py +++ /dev/null @@ -1,280 +0,0 @@ -from __future__ import absolute_import - -import fluent.syntax.ast as FTL -from fluent.migrate import COPY, REPLACE -from fluent.migrate.helpers import TERM_REFERENCE, VARIABLE_REFERENCE, transforms_from - -reporting = "mozorg/about/governance/policies/reporting.lang" - - -def migrate(ctx): - """Migrate bedrock/mozorg/templates/mozorg/about/governance/policies/reporting.html, part {index}.""" - - ctx.add_transforms( - "mozorg/about/governance/policies/reporting.ftl", - "mozorg/about/governance/policies/reporting.ftl", - transforms_from( - """ -reporting-community-participation = {COPY(reporting, "Community Participation Guidelines - How to Report",)} -reporting-how-to-report-violations = {COPY(reporting, "How to Report Violations of the Community Participation Guidelines",)} -""", - reporting=reporting, - ) - + [ - FTL.Message( - id=FTL.Identifier("reporting-this-document-provides"), - value=REPLACE( - reporting, - "This document provides high-level information, for understanding and reporting violations of Mozilla's Community Participation Guidelines.", - { - "Mozilla": TERM_REFERENCE("brand-name-mozilla"), - }, - ), - ), - FTL.Message( - id=FTL.Identifier("reporting-from-the-community-participation"), - value=REPLACE( - reporting, - 'From the Community Participation Guidelines:', - { - "%%": "%", - "%(cpg)s": VARIABLE_REFERENCE("cpg"), - }, - ), - ), - FTL.Message( - id=FTL.Identifier("reporting-the-heart-of-mozilla-is"), - value=REPLACE( - reporting, - "The heart of Mozilla is people. We put people first and do our best to recognize, appreciate and respect the diversity of our global contributors. The Mozilla Project welcomes contributions from everyone who shares our goals and wants to contribute in a healthy and constructive manner within our community. As such, we have adopted this code of conduct and require all those who participate to agree and adhere to these Community Participation Guidelines in order to help us create a safe and positive community experience for all.", - { - "Mozilla": TERM_REFERENCE("brand-name-mozilla"), - }, - ), - ), - FTL.Message( - id=FTL.Identifier("reporting-this-document-is-intended"), - value=REPLACE( - reporting, - "This document is intended as an interface to existing documents, processes and people responsible for ensuring Mozilla’s communities are healthy, and inclusive for all.", - { - "Mozilla": TERM_REFERENCE("brand-name-mozilla"), - }, - ), - ), - ] - + transforms_from( - """ -reporting-when-to-report = {COPY(reporting, "When To Report",)} -""", - reporting=reporting, - ) - + [ - FTL.Message( - id=FTL.Identifier("reporting-please-report-all-incidents"), - value=REPLACE( - reporting, - 'Please report all incidents where someone has engaged in behavior that is potentially illegal or makes you or someone else feel unsafe, unwelcome or uncomfortable as further explained in the CPG.', - { - "%%": "%", - "%(cpg)s": VARIABLE_REFERENCE("cpg"), - }, - ), - ), - ] - + transforms_from( - """ -reporting-how-to-give-a-report = {COPY(reporting, "How to Give a Report",)} -reporting-if-you-believe-someone = {COPY(reporting, "If you believe someone is in physical danger call your local emergency number.",)} -""", - reporting=reporting, - ) - + [ - FTL.Message( - id=FTL.Identifier("reporting-if-you-have-a-report-by"), - value=REPLACE( - reporting, - 'If you have a report by and about a contributor (for example, the report is made by one contributor about another contributor), then you should make your report at the Community Participation Guidelines hotline.', - { - "%%": "%", - "%(community_hotline)s": VARIABLE_REFERENCE("community_hotline"), - }, - ), - ), - FTL.Message( - id=FTL.Identifier("reporting-if-you-have-a-report-involving"), - value=REPLACE( - reporting, - 'If you have a report involving an employee, contractor, or vendor (for example, the report is made by an employee or is about an employee) then you should report at the Mozilla Employee hotline.', - { - "%%": "%", - "%(employee_hotline)s": VARIABLE_REFERENCE("employee_hotline"), - "Mozilla": TERM_REFERENCE("brand-name-mozilla"), - }, - ), - ), - ] - + transforms_from( - """ -reporting-put-another-way = {COPY(reporting, "Put another way…",)} -reporting-by = {COPY(reporting, "By",)} -reporting-employee = {COPY(reporting, "Employee",)} -reporting-contributor = {COPY(reporting, "Contributor",)} -reporting-about = {COPY(reporting, "About",)} -reporting-employee-hotline = {COPY(reporting, "Employee Hotline",)} -reporting-community-hotline = {COPY(reporting, "Community Hotline",)} -reporting-contractor = {COPY(reporting, "Contractor",)} -reporting-vendor = {COPY(reporting, "Vendor",)} -reporting-if-someone-reports-to = {COPY(reporting, "If someone reports to you…",)} -reporting-do-not-question-or-judge = {COPY(reporting, "Do not question, or judge their experience.",)} -reporting-do-not-invite-them-to = {COPY(reporting, "Do not invite them to withdraw the incident report.",)} -reporting-do-not-promise-any-particular = {COPY(reporting, "Do not promise any particular response.",)} -""", - reporting=reporting, - ) - + [ - FTL.Message( - id=FTL.Identifier("reporting-do-let-them-know-that"), - value=REPLACE( - reporting, - "Do let them know that for Mozilla’s policy to be impactful, reports should go through the hotline. If they do not feel comfortable filing the report themselves, you may do so.", - { - "Mozilla": TERM_REFERENCE("brand-name-mozilla"), - }, - ), - ), - ] - + transforms_from( - """ -reporting-no-matter-who-files-the = {COPY(reporting, "No matter who files the report, the information below is important to capture.",)} -reporting-names-of-the-people-involved = {COPY(reporting, "Names of the people involved (or if names are unknown, use descriptions and any identifiable info such as appearance, role, handle, project/community affiliation).",)} -reporting-description-of-incident = {COPY(reporting, "Description of incident, including memorable dates (or event) and locations.",)} -""", - reporting=reporting, - ) - + [ - FTL.Message( - id=FTL.Identifier("reporting-if-the-reporter-wants"), - value=REPLACE( - reporting, - "If the reporter wants to make an anonymous report, please inform them that this contact information we may not be able to update the initial reporter if appropriate. Some laws prohibit anonymous reporting and that you may be required to provide their name if you are a Mozilla Manager or Community Leader.", - { - "Mozilla": TERM_REFERENCE("brand-name-mozilla"), - }, - ), - ), - ] - + transforms_from( - """ -reporting-relationship-of-reportervictim = {COPY(reporting, "Relationship of reporter/victim.",)} -""", - reporting=reporting, - ) - + [ - FTL.Message( - id=FTL.Identifier("reporting-mozilla-managers-and-community"), - value=REPLACE( - reporting, - "Mozilla Managers and Community leaders", - { - "Mozilla": TERM_REFERENCE("brand-name-mozilla"), - }, - ), - ), - FTL.Message( - id=FTL.Identifier("reporting-if-a-mozilla-manager-or"), - value=REPLACE( - reporting, - 'If a Mozilla Manager or Community leaders is informed about potential CPG violations they are expected to immediately report the incident through the applicable hotline, even if the initial reporter will also file a report. Mozilla Managers and Community leaders are not permitted to investigate complaints on their own.', - { - "%%": "%", - "%(cpg)s": VARIABLE_REFERENCE("cpg"), - "Mozilla": TERM_REFERENCE("brand-name-mozilla"), - }, - ), - ), - FTL.Message( - id=FTL.Identifier("reporting-do-not-impose-your-own"), - value=REPLACE( - reporting, - "Do not impose your own judgement on how the reporter should react. Focus on listening.", - { - "Focus": TERM_REFERENCE("brand-name-focus"), - }, - ), - ), - ] - + transforms_from( - """ -reporting-what-happens-after-the = {COPY(reporting, "What happens after the Report is filed",)} -reporting-investigation = {COPY(reporting, "Investigation",)} -reporting-reports-are-handled-discretely = {COPY(reporting, "Reports are handled discretely and privately, and will only be shared with the people who can investigate, respond, and advise. As part of this investigation, it may be necessary for some information to be disclosed to others, for example to key stakeholders administering communities or events, witnesses, and the wrongdoer.",)} -reporting-correspondence = {COPY(reporting, "Correspondence",)} -reporting-all-reports-are-reviewed = {COPY(reporting, "All reports are reviewed and responded to based on the nature of the report and we try to provide reasonably timed updates as part of open investigations.",)} -reporting-redress = {COPY(reporting, "Redress",)} -""", - reporting=reporting, - ) - + [ - FTL.Message( - id=FTL.Identifier("reporting-when-an-investigation"), - value=REPLACE( - reporting, - "When an investigation is complete, to the extent the wrongdoer is subject to Mozilla’s control, appropriate measures will be taken to address the situation.", - { - "Mozilla": TERM_REFERENCE("brand-name-mozilla"), - }, - ), - ), - ] - + transforms_from( - """ -reporting-no-retaliation = {COPY(reporting, "No Retaliation",)} -""", - reporting=reporting, - ) - + [ - FTL.Message( - id=FTL.Identifier("reporting-mozilla-does-not-tolerate"), - value=REPLACE( - reporting, - "Mozilla does not tolerate retaliation against Mozillians who report concerns under the CPG in good faith. Acts of retaliation should be reported in the same process as described above.", - { - "Mozilla": TERM_REFERENCE("brand-name-mozilla"), - }, - ), - ), - ] - + transforms_from( - """ -reporting-license = {COPY(reporting, "License",)} -""", - reporting=reporting, - ) - + [ - FTL.Message( - id=FTL.Identifier("reporting-this-document-includes"), - value=REPLACE( - reporting, - 'This document includes content forked from the PyCon Code of Conduct Revision 2f4d980 which is licensed under a Creative Commons Attribution 3.0 Unported License.', - { - "%%": "%", - "%(pycon)s": VARIABLE_REFERENCE("pycon"), - "Creative Commons": TERM_REFERENCE("brand-name-creative-commons"), - }, - ), - ), - FTL.Message( - id=FTL.Identifier("reporting-this-document-is-licensed"), - value=REPLACE( - reporting, - 'This document is licensed under a Creative Commons Attribution 3.0 Unported License.', - { - "%%": "%", - "%(license)s": VARIABLE_REFERENCE("license"), - "Creative Commons": TERM_REFERENCE("brand-name-creative-commons"), - }, - ), - ), - ], - ) diff --git a/lib/fluent_migrations/mozorg/about/history.py b/lib/fluent_migrations/mozorg/about/history.py deleted file mode 100644 index 503c08c7f6..0000000000 --- a/lib/fluent_migrations/mozorg/about/history.py +++ /dev/null @@ -1,363 +0,0 @@ -from __future__ import absolute_import - -import fluent.syntax.ast as FTL -from fluent.migrate import COPY, REPLACE -from fluent.migrate.helpers import TERM_REFERENCE, VARIABLE_REFERENCE, transforms_from - -history = "mozorg/about/history.lang" -history_details = "mozorg/about/history-details.lang" -about = "mozorg/about.lang" - - -def migrate(ctx): - """Migrate bedrock/mozorg/templates/mozorg/about/history.html, part {index}.""" - - ctx.add_transforms( - "mozorg/about/history.ftl", - "mozorg/about/history.ftl", - [ - FTL.Message( - id=FTL.Identifier("history-history-of-the-mozilla-project"), - value=REPLACE( - history_details, - "History of the Mozilla Project", - { - "Mozilla": TERM_REFERENCE("brand-name-mozilla"), - }, - ), - ), - FTL.Message( - id=FTL.Identifier("history-the-mozilla-project-was"), - value=REPLACE( - history_details, - 'The Mozilla project was created in 1998 with the release of the Netscape browser suite source code.', - { - "%%": "%", - "%(coderush)s": VARIABLE_REFERENCE("coderush"), - "%(sourcerelease)s": VARIABLE_REFERENCE("sourcerelease"), - "Netscape": TERM_REFERENCE("brand-name-netscape"), - "Mozilla": TERM_REFERENCE("brand-name-mozilla"), - }, - ), - ), - ] - + transforms_from( - """ -history-it-was-intended-to-harness = {COPY(history_details, "It was intended to harness the creative power of thousands of programmers on the Internet and fuel unprecedented levels of innovation in the browser market.",)} -""", - history_details=history_details, - ) - + [ - FTL.Message( - id=FTL.Identifier("history-within-the-first-year-new"), - value=REPLACE( - history_details, - 'Within the first year, new community members from around the world had already contributed new functionality, enhanced existing features and became engaged in the management and planning of the project itself.', - { - "%%": "%", - "%(firstyear)s": VARIABLE_REFERENCE("firstyear"), - }, - ), - ), - FTL.Message( - id=FTL.Identifier("history-by-creating-an-open-community"), - value=REPLACE( - history_details, - 'By creating an open community, the Mozilla project had become larger than any one company.', - { - "%%": "%", - "%(stevecase)s": VARIABLE_REFERENCE("stevecase"), - "Mozilla": TERM_REFERENCE("brand-name-mozilla"), - }, - ), - ), - FTL.Message( - id=FTL.Identifier("history-community-members-got-involved"), - value=REPLACE( - history_details, - 'Community members got involved and expanded the scope of the project’s original mission — instead of just working on Netscape’s next browser, people started creating a variety of browsers, development tools and a range of other projects.', - { - "%%": "%", - "%(mission)s": VARIABLE_REFERENCE("mission"), - "%(browsers)s": VARIABLE_REFERENCE("browsers"), - "%(bugzilla)s": VARIABLE_REFERENCE("bugzilla"), - "%(projects)s": VARIABLE_REFERENCE("projects"), - "Netscape": TERM_REFERENCE("brand-name-netscape"), - }, - ), - ), - FTL.Message( - id=FTL.Identifier("history-people-contributed-to-mozilla"), - value=REPLACE( - history_details, - "People contributed to Mozilla in different ways, but everyone was passionate about creating free software that would enable people to have a choice in how they experienced the Internet.", - { - "Mozilla": TERM_REFERENCE("brand-name-mozilla"), - }, - ), - ), - FTL.Message( - id=FTL.Identifier("history-after-several-years-of-development"), - value=REPLACE( - history_details, - 'After several years of development, Mozilla 1.0, the first major version, was released in 2002. This version featured many improvements to the browser, email client and other applications included in the suite, but not many people were using it.', - { - "%%": "%", - "%(mozilla1)s": VARIABLE_REFERENCE("mozilla1"), - "Mozilla": TERM_REFERENCE("brand-name-mozilla"), - }, - ), - ), - FTL.Message( - id=FTL.Identifier("history-by-2002-well-over-90"), - value=REPLACE( - history_details, - 'By 2002, well over 90%% of Internet users were browsing with Internet Explorer.', - { - "%%": FTL.TextElement("%"), - "%(over90)s": VARIABLE_REFERENCE("over90"), - "Internet Explorer": TERM_REFERENCE("brand-name-ie"), - }, - ), - ), - FTL.Message( - id=FTL.Identifier("history-not-many-people-noticed"), - value=REPLACE( - history_details, - 'Not many people noticed at the time, but the first version of Phoenix (later renamed to Firefox) was also released by Mozilla community members that year with the goal of providing the best possible browsing experience to the widest possible set of people.', - { - "%%": "%", - "%(charter)s": VARIABLE_REFERENCE("charter"), - "Mozilla": TERM_REFERENCE("brand-name-mozilla"), - "Firefox": TERM_REFERENCE("brand-name-firefox"), - }, - ), - ), - FTL.Message( - id=FTL.Identifier("history-in-2003-the-mozilla-project"), - value=REPLACE( - history_details, - 'In 2003, the Mozilla project created the Mozilla Foundation, an independent non-profit organization supported by individual donors and a variety of companies.', - { - "%%": "%", - "%(foundation)s": VARIABLE_REFERENCE("foundation"), - "Mozilla": TERM_REFERENCE("brand-name-mozilla"), - "Mozilla Foundation": TERM_REFERENCE("brand-name-mozilla-foundation"), - }, - ), - ), - FTL.Message( - id=FTL.Identifier("history-the-new-mozilla-foundation"), - value=REPLACE( - history_details, - 'The new Mozilla Foundation continued the role of managing the daily operations of the project and also officially took on the role of promoting openness, innovation and opportunity on the Internet.', - { - "%%": "%", - "%(manifesto)s": VARIABLE_REFERENCE("manifesto"), - "Mozilla Foundation": TERM_REFERENCE("brand-name-mozilla-foundation"), - }, - ), - ), - FTL.Message( - id=FTL.Identifier("history-it-did-this-by-continuing"), - value=REPLACE( - history_details, - 'It did this by continuing to release software, such as Firefox and Thunderbird, and expanding to new areas, such as providing grants to support accessibility improvements on the Web.', - { - "%%": "%", - "%(grants)s": VARIABLE_REFERENCE("grants"), - "Thunderbird": TERM_REFERENCE("brand-name-thunderbird"), - "Firefox": TERM_REFERENCE("brand-name-firefox"), - }, - ), - ), - FTL.Message( - id=FTL.Identifier("history-firefox-10-was-released"), - value=REPLACE( - history_details, - 'Firefox 1.0 was released in 2004 and became a big success — in less than a year, it was downloaded over 100 million times.', - { - "%%": "%", - "%(firefox1)s": VARIABLE_REFERENCE("firefox1"), - "%(millions)s": VARIABLE_REFERENCE("millions"), - "Firefox": TERM_REFERENCE("brand-name-firefox"), - }, - ), - ), - FTL.Message( - id=FTL.Identifier("history-new-versions-of-firefox"), - value=REPLACE( - history_details, - "New versions of Firefox have come out regularly since then and keep setting new records. The popularity of Firefox has helped bring choice back to users.", - { - "Firefox": TERM_REFERENCE("brand-name-firefox"), - }, - ), - ), - FTL.Message( - id=FTL.Identifier("history-the-renewed-competition"), - value=REPLACE( - history_details, - 'The renewed competition has accelerated innovation and improved the Internet for everyone.', - { - "%%": "%", - "%(innovation)s": VARIABLE_REFERENCE("innovation"), - }, - ), - ), - FTL.Message( - id=FTL.Identifier("history-in-2013-we-launched-firefox"), - value=REPLACE( - history_details, - 'In 2013, we launched Firefox OS to unleash the full power of the Web on smartphones and once again offer control and choice to a new generation of people coming online.', - { - "%%": "%", - "%(firefoxos)s": VARIABLE_REFERENCE("firefoxos"), - "Firefox OS": TERM_REFERENCE("brand-name-firefox-os"), - }, - ), - ), - FTL.Message( - id=FTL.Identifier("history-mozilla-also-celebrated"), - value=REPLACE( - history_details, - "Mozilla also celebrated its 15th anniversary in 2013.", - { - "Mozilla": TERM_REFERENCE("brand-name-mozilla"), - }, - ), - ), - ] - + transforms_from( - """ -history-the-community-has-shown = {COPY(history_details, "The community has shown that commercial companies can benefit by collaborating in open source projects and that great end user products can be produced as open source software.",)} -""", - history_details=history_details, - ) - + [ - FTL.Message( - id=FTL.Identifier("history-more-people-than-ever-before"), - value=REPLACE( - history_details, - 'More people than ever before are using the Internet and are experiencing it in their own language.', - { - "%%": "%", - "%(all)s": VARIABLE_REFERENCE("all"), - }, - ), - ), - FTL.Message( - id=FTL.Identifier("history-a-sustainable-organization"), - value=REPLACE( - history_details, - 'A sustainable organization has been created that uses market mechanisms to support a public benefit mission and this model has been reused by others to create open, transparent and collaborative organizations in a broad range of areas.', - { - "%%": "%", - "%(range)s": VARIABLE_REFERENCE("range"), - "%(areas)s": VARIABLE_REFERENCE("areas"), - }, - ), - ), - ] - + transforms_from( - """ -history-the-future-is-full-of-challenges = {COPY(history_details, "The future is full of challenges and opportunities equal to those of our past.",)} -history-theres-no-guarantee-that = {COPY(history_details, "There’s no guarantee that the Internet will remain open or enjoyable or safe.",)} -""", - history_details=history_details, - ) - + [ - FTL.Message( - id=FTL.Identifier("history-mozilla-will-continue-to"), - value=REPLACE( - history_details, - "Mozilla will continue to provide an opportunity for people to make their voices heard and to shape their own online lives.", - { - "Mozilla": TERM_REFERENCE("brand-name-mozilla"), - }, - ), - ), - ] - + transforms_from( - """ -history-of-course-were-not-alone = {COPY(history_details, "Of course, we’re not alone in doing this.",)} -""", - history_details=history_details, - ) - + [ - FTL.Message( - id=FTL.Identifier("history-the-mozilla-community-together"), - value=REPLACE( - history_details, - "The Mozilla community, together with other open source projects and other public benefit organizations, exists only because of the people who are engaged in making our common goals a reality.", - { - "Mozilla": TERM_REFERENCE("brand-name-mozilla"), - }, - ), - ), - FTL.Message( - id=FTL.Identifier("history-if-you-want-to-join-us-in"), - value=REPLACE( - history_details, - 'If you want to join us in our mission, please get involved.', - { - "%%": "%", - "%(contribute)s": VARIABLE_REFERENCE("contribute"), - }, - ), - ), - FTL.Message( - id=FTL.Identifier("history-for-more-information-about"), - value=REPLACE( - history_details, - "For more information about Mozilla’s history, see the following:", - { - "Mozilla": TERM_REFERENCE("brand-name-mozilla"), - }, - ), - ), - FTL.Message( - id=FTL.Identifier("history-mozilla-bookmarks"), - value=REPLACE( - history_details, - "Mozilla Bookmarks", - { - "Mozilla": TERM_REFERENCE("brand-name-mozilla"), - }, - ), - ), - FTL.Message( - id=FTL.Identifier("history-timeline-of-mozilla-project"), - value=REPLACE( - history_details, - "Timeline of Mozilla Project", - { - "Mozilla": TERM_REFERENCE("brand-name-mozilla"), - }, - ), - ), - FTL.Message( - id=FTL.Identifier("history-mozilla-digital-memory-bank"), - value=REPLACE( - history_details, - "Mozilla Digital Memory Bank", - { - "Mozilla": TERM_REFERENCE("brand-name-mozilla"), - }, - ), - ), - FTL.Message( - id=FTL.Identifier("history-the-history-of-firefox-and"), - value=REPLACE( - history_details, - 'The History of Firefox and Mozilla Posters (available in English and Japanese)', - { - "%%": "%", - "%(link)s": VARIABLE_REFERENCE("link"), - "Mozilla": TERM_REFERENCE("brand-name-mozilla"), - "Firefox": TERM_REFERENCE("brand-name-firefox"), - }, - ), - ), - ], - ) diff --git a/lib/fluent_migrations/mozorg/about/index.py b/lib/fluent_migrations/mozorg/about/index.py deleted file mode 100644 index e3a4fa1cc9..0000000000 --- a/lib/fluent_migrations/mozorg/about/index.py +++ /dev/null @@ -1,247 +0,0 @@ -from __future__ import absolute_import - -import fluent.syntax.ast as FTL -from fluent.migrate import COPY, REPLACE -from fluent.migrate.helpers import TERM_REFERENCE, VARIABLE_REFERENCE, transforms_from - -about = "mozorg/about.lang" -about_2019 = "mozorg/about-2019.lang" - - -def migrate(ctx): - """Migrate bedrock/mozorg/templates/mozorg/about.html, part {index}.""" - - ctx.add_transforms( - "mozorg/about.ftl", - "mozorg/about.ftl", - [ - FTL.Message( - id=FTL.Identifier("about-learn-about-mozilla"), - value=REPLACE( - about_2019, - "Learn About Mozilla", - { - "Mozilla": TERM_REFERENCE("brand-name-mozilla"), - }, - ), - ), - FTL.Message( - id=FTL.Identifier("about-mozilla-makes-browsers-apps-desc"), - value=REPLACE( - about_2019, - "Mozilla makes browsers, apps, code and tools that put people before profit. Our mission: Keep the internet open and accessible to all.", - { - "Mozilla": TERM_REFERENCE("brand-name-mozilla"), - }, - ), - ), - FTL.Message( - id=FTL.Identifier("about-mozilla-makes-browsers-apps"), - value=REPLACE( - about_2019, - "Mozilla makes browsers, apps, code and tools that put people before profit.", - { - "Mozilla": TERM_REFERENCE("brand-name-mozilla"), - }, - ), - ), - ] - + transforms_from( - """ -about-our-mission-keep-the-internet = {COPY(about_2019, "Our mission: Keep the internet open and accessible to all.",)} -about-read-our-mission = {COPY(about_2019, "Read Our Mission",)} -about-our-mission-in-action = {COPY(about_2019, "Our Mission in Action",)} -about-pioneers-of-the-open-web = {COPY(about_2019, "Pioneers of The Open Web",)} -about-our-leadership-has-been-at = {COPY(about_2019, "Our leadership has been at the forefront of building a healthier internet since Day 1. What began as an alternative to corporate domination has grown into a global force for good online.",)} -""", - about_2019=about_2019, - ) - + [ - FTL.Message( - id=FTL.Identifier("about-firefox-fast-for-good"), - value=REPLACE( - about_2019, - "Firefox: Fast for Good", - { - "Firefox": TERM_REFERENCE("brand-name-firefox"), - }, - ), - ), - FTL.Message( - id=FTL.Identifier("about-when-you-use-the-new-firefox"), - value=REPLACE( - about_2019, - "When you use the new Firefox, you get a blazing fast experience while supporting Mozilla’s mission to keep the internet healthy, weird and welcoming to all.", - { - "Mozilla": TERM_REFERENCE("brand-name-mozilla"), - "Firefox": TERM_REFERENCE("brand-name-firefox"), - }, - ), - ), - ] - + transforms_from( - """ -about-walking-our-privacy-talk = {COPY(about_2019, "Walking Our Privacy Talk",)} -""", - about_2019=about_2019, - ) - + [ - FTL.Message( - id=FTL.Identifier("about-when-the-facebook-breach-was"), - value=REPLACE( - about_2019, - "When the Facebook breach was revealed, Mozilla had an immediate response – and a Firefox product to support user privacy.", - { - "Facebook": TERM_REFERENCE("brand-name-facebook"), - "Mozilla": TERM_REFERENCE("brand-name-mozilla"), - "Firefox": TERM_REFERENCE("brand-name-firefox"), - }, - ), - ), - ] - + transforms_from( - """ -about-talking-internet-issues-irl = {COPY(about_2019, "Talking Internet Issues IRL",)} -""", - about_2019=about_2019, - ) - + [ - FTL.Message( - id=FTL.Identifier("about-in-mozillas-irl-podcast-host"), - value=REPLACE( - about_2019, - "In Mozilla’s IRL podcast, host Manoush Zomorodi shares real stories of life online and real talk about the future of the Web.", - { - "Mozilla": TERM_REFERENCE("brand-name-mozilla"), - }, - ), - ), - ] - + transforms_from( - """ -about-corporation-foundation-not = {COPY(about_2019, "Corporation. Foundation. Not-for-profit.",)} -""", - about_2019=about_2019, - ) - + [ - FTL.Message( - id=FTL.Identifier("about-learn-about-the-mozilla-foundation"), - value=REPLACE( - about_2019, - "Learn about the Mozilla Foundation", - { - "Mozilla Foundation": TERM_REFERENCE("brand-name-mozilla-foundation"), - }, - ), - ), - FTL.Message( - id=FTL.Identifier("about-mozilla-puts-people-over-profit"), - value=REPLACE( - about_2019, - "Mozilla puts people over profit in everything we say, build and do. In fact, there’s a non-profit Foundation at the heart of our enterprise.", - { - "Mozilla": TERM_REFERENCE("brand-name-mozilla"), - }, - ), - ), - FTL.Message( - id=FTL.Identifier("about-the-mozilla-manifesto"), - value=REPLACE( - about_2019, - "The Mozilla Manifesto", - { - "Mozilla": TERM_REFERENCE("brand-name-mozilla"), - }, - ), - ), - ] - + transforms_from( - """ -about-the-principles-we-wrote-in = {COPY(about_2019, "The principles we wrote in 1998 still guide us today. And in 2018, we created an addendum to emphasize inclusion, privacy and safety for everyone online.",)} -about-read-the-manifesto = {COPY(about_2019, "Read The Manifesto",)} -about-a-global-view = {COPY(about_2019, "A Global View",)} -""", - about_2019=about_2019, - ) - + [ - FTL.Message( - id=FTL.Identifier("about-with-offices-all-over-the"), - value=REPLACE( - about_2019, - 'With offices all over the world, we consider the internet from multiple cultures and contexts.', - { - "%%": "%", - "%(url)s": VARIABLE_REFERENCE("url"), - }, - ), - ), - ] - + transforms_from( - """ -about-san-francisco = {COPY(about_2019, "San Francisco",)} -about-2000-non-employee-guests-welcomed = {COPY(about_2019, "2000 non-employee guests welcomed each year",)} -about-berlin = {COPY(about_2019, "Berlin",)} -about-500-annual-attendees-to-the = {COPY(about_2019, "500 annual attendees to the Berlin speaker series",)} -about-toronto = {COPY(about_2019, "Toronto",)} -about-800-bottles-of-cold-brew-coffee = {COPY(about_2019, "800 bottles of cold brew coffee consumed yearly.",)} -""", - about_2019=about_2019, - ) - + [ - FTL.Message( - id=FTL.Identifier("about-work-at-mozilla"), - value=REPLACE( - about_2019, - "Work at Mozilla", - { - "Mozilla": TERM_REFERENCE("brand-name-mozilla"), - }, - ), - ), - ] - + transforms_from( - """ -about-join-a-mission-driven-organization = {COPY(about_2019, "Join a mission-driven organization that builds purpose-driven products.",)} -""", - about_2019=about_2019, - ) - + [ - FTL.Message( - id=FTL.Identifier("about-mozilla-careers"), - value=REPLACE( - about_2019, - "Mozilla Careers", - { - "Mozilla": TERM_REFERENCE("brand-name-mozilla"), - }, - ), - ), - ] - + transforms_from( - """ -about-how-you-can-help = {COPY(about_2019, "How You Can Help",)} -about-your-voice-your-code-your = {COPY(about_2019, "Your voice. Your code. Your support. There are so many ways to join the fight for a healthy internet.",)} -about-get-involved = {COPY(about_2019, "Get Involved",)} -""", - about_2019=about_2019, - ) - + [ - FTL.Message( - id=FTL.Identifier("about-get-the-mozilla-newsletter"), - value=REPLACE( - about_2019, - "Get The Mozilla Newsletter", - { - "Mozilla": TERM_REFERENCE("brand-name-mozilla"), - }, - ), - ), - ] - + transforms_from( - """ -about-stay-informed-about-the-issues = {COPY(about_2019, "Stay informed about the issues affecting the internet, and learn how you can get involved in protecting the world’s newest public resource.",)} -about-subscribe = {COPY(about_2019, "Subscribe",)} -""", - about_2019=about_2019, - ), - ) diff --git a/lib/fluent_migrations/mozorg/about/manifesto.py b/lib/fluent_migrations/mozorg/about/manifesto.py deleted file mode 100644 index b9ebbba3b3..0000000000 --- a/lib/fluent_migrations/mozorg/about/manifesto.py +++ /dev/null @@ -1,443 +0,0 @@ -from __future__ import absolute_import - -import fluent.syntax.ast as FTL -from fluent.migrate import COPY, REPLACE -from fluent.migrate.helpers import TERM_REFERENCE, VARIABLE_REFERENCE, transforms_from - -manifesto = "mozorg/about/manifesto.lang" - - -def migrate(ctx): - """Migrate bedrock/mozorg/templates/mozorg/about/manifesto.html, part {index}.""" - - ctx.add_transforms( - "mozorg/about/manifesto.ftl", - "mozorg/about/manifesto.ftl", - [ - FTL.Message( - id=FTL.Identifier("manifesto-the-mozilla-manifesto"), - value=REPLACE( - manifesto, - "The Mozilla Manifesto", - { - "Mozilla": TERM_REFERENCE("brand-name-mozilla"), - }, - ), - ), - ] - + transforms_from( - """ -manifesto-these-are-the-principles = {COPY(manifesto, "These are the principles that guide our mission to promote openness, innovation & opportunity on the web.",)} -manifesto-the-internet-is-an-integral = {COPY(manifesto, "The internet is an integral part of modern life—a key component in education, communication, collaboration, business, entertainment and society as a whole.",)} -manifesto-the-internet-is-a-global = {COPY(manifesto, "The internet is a global public resource that must remain open and accessible.",)} -manifesto-the-internet-must-enrich = {COPY(manifesto, "The internet must enrich the lives of individual human beings.",)} -manifesto-individuals-security-and = {COPY(manifesto, "Individuals’ security and privacy on the internet are fundamental and must not be treated as optional.",)} -manifesto-individuals-must-have = {COPY(manifesto, "Individuals must have the ability to shape the internet and their own experiences on it.",)} -manifesto-the-effectiveness-of-the = {COPY(manifesto, "The effectiveness of the internet as a public resource depends upon interoperability (protocols, data formats, content), innovation and decentralized participation worldwide.",)} -manifesto-free-and-open-source-software = {COPY(manifesto, "Free and open source software promotes the development of the internet as a public resource.",)} -manifesto-transparent-community = {COPY(manifesto, "Transparent community-based processes promote participation, accountability and trust.",)} -manifesto-commercial-involvement = {COPY(manifesto, "Commercial involvement in the development of the internet brings many benefits; a balance between commercial profit and public benefit is critical.",)} -manifesto-magnifying-the-public = {COPY(manifesto, "Magnifying the public benefit aspects of the internet is an important goal, worthy of time, attention and commitment.",)} -manifesto-principle-1 = {COPY(manifesto, "Principle 1",)} -manifesto-principle-2 = {COPY(manifesto, "Principle 2",)} -manifesto-principle-3 = {COPY(manifesto, "Principle 3",)} -manifesto-principle-4 = {COPY(manifesto, "Principle 4",)} -manifesto-principle-5 = {COPY(manifesto, "Principle 5",)} -manifesto-principle-6 = {COPY(manifesto, "Principle 6",)} -manifesto-principle-7 = {COPY(manifesto, "Principle 7",)} -manifesto-principle-8 = {COPY(manifesto, "Principle 8",)} -manifesto-principle-9 = {COPY(manifesto, "Principle 9",)} -manifesto-principle-10 = {COPY(manifesto, "Principle 10",)} -manifesto-01 = {COPY(manifesto, "01",)} -manifesto-02 = {COPY(manifesto, "02",)} -manifesto-03 = {COPY(manifesto, "03",)} -manifesto-04 = {COPY(manifesto, "04",)} -manifesto-05 = {COPY(manifesto, "05",)} -manifesto-06 = {COPY(manifesto, "06",)} -manifesto-07 = {COPY(manifesto, "07",)} -manifesto-08 = {COPY(manifesto, "08",)} -manifesto-09 = {COPY(manifesto, "09",)} -manifesto-10 = {COPY(manifesto, "10",)} -""", - manifesto=manifesto, - ) - + [ - FTL.Message( - id=FTL.Identifier("manifesto-the-mozilla-manifesto-addendum"), - value=REPLACE( - manifesto, - "The Mozilla Manifesto Addendum", - { - "Mozilla": TERM_REFERENCE("brand-name-mozilla"), - }, - ), - ), - ] - + transforms_from( - """ -manifesto-pledge-for-a-healthy-internet = {COPY(manifesto, "Pledge for a Healthy Internet",)} -manifesto-the-open-global-internet = {COPY(manifesto, "The open, global internet is the most powerful communication and collaboration resource we have ever seen. It embodies some of our deepest hopes for human progress. It enables new opportunities for learning, building a sense of shared humanity, and solving the pressing problems facing people everywhere.",)} -manifesto-over-the-last-decade-we = {COPY(manifesto, "Over the last decade we have seen this promise fulfilled in many ways. We have also seen the power of the internet used to magnify divisiveness, incite violence, promote hatred, and intentionally manipulate fact and reality. We have learned that we should more explicitly set out our aspirations for the human experience of the internet. We do so now.",)} -manifesto-we-are-committed-to-people = {COPY(manifesto, "We are committed to an internet that includes all the peoples of the earth — where a person’s demographic characteristics do not determine their online access, opportunities, or quality of experience.",)} -manifesto-we-are-committed-to-discourse = {COPY(manifesto, "We are committed to an internet that promotes civil discourse, human dignity, and individual expression.",)} -manifesto-we-are-committed-to-thinking = {COPY(manifesto, "We are committed to an internet that elevates critical thinking, reasoned argument, shared knowledge, and verifiable facts.",)} -manifesto-we-are-committed-to-diverse = {COPY(manifesto, "We are committed to an internet that catalyzes collaboration among diverse communities working together for the common good.",)} -manifesto-show-your-support = {COPY(manifesto, "Show Your Support",)} -""", - manifesto=manifesto, - ) - + [ - FTL.Message( - id=FTL.Identifier("manifesto-an-internet-with-these"), - value=REPLACE( - manifesto, - "An internet with these qualities will not come to life on its own. Individuals and organizations must embed these aspirations into internet technology and into the human experience with the internet. The Mozilla Manifesto and Addendum represent Mozilla’s commitment to advancing these aspirations. We aim to work together with people and organizations everywhere who share these goals to make the internet an even better place for everyone.", - { - "Mozilla": TERM_REFERENCE("brand-name-mozilla"), - }, - ), - ), - ] - + transforms_from( - """ -manifesto-i-support-the-vision-of = {COPY(manifesto, "I support the vision of a better, healthier internet from @mozilla, will you join me?",)} -""", - manifesto=manifesto, - ) - + [ - FTL.Message( - id=FTL.Identifier("manifesto-share-on-twitter"), - value=REPLACE( - manifesto, - "Share on Twitter", - { - "Twitter": TERM_REFERENCE("brand-name-twitter"), - }, - ), - ), - ] - + transforms_from( - """ -manifesto-our-10-principles = {COPY(manifesto, "Our 10 Principles",)} -manifesto-use-open-badges-to-share = {COPY(manifesto, "Use Open Badges to share your skills and interests",)} -manifesto-explore-how-the-web-impacts = {COPY(manifesto, "Explore how the web impacts science",)} -manifesto-learn-about-open-source = {COPY(manifesto, "Learn about open source code in journalism",)} -manifesto-read-about-open-internet = {COPY(manifesto, "Read about open internet policy initiatives and developments",)} -manifesto-explore-how-to-help-keep = {COPY(manifesto, "Explore how to help keep the web open",)} -manifesto-see-how-the-web-can-connect = {COPY(manifesto, "See how the web can connect the world to healthcare",)} -manifesto-explore-how-the-web-works = {COPY(manifesto, "Explore how the web works",)} -""", - manifesto=manifesto, - ) - + [ - FTL.Message( - id=FTL.Identifier("manifesto-see-how-mozilla-works"), - value=REPLACE( - manifesto, - "See how Mozilla works to put your privacy first", - { - "Mozilla": TERM_REFERENCE("brand-name-mozilla"), - }, - ), - ), - ] - + transforms_from( - """ -manifesto-read-about-developments = {COPY(manifesto, "Read about developments in privacy and data safety",)} -manifesto-learn-more-about-how-to = {COPY(manifesto, "Learn more about how to protect yourself online",)} -manifesto-use-these-free-tools-to = {COPY(manifesto, "Use these free tools to teach the web",)} -manifesto-learn-about-creating-and = {COPY(manifesto, "Learn about creating and curating content for the web",)} -manifesto-add-new-voices-to-open = {COPY(manifesto, "Add new voices to open source technology",)} -manifesto-set-your-do-not-track = {COPY(manifesto, "Set your Do Not Track preference",)} -manifesto-understand-the-web-ecosystem = {COPY(manifesto, "Understand the web ecosystem",)} -manifesto-explore-how-open-practices = {COPY(manifesto, "Explore how open practices keep the web accessible",)} -manifesto-learn-how-to-remix-content = {COPY(manifesto, "Learn how to remix content to create something new",)} -manifesto-learn-how-to-maximize = {COPY(manifesto, "Learn how to maximize the interactive potential of the web",)} -manifesto-participate-in-our-governance = {COPY(manifesto, "Participate in our governance forum",)} -manifesto-join-us-as-a-volunteer = {COPY(manifesto, "Join us as a volunteer",)} -manifesto-learn-how-to-collaborate = {COPY(manifesto, "Learn how to collaborate online",)} -""", - manifesto=manifesto, - ) - + [ - FTL.Message( - id=FTL.Identifier("manifesto-visualize-who-you-interact"), - value=REPLACE( - manifesto, - "Visualize who you interact with on the web with Lightbeam", - { - "Lightbeam": TERM_REFERENCE("brand-name-lightbeam"), - }, - ), - ), - ] - + transforms_from( - """ -manifesto-learn-about-creating-web = {COPY(manifesto, "Learn about creating web resources with others",)} -""", - manifesto=manifesto, - ) - + [ - FTL.Message( - id=FTL.Identifier("manifesto-host-or-join-a-maker-party"), - value=REPLACE( - manifesto, - "Host or join a Maker Party", - { - "Maker Party": TERM_REFERENCE("brand-name-maker-party"), - }, - ), - ), - ] - + transforms_from( - """ -manifesto-learn-how-to-build-online = {COPY(manifesto, "Learn how to build online collaboration skills",)} -manifesto-read-the-entire-manifesto = {COPY(manifesto, "Read the entire manifesto",)} -manifesto-love-the-web = {COPY(manifesto, "Love the web?",)} -""", - manifesto=manifesto, - ) - + [ - FTL.Message( - id=FTL.Identifier("manifesto-get-the-mozilla-newsletter"), - value=REPLACE( - manifesto, - "Get the Mozilla newsletter and help us keep it open and free.", - { - "Mozilla": TERM_REFERENCE("brand-name-mozilla"), - }, - ), - ), - ], - ) - - ctx.add_transforms( - "mozorg/about/manifesto.ftl", - "mozorg/about/manifesto.ftl", - [ - FTL.Message( - id=FTL.Identifier("manifesto-details-the-mozilla-manifesto"), - value=REPLACE( - manifesto, - "The Mozilla Manifesto", - { - "Mozilla": TERM_REFERENCE("brand-name-mozilla"), - }, - ), - ), - ] - + transforms_from( - """ -manifesto-details-introduction = {COPY(manifesto, "Introduction",)} -manifesto-details-the-internet-is-becoming = {COPY(manifesto, "The Internet is becoming an increasingly important part of our lives.",)} -""", - manifesto=manifesto, - ) - + [ - FTL.Message( - id=FTL.Identifier("manifesto-details-the-mozilla-project-global"), - value=REPLACE( - manifesto, - "The Mozilla project is a global community of people who believe that openness, innovation, and opportunity are key to the continued health of the Internet. We have worked together since 1998 to ensure that the Internet is developed in a way that benefits everyone. We are best known for creating the Mozilla Firefox web browser.", - { - "Mozilla": TERM_REFERENCE("brand-name-mozilla"), - "Firefox": TERM_REFERENCE("brand-name-firefox"), - }, - ), - ), - FTL.Message( - id=FTL.Identifier("manifesto-details-the-mozilla-project-community"), - value=REPLACE( - manifesto, - "The Mozilla project uses a community-based approach to create world-class open source software and to develop new types of collaborative activities. We create communities of people involved in making the Internet experience better for all of us.", - { - "Mozilla": TERM_REFERENCE("brand-name-mozilla"), - }, - ), - ), - ] - + transforms_from( - """ -manifesto-details-as-a-result-of = {COPY(manifesto, "As a result of these efforts, we have distilled a set of principles that we believe are critical for the Internet to continue to benefit the public good as well as commercial aspects of life. We set out these principles below.",)} -manifesto-details-the-goals-for = {COPY(manifesto, "The goals for the Manifesto are to:",)} -""", - manifesto=manifesto, - ) - + [ - FTL.Message( - id=FTL.Identifier("manifesto-details-articulate-a-vision"), - value=REPLACE( - manifesto, - "articulate a vision for the Internet that Mozilla participants want the Mozilla Foundation to pursue;", - { - "Mozilla": TERM_REFERENCE("brand-name-mozilla"), - "Mozilla Foundation": TERM_REFERENCE("brand-name-mozilla-foundation"), - }, - ), - ), - ] - + transforms_from( - """ -manifesto-details-speak-to-people = {COPY(manifesto, "speak to people whether or not they have a technical background;",)} -""", - manifesto=manifesto, - ) - + [ - FTL.Message( - id=FTL.Identifier("manifesto-details-make-mozilla-contributors"), - value=REPLACE( - manifesto, - "make Mozilla contributors proud of what we're doing and motivate us to continue; and", - { - "Mozilla": TERM_REFERENCE("brand-name-mozilla"), - }, - ), - ), - ] - + transforms_from( - """ -manifesto-details-provide-a-framework = {COPY(manifesto, "provide a framework for other people to advance this vision of the Internet.",)} -""", - manifesto=manifesto, - ) - + [ - FTL.Message( - id=FTL.Identifier("manifesto-details-these-principles"), - value=REPLACE( - manifesto, - "These principles will not come to life on their own. People are needed to make the Internet open and participatory - people acting as individuals, working together in groups, and leading others. The Mozilla Foundation is committed to advancing the principles set out in the Mozilla Manifesto. We invite others to join us and make the Internet an ever better place for everyone.", - { - "Mozilla": TERM_REFERENCE("brand-name-mozilla"), - "Mozilla Foundation": TERM_REFERENCE("brand-name-mozilla-foundation"), - }, - ), - ), - ] - + transforms_from( - """ -manifesto-details-principles = {COPY(manifesto, "Principles",)} -manifesto-details-the-internet-is-integral = {COPY(manifesto, "The Internet is an integral part of modern life—a key component in education, communication, collaboration, business, entertainment and society as a whole.",)} -manifesto-details-the-internet-is-global = {COPY(manifesto, "The Internet is a global public resource that must remain open and accessible.",)} -manifesto-details-the-internet-must = {COPY(manifesto, "The Internet must enrich the lives of individual human beings.",)} -manifesto-details-individuals-security = {COPY(manifesto, "Individuals’ security and privacy on the Internet are fundamental and must not be treated as optional.",)} -manifesto-details-individuals-must = {COPY(manifesto, "Individuals must have the ability to shape the Internet and their own experiences on the Internet.",)} -manifesto-details-the-effectiveness = {COPY(manifesto, "The effectiveness of the Internet as a public resource depends upon interoperability (protocols, data formats, content), innovation and decentralized participation worldwide.",)} -manifesto-details-free-and-open = {COPY(manifesto, "Free and open source software promotes the development of the Internet as a public resource.",)} -manifesto-details-transparent-community = {COPY(manifesto, "Transparent community-based processes promote participation, accountability and trust.",)} -manifesto-details-commercial-involvement = {COPY(manifesto, "Commercial involvement in the development of the Internet brings many benefits; a balance between commercial profit and public benefit is critical.",)} -manifesto-details-magnifying-the = {COPY(manifesto, "Magnifying the public benefit aspects of the Internet is an important goal, worthy of time, attention and commitment.",)} -""", - manifesto=manifesto, - ) - + [ - FTL.Message( - id=FTL.Identifier("manifesto-details-advancing-the"), - value=REPLACE( - manifesto, - "Advancing the Mozilla Manifesto", - { - "Mozilla": TERM_REFERENCE("brand-name-mozilla"), - }, - ), - ), - FTL.Message( - id=FTL.Identifier("manifesto-details-there-are-many"), - value=REPLACE( - manifesto, - "There are many different ways of advancing the principles of the Mozilla Manifesto. We welcome a broad range of activities, and anticipate the same creativity that Mozilla participants have shown in other areas of the project. For individuals not deeply involved in the Mozilla project, one basic and very effective way to support the Manifesto is to use Mozilla Firefox and other products that embody the principles of the Manifesto.", - { - "Mozilla": TERM_REFERENCE("brand-name-mozilla"), - "Firefox": TERM_REFERENCE("brand-name-firefox"), - }, - ), - ), - FTL.Message( - id=FTL.Identifier("manifesto-details-mozilla-foundation"), - value=REPLACE( - manifesto, - "Mozilla Foundation Pledge", - { - "Mozilla Foundation": TERM_REFERENCE("brand-name-mozilla-foundation"), - }, - ), - ), - FTL.Message( - id=FTL.Identifier("manifesto-details-the-mozilla-foundation-pleges"), - value=REPLACE( - manifesto, - "The Mozilla Foundation pledges to support the Mozilla Manifesto in its activities. Specifically, we will:", - { - "Mozilla": TERM_REFERENCE("brand-name-mozilla"), - "Mozilla Foundation": TERM_REFERENCE("brand-name-mozilla-foundation"), - }, - ), - ), - ] - + transforms_from( - """ -manifesto-details-build-and-enable = {COPY(manifesto, "build and enable open-source technologies and communities that support the Manifesto’s principles;",)} -manifesto-details-build-and-deliver = {COPY(manifesto, "build and deliver great consumer products that support the Manifesto’s principles;",)} -""", - manifesto=manifesto, - ) - + [ - FTL.Message( - id=FTL.Identifier("manifesto-details-use-the-mozilla"), - value=REPLACE( - manifesto, - "use the Mozilla assets (intellectual property such as copyrights and trademarks, infrastructure, funds, and reputation) to keep the Internet an open platform;", - { - "Mozilla": TERM_REFERENCE("brand-name-mozilla"), - }, - ), - ), - ] - + transforms_from( - """ -manifesto-details-promote-models = {COPY(manifesto, "promote models for creating economic value for the public benefit; and",)} -""", - manifesto=manifesto, - ) - + [ - FTL.Message( - id=FTL.Identifier("manifesto-details-promote-the-mozilla"), - value=REPLACE( - manifesto, - "promote the Mozilla Manifesto principles in public discourse and within the Internet industry.", - { - "Mozilla": TERM_REFERENCE("brand-name-mozilla"), - }, - ), - ), - FTL.Message( - id=FTL.Identifier("manifesto-details-some-foundation"), - value=REPLACE( - manifesto, - "Some Foundation activities—currently the creation, delivery and promotion of consumer products—are conducted primarily through the Mozilla Foundation’s wholly owned subsidiary, the Mozilla Corporation.", - { - "Mozilla Corporation": TERM_REFERENCE("brand-name-mozilla-corporation"), - "Mozilla Foundation": TERM_REFERENCE("brand-name-mozilla-foundation"), - }, - ), - ), - ] - + transforms_from( - """ -manifesto-details-invitation = {COPY(manifesto, "Invitation",)} -""", - manifesto=manifesto, - ) - + [ - FTL.Message( - id=FTL.Identifier("manifesto-details-the-mozilla-foundation-invites"), - value=REPLACE( - manifesto, - "The Mozilla Foundation invites all others who support the principles of the Mozilla Manifesto to join with us, and to find new ways to make this vision of the Internet a reality.", - { - "Mozilla": TERM_REFERENCE("brand-name-mozilla"), - "Mozilla Foundation": TERM_REFERENCE("brand-name-mozilla-foundation"), - }, - ), - ), - ], - ) diff --git a/lib/fluent_migrations/mozorg/about/shared.py b/lib/fluent_migrations/mozorg/about/shared.py deleted file mode 100644 index 9b6cbb71af..0000000000 --- a/lib/fluent_migrations/mozorg/about/shared.py +++ /dev/null @@ -1,43 +0,0 @@ -from __future__ import absolute_import - -import fluent.syntax.ast as FTL -from fluent.migrate import COPY, REPLACE -from fluent.migrate.helpers import TERM_REFERENCE, VARIABLE_REFERENCE, transforms_from - -main = "main.lang" - - -def migrate(ctx): - """Migrate bedrock/mozorg/templates/mozorg/about/manifesto.html, part {index}.""" - - ctx.add_transforms( - "mozorg/about/shared.ftl", - "mozorg/about/shared.ftl", - [ - FTL.Message( - id=FTL.Identifier("about-shared-about-mozilla"), - value=REPLACE( - main, - "About Mozilla", - { - "Mozilla": TERM_REFERENCE("brand-name-mozilla"), - }, - ), - ), - ] - + transforms_from( - """ -about-shared-mission = {COPY(main, "Mission",)} -about-shared-history = {COPY(main, "History",)} -about-shared-leadership = {COPY(main, "Leadership",)} -about-shared-governance = {COPY(main, "Governance",)} -about-shared-forums = {COPY(main, "Forums",)} -about-shared-patents = {COPY(main, "Patents",)} -about-shared-our-products = {COPY(main, "Our Products",)} -about-shared-software-innovations = {COPY(main, "Software and other innovations designed to advance our mission.",)} -about-shared-get-involved = {COPY(main, "Get Involved",)} -about-shared-volunteer = {COPY(main, "Become a volunteer contributor in a number of different areas.",)} -""", - main=main, - ), - ) diff --git a/lib/fluent_migrations/mozorg/home/__init__.py b/lib/fluent_migrations/mozorg/home/__init__.py deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/lib/fluent_migrations/mozorg/home/home.py b/lib/fluent_migrations/mozorg/home/home.py deleted file mode 100644 index c5d65ff4f5..0000000000 --- a/lib/fluent_migrations/mozorg/home/home.py +++ /dev/null @@ -1,190 +0,0 @@ -from __future__ import absolute_import - -import fluent.syntax.ast as FTL -from fluent.migrate import COPY, REPLACE -from fluent.migrate.helpers import TERM_REFERENCE, VARIABLE_REFERENCE, transforms_from - -home = "mozorg/home/home.lang" -index_quantum = "mozorg/home/index-quantum.lang" - - -def migrate(ctx): - """Migrate bedrock/mozorg/templates/mozorg/home/home.html, part {index}.""" - - ctx.add_transforms( - "mozorg/home.ftl", - "mozorg/home.ftl", - transforms_from( - """ -home-internet-for-people-not-profit = {COPY(index_quantum, "Internet for people, not profit",)} -""", - index_quantum=index_quantum, - ) - + [ - FTL.Message( - id=FTL.Identifier("home-did-you-know-mozilla-the-maker"), - value=REPLACE( - index_quantum, - "Did you know? Mozilla — the maker of Firefox — fights to keep the Internet a global public resource, open and accessible to all.", - { - "Mozilla": TERM_REFERENCE("brand-name-mozilla"), - "Firefox": TERM_REFERENCE("brand-name-firefox"), - }, - ), - ), - ] - + transforms_from( - """ -home-fast-for-good = {COPY(index_quantum, "Fast for good.",)} -""", - index_quantum=index_quantum, - ) - + [ - FTL.Message( - id=FTL.Identifier("home-with-2x-the-speed-built-in"), - value=REPLACE( - index_quantum, - "With 2x the speed, built-in privacy protection and Mozilla behind it, the new Firefox is the better way to browse.", - { - "Mozilla": TERM_REFERENCE("brand-name-mozilla"), - "Firefox": TERM_REFERENCE("brand-name-firefox"), - }, - ), - ), - ] - + transforms_from( - """ -home-we-make-the-internet-safer = {COPY(index_quantum, "We make the internet safer, healthier and faster for good.",)} -""", - index_quantum=index_quantum, - ) - + [ - FTL.Message( - id=FTL.Identifier("home-mozilla-is-the-not-for-profit"), - value=REPLACE( - index_quantum, - "Mozilla is the not-for-profit behind Firefox, the original alternative browser. We create products and policy to keep the internet in service of people, not profit.", - { - "Mozilla": TERM_REFERENCE("brand-name-mozilla"), - "Firefox": TERM_REFERENCE("brand-name-firefox"), - }, - ), - ), - ] - + transforms_from( - """ -home-our-impact = {COPY(index_quantum, "Our impact",)} -""", - index_quantum=index_quantum, - ) - + [ - FTL.Message( - id=FTL.Identifier("home-when-you-use-firefox-you-help"), - value=REPLACE( - index_quantum, - "When you use Firefox, you help Mozilla fight misinformation online, teach digital skills and make the comments section more human. Check out what helps create a healthier internet.", - { - "Mozilla": TERM_REFERENCE("brand-name-mozilla"), - "Firefox": TERM_REFERENCE("brand-name-firefox"), - }, - ), - ), - ] - + transforms_from( - """ -home-working-to-keep-the-internet = {COPY(index_quantum, "Working to keep the Internet healthy, open and accessible to all, we teach web literacy, provide tools and advocate on behalf of every individual who values the Internet as a global public resource.",)} -home-working-at-the-grassroots-and = {COPY(index_quantum, "Working at the grassroots and policy levels, we teach web literacy, provide tools and advocate on behalf of every individual who values an internet built on fairness, inclusion and respect.",)} -""", - index_quantum=index_quantum, - ) - + [ - FTL.Message( - id=FTL.Identifier("home-mozilla-information-trust-initiative"), - value=REPLACE( - index_quantum, - "Mozilla Information Trust Initiative", - { - "Mozilla": TERM_REFERENCE("brand-name-mozilla"), - }, - ), - ), - ] - + transforms_from( - """ -home-empowering-women-online = {COPY(index_quantum, "Empowering Women Online",)} -home-the-coral-project = {COPY(index_quantum, "The Coral Project",)} -home-read-our-internet-health-report = {COPY(index_quantum, "Read our Internet Health Report",)} -home-our-innovations = {COPY(index_quantum, "Our innovations",)} -home-using-the-web-as-the-platform = {COPY(index_quantum, "Using the web as the platform, we build open, innovative technologies that allow developers to work free of closed, corporate ecosystems and create faster, safer web experiences for us all.",)} -home-virtual-reality-platform = {COPY(index_quantum, "Virtual Reality Platform",)} -""", - index_quantum=index_quantum, - ) - + [ - FTL.Message( - id=FTL.Identifier("home-common-voice"), - value=REPLACE( - index_quantum, - "Common Voice", - { - "Common Voice": TERM_REFERENCE("brand-name-common-voice"), - }, - ), - ), - ] - + transforms_from( - """ -home-extensions = {COPY(index_quantum, "Extensions",)} -""", - index_quantum=index_quantum, - ) - + [ - FTL.Message( - id=FTL.Identifier("home-personalize-firefox-with-your"), - value=REPLACE( - index_quantum, - "Personalize Firefox with your favorite extras like password managers, ad blockers and more.", - { - "Firefox": TERM_REFERENCE("brand-name-firefox"), - }, - ), - ), - ] - + transforms_from( - """ -home-careers = {COPY(index_quantum, "Careers",)} -""", - index_quantum=index_quantum, - ) - + [ - FTL.Message( - id=FTL.Identifier("home-learn-about-the-benefits-of"), - value=REPLACE( - index_quantum, - "Learn about the benefits of working at Mozilla and view open positions around the world.", - { - "Mozilla": TERM_REFERENCE("brand-name-mozilla"), - }, - ), - ), - ] - + transforms_from( - """ -home-need-help = {COPY(index_quantum, "Need help?",)} -""", - index_quantum=index_quantum, - ) - + [ - FTL.Message( - id=FTL.Identifier("home-get-answers-to-your-questions"), - value=REPLACE( - index_quantum, - "Get answers to your questions about Firefox and all Mozilla products from our support team.", - { - "Mozilla": TERM_REFERENCE("brand-name-mozilla"), - "Firefox": TERM_REFERENCE("brand-name-firefox"), - }, - ), - ), - ], - ) diff --git a/lib/fluent_migrations/newsletter/__init__.py b/lib/fluent_migrations/newsletter/__init__.py deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/lib/fluent_migrations/newsletter/includes/__init__.py b/lib/fluent_migrations/newsletter/includes/__init__.py deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/lib/fluent_migrations/newsletter/includes/newsletter-extra.py b/lib/fluent_migrations/newsletter/includes/newsletter-extra.py deleted file mode 100644 index 4a081e2d1a..0000000000 --- a/lib/fluent_migrations/newsletter/includes/newsletter-extra.py +++ /dev/null @@ -1,94 +0,0 @@ -from __future__ import absolute_import - -import fluent.syntax.ast as FTL -from fluent.migrate import COPY, REPLACE -from fluent.migrate.helpers import TERM_REFERENCE, VARIABLE_REFERENCE, transforms_from - -newsletters = "mozorg/newsletters.lang" -main = "main.lang" - - -def migrate(ctx): - """Migrate bedrock/newsletter/templates/newsletter/includes/form-protocol.html, part {index}.""" - - ctx.add_transforms( - "newsletter_form.ftl", - "newsletter_form.ftl", - transforms_from( - """ -newsletter-form-please-enter-a-valid = {COPY(newsletters, "Please enter a valid email address",)} -newsletter-form-you-must-agree-to = {COPY(newsletters, "You must agree to the privacy notice",)} -newsletter-form-your-email-address = {COPY(newsletters, "Your email address",)} -newsletter-form-yournameexamplecom = {COPY(newsletters, "yourname@example.com",)} -newsletter-form-select-country-or-region = {COPY(newsletters, "Select country or region",)} -""", - newsletters=newsletters, - ), - ) - ctx.add_transforms( - "newsletter_form.ftl", - "newsletter_form.ftl", - transforms_from( - """ -newsletter-form-your-email-here = {COPY(main, "YOUR EMAIL HERE",)} -newsletter-form-format = {COPY(main, "Format",)} -newsletter-form-html = {COPY(main, "HTML",)} -newsletter-form-text = {COPY(main, "Text",)} -""", - main=main, - ) - + [ - FTL.Message( - id=FTL.Identifier("newsletter-form-get-firefox-news"), - value=REPLACE( - main, - "Get Firefox news", - { - "Firefox": TERM_REFERENCE("brand-name-firefox"), - }, - ), - ), - FTL.Message( - id=FTL.Identifier("newsletter-form-im-okay-with-mozilla"), - value=REPLACE( - main, - 'I’m okay with Mozilla handling my info as explained in this Privacy Notice', - { - "%%": "%", - "%s": VARIABLE_REFERENCE("url"), - "Mozilla": TERM_REFERENCE("brand-name-mozilla"), - }, - ), - ), - FTL.Message( - id=FTL.Identifier("newsletter-form-we-will-only-send"), - value=REPLACE( - main, - "We will only send you Mozilla-related information.", - { - "Mozilla": TERM_REFERENCE("brand-name-mozilla"), - }, - ), - ), - FTL.Message( - id=FTL.Identifier("newsletter-form-if-you-havent-previously"), - value=REPLACE( - main, - "If you haven’t previously confirmed a subscription to a Mozilla-related newsletter you may have to do so. Please check your inbox or your spam filter for an email from us.", - { - "Mozilla": TERM_REFERENCE("brand-name-mozilla"), - }, - ), - ), - ] - + transforms_from( - """ -newsletter-form-available-languages = {COPY(main, "Available Languages",)} -newsletter-form-select-country = {COPY(main, "Select country",)} -newsletter-form-sign-me-up = {COPY(main, "Sign me up",)} -newsletter-form-sign-up-now = {COPY(main, "Sign Up Now",)} -newsletter-form-thanks = {COPY(main, "Thanks!",)} -""", - main=main, - ), - ) diff --git a/lib/fluent_migrations/newsletter/includes/newsletter.py b/lib/fluent_migrations/newsletter/includes/newsletter.py deleted file mode 100644 index 6b75178cfd..0000000000 --- a/lib/fluent_migrations/newsletter/includes/newsletter.py +++ /dev/null @@ -1,119 +0,0 @@ -from __future__ import absolute_import - -import fluent.syntax.ast as FTL -from fluent.migrate import COPY, REPLACE -from fluent.migrate.helpers import TERM_REFERENCE, VARIABLE_REFERENCE, transforms_from - -main = "main.lang" - - -def migrate(ctx): - """Migrate bedrock/newsletter/templates/newsletter/includes/form-protocol.html, part {index}.""" - - ctx.add_transforms( - "newsletter_form.ftl", - "newsletter_form.ftl", - transforms_from( - """ -newsletter-form-your-email-here = {COPY(main, "YOUR EMAIL HERE",)} -newsletter-form-format = {COPY(main, "Format",)} -newsletter-form-html = {COPY(main, "HTML",)} -newsletter-form-text = {COPY(main, "Text",)} -""", - main=main, - ) - + [ - FTL.Message( - id=FTL.Identifier("newsletter-form-get-firefox-news"), - value=REPLACE( - main, - "Get Firefox news", - { - "Firefox": TERM_REFERENCE("brand-name-firefox"), - }, - ), - ), - FTL.Message( - id=FTL.Identifier("newsletter-form-im-okay-with-mozilla"), - value=REPLACE( - main, - 'I’m okay with Mozilla handling my info as explained in this Privacy Notice', - { - "%%": "%", - "%s": VARIABLE_REFERENCE("url"), - "Mozilla": TERM_REFERENCE("brand-name-mozilla"), - }, - ), - ), - FTL.Message( - id=FTL.Identifier("newsletter-form-we-will-only-send"), - value=REPLACE( - main, - "We will only send you Mozilla-related information.", - { - "Mozilla": TERM_REFERENCE("brand-name-mozilla"), - }, - ), - ), - FTL.Message( - id=FTL.Identifier("newsletter-form-if-you-havent-previously"), - value=REPLACE( - main, - "If you haven’t previously confirmed a subscription to a Mozilla-related newsletter you may have to do so. Please check your inbox or your spam filter for an email from us.", - { - "Mozilla": TERM_REFERENCE("brand-name-mozilla"), - }, - ), - ), - FTL.Message( - id=FTL.Identifier("newsletter-form-firefox-and-you"), - value=REPLACE( - main, - "Firefox + You", - { - "Firefox": TERM_REFERENCE("brand-name-firefox"), - }, - ), - ), - FTL.Message( - id=FTL.Identifier("newsletter-form-get-firefox-tips"), - value=REPLACE( - main, - "Get Firefox tips, tricks, news and more", - { - "Firefox": TERM_REFERENCE("brand-name-firefox"), - }, - ), - ), - FTL.Message( - id=FTL.Identifier("newsletter-form-keep-up-with"), - value=REPLACE( - main, - "Keep up with
all things Firefox.", - { - "Firefox": TERM_REFERENCE("brand-name-firefox"), - }, - ), - ), - FTL.Message( - id=FTL.Identifier("newsletter-form-get-mozilla-updates"), - value=REPLACE( - main, - "Get Mozilla updates", - { - "Mozilla": TERM_REFERENCE("brand-name-mozilla"), - }, - ), - ), - ] - + transforms_from( - """ -newsletter-form-available-languages = {COPY(main, "Available Languages",)} -newsletter-form-select-country = {COPY(main, "Select country",)} -newsletter-form-sign-me-up = {COPY(main, "Sign me up",)} -newsletter-form-sign-up-now = {COPY(main, "Sign Up Now",)} -newsletter-form-thanks = {COPY(main, "Thanks!",)} -""", - main=main, - ), - ) diff --git a/lib/fluent_migrations/newsletter/index.py b/lib/fluent_migrations/newsletter/index.py deleted file mode 100644 index 174915dfca..0000000000 --- a/lib/fluent_migrations/newsletter/index.py +++ /dev/null @@ -1,893 +0,0 @@ -from __future__ import absolute_import - -import fluent.syntax.ast as FTL -from fluent.migrate import COPY, REPLACE -from fluent.migrate.helpers import TERM_REFERENCE, VARIABLE_REFERENCE, transforms_from - -newsletters = "mozorg/newsletters.lang" - - -def migrate(ctx): - """Migrate bedrock/newsletter/templates/newsletter/index.html, part {index}.""" - - ctx.add_transforms( - "mozorg/newsletters.ftl", - "mozorg/newsletters.ftl", - transforms_from( - """ -newsletters-newsletter-subscriptions = {COPY(newsletters, "Newsletter Subscriptions",)} -""", - newsletters=newsletters, - ), - ) - - ctx.add_transforms( - "mozorg/newsletters.ftl", - "mozorg/newsletters.ftl", - [ - FTL.Message( - id=FTL.Identifier("newsletters-mozilla-newsletter"), - value=REPLACE( - newsletters, - "Mozilla Newsletter", - { - "Mozilla": TERM_REFERENCE("brand-name-mozilla"), - }, - ), - ), - ] - + transforms_from( - """ -newsletters-read-all-about-it-in-our-newsletter = {COPY(newsletters, "Read all about it in our newsletter",)} -""", - newsletters=newsletters, - ) - + [ - FTL.Message( - id=FTL.Identifier("newsletters-subscribe-to-updates-and-keep"), - value=REPLACE( - newsletters, - "Subscribe to updates and keep current with Mozilla news. It’s the perfect way for us to keep in touch!", - { - "Mozilla": TERM_REFERENCE("brand-name-mozilla"), - }, - ), - ), - ], - ) - - ctx.add_transforms( - "mozorg/newsletters.ftl", - "mozorg/newsletters.ftl", - transforms_from( - """ -newsletters-newsletter-confirm = {COPY(newsletters, "Newsletter confirm",)} -newsletters-thanks-for-subscribing = {COPY(newsletters, "Thanks for Subscribing!",)} -newsletters-your-newsletter-subscription = {COPY(newsletters, "Your newsletter subscription has been confirmed.",)} -newsletters-please-be-sure-to-add-our = {COPY(newsletters, "Please be sure to add our sending address: mozilla@e.mozilla.org to your address book to ensure we always reach your inbox.",)} -newsletters-the-supplied-link-has-expired = {COPY(newsletters, "The supplied link has expired. You will receive a new one in the next newsletter.",)} -newsletters-something-is-amiss-with = {COPY(newsletters, "Something is amiss with our system, sorry! Please try again later.",)} -""", - newsletters=newsletters, - ), - ) - - ctx.add_transforms( - "mozorg/newsletters.ftl", - "mozorg/newsletters.ftl", - transforms_from( - """ -newsletters-youre-awesome = {COPY(newsletters, "You’re awesome!",)} -newsletters-and-were-not-just-saying = {COPY(newsletters, "And we’re not just saying that because you trusted us with your email address.",)} -newsletters-please-be-sure-to-add-mozillaemozillaorg = {COPY(newsletters, "Please be sure to add mozilla@e.mozilla.org to your address book to ensure we always reach your inbox.",)} -""", - newsletters=newsletters, - ) - + [ - FTL.Message( - id=FTL.Identifier("newsletters-mozilla-touches-on-a-variety"), - value=REPLACE( - newsletters, - "Mozilla touches on a variety of important issues.", - { - "Mozilla": TERM_REFERENCE("brand-name-mozilla"), - }, - ), - ), - ] - + transforms_from( - """ -newsletters-open-your-inbox-and-your = {COPY(newsletters, "Open your inbox (and your heart) even more — take a look at other topics we cover.",)} -newsletters-manage-your-email-preferences = {COPY(newsletters, "Manage your Email Preferences",)} -newsletters-this-page-is-in-maintenance = {COPY(newsletters, "This page is in maintenance mode and is temporarily unavailable.",)} -newsletters-to-update-your-email-preferences = {COPY(newsletters, "To update your email preferences, please check back in a little while. Thanks!",)} -""", - newsletters=newsletters, - ) - + [ - FTL.Message( - id=FTL.Identifier("newsletters-we-love-sharing-updates"), - value=REPLACE( - newsletters, - "We love sharing updates about all the awesome things happening at Mozilla.", - { - "Mozilla": TERM_REFERENCE("brand-name-mozilla"), - }, - ), - ), - ] - + transforms_from( - """ -newsletters-set-your-preferences-below = {COPY(newsletters, "Set your preferences below to make sure you always receive the news you want.",)} -newsletters-your-email-address = {COPY(newsletters, "Your email address:",)} -newsletters-country-or-region = {COPY(newsletters, "Country or region:",)} -newsletters-country = {COPY(newsletters, "Country:",)} -newsletters-language = {COPY(newsletters, "Language:",)} -newsletters-not-all-subscriptions-are = {COPY(newsletters, "Not all subscriptions are supported in all the languages listed. Almost all are offered in English, German and French.",)} -newsletters-format = {COPY(newsletters, "Format:",)} -newsletters-text-subscribers-will-receive = {COPY(newsletters, "Text subscribers will receive an email twice a year to confirm continuation of the subscription. Those emails may include HTML.",)} -""", - newsletters=newsletters, - ) - + [ - FTL.Message( - id=FTL.Identifier("newsletters-many-of-our-communications"), - value=REPLACE( - newsletters, - 'Many of our communications are related to an account you’ve signed up for, such as Firefox Accounts, MDN Web Docs, or Add-on Developer. To manage one of your accounts or see a list of all the accounts visit our account management support page.', - { - "%%": "%", - "%s": VARIABLE_REFERENCE("url"), - "Firefox Accounts": TERM_REFERENCE("brand-name-firefox-accounts"), - "MDN Web Docs": TERM_REFERENCE("brand-name-mdn-web-docs"), - }, - ), - ), - FTL.Message( - id=FTL.Identifier("newsletters-to-get-access-to-the-whole"), - value=REPLACE( - newsletters, - 'To get access to the whole world of Firefox products, knowledge and services in one account, join us! Learn more about the benefits here.', - { - "%%": "%", - "%s": VARIABLE_REFERENCE("url"), - "Firefox": TERM_REFERENCE("brand-name-firefox"), - }, - ), - ), - FTL.Message( - id=FTL.Identifier("newsletters-there-are-many-ways-to"), - value=REPLACE( - newsletters, - 'There are many ways to engage with Mozilla and Firefox. If you didn’t find what you were looking for here, check out our community pages.', - { - "%%": "%", - "%s": VARIABLE_REFERENCE("url"), - "Mozilla": TERM_REFERENCE("brand-name-mozilla"), - "Firefox": TERM_REFERENCE("brand-name-firefox"), - }, - ), - ), - FTL.Message( - id=FTL.Identifier("newsletters-is-not-a-valid-newsletter"), - value=REPLACE( - newsletters, - "%s is not a valid newsletter", - { - "%%": "%", - "%s": VARIABLE_REFERENCE("newsletter"), - }, - ), - ), - ] - + transforms_from( - """ -newsletters-subscribe = {COPY(newsletters, "Subscribe",)} -newsletters-remove-me-from-all-the = {COPY(newsletters, "Remove me from all the subscriptions on this page",)} -newsletters-save-preferences = {COPY(newsletters, "Save Preferences",)} -""", - newsletters=newsletters, - ), - ) - - ctx.add_transforms( - "mozorg/newsletters.ftl", - "mozorg/newsletters.ftl", - transforms_from( - """ -newsletters-newsletter-email-recovery = {COPY(newsletters, "Newsletter email recovery",)} -newsletters-manage-your-newsletter = {COPY(newsletters, "Manage your Newsletter Subscriptions",)} -newsletters-enter-your-email-address = {COPY(newsletters, "Enter your email address and we’ll send you a link to your email preference center.",)} -newsletters-send-me-a-link = {COPY(newsletters, "Send me a link",)} -""", - newsletters=newsletters, - ), - ) - - ctx.add_transforms( - "mozorg/newsletters.ftl", - "mozorg/newsletters.ftl", - transforms_from( - """ -newsletters-youve-been-unsubscribed = {COPY(newsletters, "You’ve been unsubscribed.",)} -newsletters-were-sorry-to-see-you-go = {COPY(newsletters, "We’re sorry to see you go.",)} -newsletters-would-you-mind-telling-us = {COPY(newsletters, "Would you mind telling us why you’re leaving?",)} -newsletters-other = {COPY(newsletters, "Other…",)} -newsletters-submit = {COPY(newsletters, "Submit",)} -newsletters-thanks-for-telling-us-why = {COPY(newsletters, "Thanks for telling us why you’re leaving.",)} -""", - newsletters=newsletters, - ) - + [ - FTL.Message( - id=FTL.Identifier("newsletters-while-here-why-not-check"), - value=REPLACE( - newsletters, - "While here, why not check out some more Firefox awesomeness.", - { - "Firefox": TERM_REFERENCE("brand-name-firefox"), - }, - ), - ), - ] - + transforms_from( - """ -newsletters-get-up-and-go = {COPY(newsletters, "Get up and go",)} -newsletters-its-your-web-anywhere-you = {COPY(newsletters, "It’s your Web anywhere you go.",)} -""", - newsletters=newsletters, - ) - + [ - FTL.Message( - id=FTL.Identifier("newsletters-get-firefox-for-mobile"), - value=REPLACE( - newsletters, - "Get Firefox for mobile!", - { - "Firefox": TERM_REFERENCE("brand-name-firefox"), - }, - ), - ), - ] - + transforms_from( - """ -newsletters-added-extras = {COPY(newsletters, "Added extras",)} -""", - newsletters=newsletters, - ) - + [ - FTL.Message( - id=FTL.Identifier("newsletters-make-firefox-do-more-with"), - value=REPLACE( - newsletters, - "Make Firefox do more with add-ons.", - { - "Firefox": TERM_REFERENCE("brand-name-firefox"), - }, - ), - ), - ] - + transforms_from( - """ -newsletters-find-out-how = {COPY(newsletters, "Find out how!",)} -newsletters-about-us = {COPY(newsletters, "About us",)} -""", - newsletters=newsletters, - ) - + [ - FTL.Message( - id=FTL.Identifier("newsletters-whats-mozilla-all-about"), - value=REPLACE( - newsletters, - "What’s Mozilla all about?", - { - "Mozilla": TERM_REFERENCE("brand-name-mozilla"), - }, - ), - ), - ] - + transforms_from( - """ -newsletters-were-glad-you-asked = {COPY(newsletters, "We’re glad you asked!",)} -""", - newsletters=newsletters, - ), - ) - - ctx.add_transforms( - "mozorg/newsletters.ftl", - "mozorg/newsletters.ftl", - transforms_from( - """ -newsletters-love-the-web-so-do-we = {COPY(newsletters, "Love the web? So do we!",)} -""", - newsletters=newsletters, - ) - + [ - FTL.Message( - id=FTL.Identifier("newsletters-unlock-the-world-of-web"), - value=REPLACE( - newsletters, - "Unlock the world of web development with our weekly Mozilla Developer Newsletter. Each edition brings you coding techniques and best practices, MDN updates, info about emerging technologies, developer tools tips, and more.", - { - "Mozilla": TERM_REFERENCE("brand-name-mozilla"), - "MDN": TERM_REFERENCE("brand-name-mdn"), - }, - ), - ), - ] - + transforms_from( - """ -newsletters-join-thousands-of-developers = {COPY(newsletters, "Join thousands of developers like you who are learning the best of web development.",)} -""", - newsletters=newsletters, - ), - ) - - ctx.add_transforms( - "mozorg/newsletters.ftl", - "mozorg/newsletters.ftl", - transforms_from( - """ -newsletters-put-more-fox-in-your-inbox = {COPY(newsletters, "Put more fox in your inbox.",)} -""", - newsletters=newsletters, - ) - + [ - FTL.Message( - id=FTL.Identifier("newsletters-see-where-the-web-can-take"), - value=REPLACE( - newsletters, - "See where the Web can take you with monthly Firefox tips, tricks and Internet intel.", - { - "Firefox": TERM_REFERENCE("brand-name-firefox"), - }, - ), - ), - ], - ) - - ctx.add_transforms( - "mozorg/newsletters.ftl", - "mozorg/newsletters.ftl", - transforms_from( - """ -newsletters-we-are-sorry-but-there = {COPY(newsletters, "We are sorry, but there was a problem with our system. Please try again later!",)} -newsletters-thanks-for-updating-your = {COPY(newsletters, "Thanks for updating your email preferences.",)} -newsletters-the-supplied-link-has-expired-long = {COPY(newsletters, "The supplied link has expired or is not valid. You will receive a new one in the next newsletter, or below you can request an email with the link.",)} -newsletters-success-an-email-has-been-sent = {COPY(newsletters, "Success! An email has been sent to you with your preference center link. Thanks!",)} -newsletters-this-is-not-a-valid-email = {COPY(newsletters, "This is not a valid email address. Please check the spelling.",)} -newsletters-about-standards = {COPY(newsletters, "About Standards",)} -newsletters-addon-development = {COPY(newsletters, "Addon Development",)} -newsletters-a-developers-guide = {COPY(newsletters, "A developer's guide to highlights of Web platform innovations, best practices, new documentation and more.",)} -newsletters-developer-newsletter = {COPY(newsletters, "Developer Newsletter",)} -newsletters-drumbeat-newsgroup = {COPY(newsletters, "Drumbeat Newsgroup",)} -newsletters-dont-miss-the-latest = {COPY(newsletters, "Don’t miss the latest announcements about our desktop browser.",)} -newsletters-periodic-email-updates = {COPY(newsletters, "Periodic email updates about our annual international film competition.",)} -newsletters-get-involved = {COPY(newsletters, "Get Involved",)} -newsletters-internet-health-report = {COPY(newsletters, "Internet Health Report",)} -newsletters-keep-up-with-our-annual = {COPY(newsletters, "Keep up with our annual compilation of research and stories on the issues of privacy & security, openness, digital inclusion, decentralization, and web literacy.",)} -newsletters-get-all-the-knowledge = {COPY(newsletters, "Get all the knowledge you need to stay safer and smarter online.",)} -newsletters-knowledge-is-power = {COPY(newsletters, "Knowledge is Power",)} -newsletters-about-labs = {COPY(newsletters, "About Labs",)} -newsletters-maker-party = {COPY(newsletters, "Maker Party",)} -newsletters-desktop = {COPY(newsletters, "Desktop",)} -newsletters-regular-updates-to-keep = {COPY(newsletters, "Regular updates to keep you informed and active in our fight for a better internet.",)} -newsletters-special-accouncements-and-messages = {COPY(newsletters, "Special announcements and messages from the team dedicated to keeping the Web free and open.",)} -newsletters-updates-from-our-global = {COPY(newsletters, "Updates from our global community, helping people learn the most important skills of our age: the ability to read, write and participate in the digital world.",)} -newsletters-email-updates-from-vouched = {COPY(newsletters, "Email updates for vouched Mozillians on mozillians.org.",)} -newsletters-mozillians = {COPY(newsletters, "Mozillians",)} -newsletters-were-building-the-technology = {COPY(newsletters, "We're building the technology of the future. Come explore with us.",)} -newsletters-news-and-information = {COPY(newsletters, "News and information related to the health of the web.",)} -newsletters-shapre-of-the-web = {COPY(newsletters, "Shape of the Web",)} -newsletters-former-university-program = {COPY(newsletters, "Former University program from 2008-2011, now retired and relaunched as the Firefox Student Ambassadors program.")} -newsletters-student-reps = {COPY(newsletters, "Student Reps",)} -newsletters-add-your-voice = {COPY(newsletters, "Add your voice to petitions, events and initiatives that fight for the future of the web.",)} -newsletters-take-action = {COPY(newsletters, "Take Action for the Internet",)} -newsletters-new-product-testing = {COPY(newsletters, "New Product Testing",)} -newsletters-you-send-too-many-emails = {COPY(newsletters, "You send too many emails.",)} -newsletters-your-content-wasnt-relevant = {COPY(newsletters, "Your content wasn't relevant to me.",)} -newsletters-your-email-design = {COPY(newsletters, "Your email design was too hard to read.",)} -newsletters-i-didnt-sign-up = {COPY(newsletters, "I didn't sign up for this.",)} -""", - newsletters=newsletters, - ) - + [ - FTL.Message( - id=FTL.Identifier("newsletters-this-email-address-is-not"), - value=REPLACE( - newsletters, - 'This email address is not in our system. Please double check your address or subscribe to our newsletters.', - { - "%%": "%", - "%s": VARIABLE_REFERENCE("url"), - }, - ), - ), - FTL.Message( - id=FTL.Identifier("newsletters-join-mozillians-all-around"), - value=REPLACE( - newsletters, - "Join Mozillians all around the world and learn about impactful opportunities to support Mozilla’s mission.", - { - "Mozilla": TERM_REFERENCE("brand-name-mozilla"), - }, - ), - ), - FTL.Message( - id=FTL.Identifier("newsletters-mozilla-community"), - value=REPLACE( - newsletters, - "Mozilla Community", - { - "Mozilla": TERM_REFERENCE("brand-name-mozilla"), - }, - ), - ), - FTL.Message( - id=FTL.Identifier("newsletters-a-monthly-newsletter-affiliates"), - value=REPLACE( - newsletters, - "A monthly newsletter to keep you up to date with the Firefox Affiliates program.", - { - "Firefox": TERM_REFERENCE("brand-name-firefox"), - }, - ), - ), - FTL.Message( - id=FTL.Identifier("newsletters-firefox-affiliates"), - value=REPLACE( - newsletters, - "Firefox Affiliates", - { - "Firefox": TERM_REFERENCE("brand-name-firefox"), - }, - ), - ), - FTL.Message( - id=FTL.Identifier("newsletters-a-monthly-newsletter-ambassadors"), - value=REPLACE( - newsletters, - "A monthly newsletter on how to get involved with Mozilla on your campus.", - { - "Mozilla": TERM_REFERENCE("brand-name-mozilla"), - }, - ), - ), - FTL.Message( - id=FTL.Identifier("newsletters-firefox-student-ambassadors"), - value=REPLACE( - newsletters, - "Firefox Student Ambassadors", - { - "Firefox": TERM_REFERENCE("brand-name-firefox"), - }, - ), - ), - FTL.Message( - id=FTL.Identifier("newsletters-aurora"), - value=REPLACE( - newsletters, - "Aurora", - { - "Aurora": TERM_REFERENCE("brand-name-aurora"), - }, - ), - ), - FTL.Message( - id=FTL.Identifier("newsletters-read-about-the-latest-features"), - value=REPLACE( - newsletters, - "Read about the latest features for Firefox desktop and mobile before the final release.", - { - "Firefox": TERM_REFERENCE("brand-name-firefox"), - }, - ), - ), - FTL.Message( - id=FTL.Identifier("newsletters-beta-news"), - value=REPLACE( - newsletters, - "Beta News", - { - "Beta": TERM_REFERENCE("brand-name-beta"), - }, - ), - ), - FTL.Message( - id=FTL.Identifier("newsletters-download-firefox-for-android"), - value=REPLACE( - newsletters, - "Download Firefox for Android", - { - "Firefox": TERM_REFERENCE("brand-name-firefox"), - "Android": TERM_REFERENCE("brand-name-android"), - }, - ), - ), - FTL.Message( - id=FTL.Identifier("newsletters-get-firefox-for-android"), - value=REPLACE( - newsletters, - "Get Firefox for Android", - { - "Firefox": TERM_REFERENCE("brand-name-firefox"), - "Android": TERM_REFERENCE("brand-name-android"), - }, - ), - ), - FTL.Message( - id=FTL.Identifier("newsletters-download-firefox-for-ios"), - value=REPLACE( - newsletters, - "Download Firefox for iOS", - { - "Firefox": TERM_REFERENCE("brand-name-firefox"), - "iOS": TERM_REFERENCE("brand-name-ios"), - }, - ), - ), - FTL.Message( - id=FTL.Identifier("newsletters-download-firefox-for-mobile"), - value=REPLACE( - newsletters, - "Download Firefox for Mobile", - { - "Firefox": TERM_REFERENCE("brand-name-firefox"), - }, - ), - ), - FTL.Message( - id=FTL.Identifier("newsletters-get-the-most-firefox-account"), - value=REPLACE( - newsletters, - "Get the most out of your Firefox Account.", - { - "Firefox Account": TERM_REFERENCE("brand-name-firefox-account"), - }, - ), - ), - FTL.Message( - id=FTL.Identifier("newsletters-firefox-accounts-tips"), - value=REPLACE( - newsletters, - "Firefox Accounts Tips", - { - "Firefox Accounts": TERM_REFERENCE("brand-name-firefox-accounts"), - }, - ), - ), - FTL.Message( - id=FTL.Identifier("newsletters-firefox-for-desktop"), - value=REPLACE( - newsletters, - "Firefox for desktop", - { - "Firefox": TERM_REFERENCE("brand-name-firefox"), - }, - ), - ), - FTL.Message( - id=FTL.Identifier("newsletters-firefox-flicks"), - value=REPLACE( - newsletters, - "Firefox Flicks", - { - "Firefox": TERM_REFERENCE("brand-name-firefox"), - }, - ), - ), - FTL.Message( - id=FTL.Identifier("newsletters-be-the-first-to-know"), - value=REPLACE( - newsletters, - "Be the first to know when Firefox is available for iOS devices.", - { - "Firefox": TERM_REFERENCE("brand-name-firefox"), - "iOS": TERM_REFERENCE("brand-name-ios"), - }, - ), - ), - FTL.Message( - id=FTL.Identifier("newsletters-firefox-ios"), - value=REPLACE( - newsletters, - "Firefox iOS", - { - "Firefox": TERM_REFERENCE("brand-name-firefox"), - "iOS": TERM_REFERENCE("brand-name-ios"), - }, - ), - ), - FTL.Message( - id=FTL.Identifier("newsletters-dont-miss-important-news"), - value=REPLACE( - newsletters, - "Don’t miss important news and updates about your Firefox OS device.", - { - "Firefox OS": TERM_REFERENCE("brand-name-firefox-os"), - }, - ), - ), - FTL.Message( - id=FTL.Identifier("newsletters-firefox-os-smartphone-owner"), - value=REPLACE( - newsletters, - "Firefox OS smartphone owner?", - { - "Firefox OS": TERM_REFERENCE("brand-name-firefox-os"), - }, - ), - ), - FTL.Message( - id=FTL.Identifier("newsletters-a-monthly-newsletter-and-special"), - value=REPLACE( - newsletters, - "A monthly newsletter and special announcements on how to get the most from your Firefox OS device, including the latest features and coolest Firefox Marketplace apps.", - { - "Firefox OS": TERM_REFERENCE("brand-name-firefox-os"), - "Firefox Marketplace": TERM_REFERENCE("brand-name-firefox-marketplace"), - }, - ), - ), - FTL.Message( - id=FTL.Identifier("newsletters-firefox-os-and-you"), - value=REPLACE( - newsletters, - "Firefox OS + You", - { - "Firefox OS": TERM_REFERENCE("brand-name-firefox-os"), - }, - ), - ), - FTL.Message( - id=FTL.Identifier("newsletters-get-a-weekly-tip"), - value=REPLACE( - newsletters, - "Get a weekly tip on how to super-charge your Firefox experience.", - { - "Firefox": TERM_REFERENCE("brand-name-firefox"), - }, - ), - ), - FTL.Message( - id=FTL.Identifier("newsletters-firefox-weekly-tips"), - value=REPLACE( - newsletters, - "Firefox Weekly Tips", - { - "Firefox": TERM_REFERENCE("brand-name-firefox"), - }, - ), - ), - FTL.Message( - id=FTL.Identifier("newsletters-join-mozilla"), - value=REPLACE( - newsletters, - "Join Mozilla", - { - "Mozilla": TERM_REFERENCE("brand-name-mozilla"), - }, - ), - ), - FTL.Message( - id=FTL.Identifier("newsletters-mozillas-largest-celebration"), - value=REPLACE( - newsletters, - "Mozilla's largest celebration of making and learning on the web.", - { - "Mozilla": TERM_REFERENCE("brand-name-mozilla"), - }, - ), - ), - FTL.Message( - id=FTL.Identifier("newsletters-discover-the-latest"), - value=REPLACE( - newsletters, - "Discover the latest, coolest HTML5 apps on Firefox OS.", - { - "Firefox OS": TERM_REFERENCE("brand-name-firefox-os"), - }, - ), - ), - FTL.Message( - id=FTL.Identifier("newsletters-firefox-os"), - value=REPLACE( - newsletters, - "Firefox OS", - { - "Firefox OS": TERM_REFERENCE("brand-name-firefox-os"), - }, - ), - ), - FTL.Message( - id=FTL.Identifier("newsletters-android"), - value=REPLACE( - newsletters, - "Android", - { - "Android": TERM_REFERENCE("brand-name-android"), - }, - ), - ), - FTL.Message( - id=FTL.Identifier("newsletters-keep-up-with-releases"), - value=REPLACE( - newsletters, - "Keep up with releases and news about Firefox for Android.", - { - "Android": TERM_REFERENCE("brand-name-android"), - "Firefox": TERM_REFERENCE("brand-name-firefox"), - }, - ), - ), - FTL.Message( - id=FTL.Identifier("newsletters-firefox-for-android"), - value=REPLACE( - newsletters, - "Firefox for Android", - { - "Android": TERM_REFERENCE("brand-name-android"), - "Firefox": TERM_REFERENCE("brand-name-firefox"), - }, - ), - ), - FTL.Message( - id=FTL.Identifier("newsletters-get-how-tos"), - value=REPLACE( - newsletters, - "Get how-tos, advice and news to make your Firefox experience work best for you.", - { - "Firefox": TERM_REFERENCE("brand-name-firefox"), - }, - ), - ), - FTL.Message( - id=FTL.Identifier("newsletters-firefox-news"), - value=REPLACE( - newsletters, - "Firefox News", - { - "Firefox": TERM_REFERENCE("brand-name-firefox"), - }, - ), - ), - FTL.Message( - id=FTL.Identifier("newsletters-special-announcements-about-mozilla"), - value=REPLACE( - newsletters, - "Special announcements about Mozilla's annual, hands-on festival dedicated to forging the future of the open Web.", - { - "Mozilla": TERM_REFERENCE("brand-name-mozilla"), - }, - ), - ), - FTL.Message( - id=FTL.Identifier("newsletters-mozilla-festival"), - value=REPLACE( - newsletters, - "Mozilla Festival", - { - "Mozilla Festival": TERM_REFERENCE("brand-name-mozilla-festival"), - }, - ), - ), - FTL.Message( - id=FTL.Identifier("newsletters-mozilla-news"), - value=REPLACE( - newsletters, - "Mozilla News", - { - "Mozilla": TERM_REFERENCE("brand-name-mozilla"), - }, - ), - ), - FTL.Message( - id=FTL.Identifier("newsletters-mozilla"), - value=REPLACE( - newsletters, - "Mozilla", - { - "Mozilla": TERM_REFERENCE("brand-name-mozilla"), - }, - ), - ), - FTL.Message( - id=FTL.Identifier("newsletters-mozilla-learning-network"), - value=REPLACE( - newsletters, - "Mozilla Learning Network", - { - "Mozilla": TERM_REFERENCE("brand-name-mozilla"), - }, - ), - ), - FTL.Message( - id=FTL.Identifier("newsletters-mozilla-labs"), - value=REPLACE( - newsletters, - "Mozilla Labs", - { - "Mozilla Labs": TERM_REFERENCE("brand-name-mozilla-labs"), - }, - ), - ), - FTL.Message( - id=FTL.Identifier("newsletters-firefox-os-news"), - value=REPLACE( - newsletters, - "Firefox OS news, tips, launch information and where to buy.", - { - "Firefox OS": TERM_REFERENCE("brand-name-firefox-os"), - }, - ), - ), - FTL.Message( - id=FTL.Identifier("newsletters-help-us-make-a-better"), - value=REPLACE( - newsletters, - "Help us make a better Firefox for you by test-driving our latest products and features.", - { - "Firefox": TERM_REFERENCE("brand-name-firefox"), - }, - ), - ), - FTL.Message( - id=FTL.Identifier("newsletters-special-announcements-helping-you"), - value=REPLACE( - newsletters, - "Special announcements helping you get the most out of Webmaker.", - { - "Webmaker": TERM_REFERENCE("brand-name-webmaker"), - }, - ), - ), - FTL.Message( - id=FTL.Identifier("newsletters-webmaker"), - value=REPLACE( - newsletters, - "Webmaker", - { - "Webmaker": TERM_REFERENCE("brand-name-webmaker"), - }, - ), - ), - FTL.Message( - id=FTL.Identifier("newsletters-im-keeping-in-touch"), - value=REPLACE( - newsletters, - "I'm keeping in touch with Mozilla on Facebook and Twitter instead.", - { - "Mozilla": TERM_REFERENCE("brand-name-mozilla"), - "Facebook": TERM_REFERENCE("brand-name-facebook"), - "Twitter": TERM_REFERENCE("brand-name-twitter"), - }, - ), - ), - ], - ) - - ctx.add_transforms( - "mozorg/newsletters.ftl", - "mozorg/newsletters.ftl", - transforms_from( - """ -newsletters-sign-up-read-up-stay-informed = {COPY(newsletters, "Sign up, read up,
stay informed.",)} -newsletters-sign-up-read-up-make-a-difference = {COPY(newsletters, "Sign up. Read up.
Make a difference.",)} -newsletters-get-smart-on-the-issues = {COPY(newsletters, "Get smart on the issues affecting your life online.",)} -""", - newsletters=newsletters, - ) - + [ - FTL.Message( - id=FTL.Identifier("newsletters-get-the-mozilla-newsletter"), - value=REPLACE( - newsletters, - "Get the Mozilla newsletter to stay informed about issues challenging the health of the Internet and to discover how you can get involved.", - { - "Mozilla": TERM_REFERENCE("brand-name-mozilla"), - }, - ), - ), - ], - ) diff --git a/lib/fluent_migrations/newsletter/opt-out-confirmation.py b/lib/fluent_migrations/newsletter/opt-out-confirmation.py deleted file mode 100644 index 6bc080e4b6..0000000000 --- a/lib/fluent_migrations/newsletter/opt-out-confirmation.py +++ /dev/null @@ -1,42 +0,0 @@ -from __future__ import absolute_import - -import fluent.syntax.ast as FTL -from fluent.migrate import COPY, REPLACE -from fluent.migrate.helpers import TERM_REFERENCE, VARIABLE_REFERENCE, transforms_from - -opt_out_confirmation = "newsletter/opt-out-confirmation.lang" - - -def migrate(ctx): - """Migrate bedrock/newsletter/templates/newsletter/opt-out-confirmation.html, part {index}.""" - - ctx.add_transforms( - "newsletter/opt-out-confirmation.ftl", - "newsletter/opt-out-confirmation.ftl", - transforms_from( - """ -opt-out-confirmation-cool-we-hear = {COPY(opt_out_confirmation, "Cool. We hear you.",)} -opt-out-confirmation-youre-now-opted = {COPY(opt_out_confirmation, "You’re now opted out of a series of emails about setting up your account.",)} -opt-out-confirmation-youll-continue = {COPY(opt_out_confirmation, "You’ll continue to receive other emails you’re subscribed to, along with occasional important updates about your account. To manage all your subscriptions, enter your email below — we need to make sure we’re talking to the right person.",)} -opt-out-confirmation-your-email = {COPY(opt_out_confirmation, "Your email address:",)} -opt-out-confirmation-yournameexamplecom = {COPY(opt_out_confirmation, "yourname@example.com",)} -opt-out-confirmation-manage-preferences = {COPY(opt_out_confirmation, "Manage Preferences",)} -opt-out-confirmation-prefer-to-get = {COPY(opt_out_confirmation, "Prefer to get information another way?",)} -opt-out-confirmation-check-out-our = {COPY(opt_out_confirmation, "Check out our blogs",)} -opt-out-confirmation-get-help = {COPY(opt_out_confirmation, "Get help",)} -""", - opt_out_confirmation=opt_out_confirmation, - ) - + [ - FTL.Message( - id=FTL.Identifier("opt-out-confirmation-subscribe-to"), - value=REPLACE( - opt_out_confirmation, - "Subscribe to occasional newsletter updates from Firefox", - { - "Firefox": TERM_REFERENCE("brand-name-firefox"), - }, - ), - ), - ], - ) diff --git a/lib/fluent_migrations/privacy/__init__.py b/lib/fluent_migrations/privacy/__init__.py deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/lib/fluent_migrations/privacy/faq.py b/lib/fluent_migrations/privacy/faq.py deleted file mode 100644 index 78ddfb8162..0000000000 --- a/lib/fluent_migrations/privacy/faq.py +++ /dev/null @@ -1,361 +0,0 @@ -from __future__ import absolute_import - -import fluent.syntax.ast as FTL -from fluent.migrate import COPY, REPLACE -from fluent.migrate.helpers import TERM_REFERENCE, VARIABLE_REFERENCE, transforms_from - -faq = "privacy/faq.lang" - - -def migrate(ctx): - """Migrate bedrock/privacy/templates/privacy/faq.html, part {index}.""" - - ctx.add_transforms( - "privacy/faq.ftl", - "privacy/faq.ftl", - [ - FTL.Message( - id=FTL.Identifier("privacy-faq-mozillas-data-privacy-faq"), - value=REPLACE( - faq, - "Mozilla’s Data Privacy FAQ", - { - "Mozilla": TERM_REFERENCE("brand-name-mozilla"), - }, - ), - ), - FTL.Message( - id=FTL.Identifier("privacy-faq-at-mozilla-we-respect-and-protect-desc"), - value=REPLACE( - faq, - "At Mozilla we respect and protect your personal information.", - { - "Mozilla": TERM_REFERENCE("brand-name-mozilla"), - }, - ), - ), - ] - + transforms_from( - """ -privacy-faq-we-stand-for-people-over-profit = {COPY(faq, "We Stand for People Over Profit.",)} -""", - faq=faq, - ) - + [ - FTL.Message( - id=FTL.Identifier("privacy-faq-it-can-be-tricky-for-people"), - value=REPLACE( - faq, - "It can be tricky for people to know what to expect of any software or services they use today. The technology that powers our lives is complex and people don’t have the time to dig into the details. That is still true for Firefox, where we find that people have many different ideas of what is happening under the hood in their browser.", - { - "Firefox": TERM_REFERENCE("brand-name-firefox"), - }, - ), - ), - FTL.Message( - id=FTL.Identifier("privacy-faq-at-mozilla-we-respect-and-protect"), - value=REPLACE( - faq, - "At Mozilla, we respect and protect your personal information:", - { - "Mozilla": TERM_REFERENCE("brand-name-mozilla"), - }, - ), - ), - FTL.Message( - id=FTL.Identifier("privacy-faq-we-follow-a-set-of-data-privacy"), - value=REPLACE( - faq, - 'We follow a set of Data Privacy Principles that shape our approach to privacy in the Firefox desktop and mobile browsers.', - { - "%%": "%", - "%(link)s": VARIABLE_REFERENCE("link"), - "Firefox": TERM_REFERENCE("brand-name-firefox"), - }, - ), - ), - ] - + transforms_from( - """ -privacy-faq-we-only-collect-the-data-we = {COPY(faq, "We only collect the data we need to make the best products.",)} -privacy-faq-we-put-people-in-control-of = {COPY(faq, "We put people in control of their data and online experiences.",)} -""", - faq=faq, - ) - + [ - FTL.Message( - id=FTL.Identifier("privacy-faq-we-adhere-to-no-surprises-principle"), - value=REPLACE( - faq, - "We adhere to “no surprises” principle, meaning we work hard to ensure people’s understanding of Firefox matches reality.", - { - "Firefox": TERM_REFERENCE("brand-name-firefox"), - }, - ), - ), - FTL.Message( - id=FTL.Identifier("privacy-faq-the-following-questions-and"), - value=REPLACE( - faq, - "The following questions and answers should help you understand what to expect from Mozilla and Firefox:", - { - "Mozilla": TERM_REFERENCE("brand-name-mozilla"), - "Firefox": TERM_REFERENCE("brand-name-firefox"), - }, - ), - ), - FTL.Message( - id=FTL.Identifier("privacy-faq-i-use-firefox-for-almost-everything"), - value=REPLACE( - faq, - "I use Firefox for almost everything on the Web. You folks at Mozilla must know a ton of stuff about me, right?", - { - "Mozilla": TERM_REFERENCE("brand-name-mozilla"), - "Firefox": TERM_REFERENCE("brand-name-firefox"), - }, - ), - ), - FTL.Message( - id=FTL.Identifier("privacy-faq-firefox-the-web-browser-that"), - value=REPLACE( - faq, - "Firefox, the web browser that runs on your device or computer, is your gateway to the internet. Your browser will manage a lot of information about the websites you visit, but that information stays on your device. Mozilla, the company that makes Firefox, doesn’t collect it (unless you ask us to).", - { - "Mozilla": TERM_REFERENCE("brand-name-mozilla"), - "Firefox": TERM_REFERENCE("brand-name-firefox"), - }, - ), - ), - ] - + transforms_from( - """ -privacy-faq-really-you-dont-collect-my-browsing = {COPY(faq, "Really, you don’t collect my browsing history?",)} -""", - faq=faq, - ) - + [ - FTL.Message( - id=FTL.Identifier("privacy-faq-mozilla-doesnt-know-as-much"), - value=REPLACE( - faq, - 'Mozilla doesn’t know as much as you’d expect about how people browse the web. As a browser maker, that’s actually a big challenge for us. That is why we’ve built opt-in tools, such as Firefox Pioneer, which allows interested users to give us insight into their web browsing. If you sync your browsing history across Firefox installations, we don’t know what that history is - because it’s encrypted by your device.', - { - "%%": "%", - "%(link)s": VARIABLE_REFERENCE("link"), - "Mozilla": TERM_REFERENCE("brand-name-mozilla"), - "Firefox": TERM_REFERENCE("brand-name-firefox"), - }, - ), - ), - ] - + transforms_from( - """ -privacy-faq-it-seems-like-every-company = {COPY(faq, "It seems like every company on the web is buying and selling my data. You’re probably no different.",)} -""", - faq=faq, - ) - + [ - FTL.Message( - id=FTL.Identifier("privacy-faq-mozilla-doesnt-sell-data-about"), - value=REPLACE( - faq, - "Mozilla doesn’t sell data about you, and we don’t buy data about you.", - { - "Mozilla": TERM_REFERENCE("brand-name-mozilla"), - }, - ), - ), - ] - + transforms_from( - """ -privacy-faq-wait-so-how-do-you-make-money = {COPY(faq, "Wait, so how do you make money?",)} -""", - faq=faq, - ) - + [ - FTL.Message( - id=FTL.Identifier("privacy-faq-mozilla-is-not-your-average"), - value=REPLACE( - faq, - 'Mozilla is not your average organization. Founded as a community open source project in 1998, Mozilla is a mission-driven organization working towards a more healthy internet. The majority of Mozilla Corporation’s revenue is from royalties earned through Firefox web browser search partnerships and distribution deals around the world. You can learn more about how we make money in our annual financial report.', - { - "%%": "%", - "%(link)s": VARIABLE_REFERENCE("link"), - "Mozilla Corporation": TERM_REFERENCE("brand-name-mozilla-corporation"), - "Mozilla": TERM_REFERENCE("brand-name-mozilla"), - "Firefox": TERM_REFERENCE("brand-name-firefox"), - }, - ), - ), - ] - + transforms_from( - """ -privacy-faq-okay-those-first-few-were-softballs = {COPY(faq, "Okay, those first few were softballs. What data do you collect?",)} -""", - faq=faq, - ) - + [ - FTL.Message( - id=FTL.Identifier("privacy-faq-mozilla-does-collect-a-limited"), - value=REPLACE( - faq, - 'Mozilla does collect a limited set of data by default from Firefox that helps us to understand how people use the browser. That data is tied to a random identifier, rather than your name or email address. You can read more about that on our privacy notice and you can read the full documentation for that data collection.', - { - "%%": "%", - "%(privacy)s": VARIABLE_REFERENCE("privacy"), - "%(data)s": VARIABLE_REFERENCE("data"), - "Mozilla": TERM_REFERENCE("brand-name-mozilla"), - "Firefox": TERM_REFERENCE("brand-name-firefox"), - }, - ), - ), - ] - + transforms_from( - """ -privacy-faq-we-make-our-documentation-public = {COPY(faq, "We make our documentation public so that anyone can verify what we say is true, tell us if we need to improve, and have confidence that we aren’t hiding anything.",)} -privacy-faq-that-documentation-is-gobbledygook = {COPY(faq, "That documentation is gobbledygook to me! Can you give it to me in plain English?",)} -""", - faq=faq, - ) - + [ - FTL.Message( - id=FTL.Identifier("privacy-faq-there-are-two-categories-of"), - value=REPLACE( - faq, - "There are two categories of data that we collect by default in our release version of Firefox.", - { - "Firefox": TERM_REFERENCE("brand-name-firefox"), - }, - ), - ), - FTL.Message( - id=FTL.Identifier("privacy-faq-the-first-is-what-we-call-technical"), - value=REPLACE( - faq, - 'The first is what we call "technical data." This is data about the browser itself, such as the operating system it is running on and information about errors or crashes.', - { - "Firefox": TERM_REFERENCE("brand-name-firefox"), - }, - ), - ), - FTL.Message( - id=FTL.Identifier("privacy-faq-the-second-is-what-we-call-interaction"), - value=REPLACE( - faq, - 'The second is what we call "interaction data." This is data about an individual\'s engagement with Firefox, such as the number of tabs that were open, the status of user preferences, or number of times certain browser features were used, such as screenshots or containers. For example, we collect this data in terms of the back button, that arrow in the upper left corner of your browser that lets you navigate back to a previous webpage in a way that shows us someone used the back button, but doesn’t tell what specific webpages are accessed.', - { - "Firefox": TERM_REFERENCE("brand-name-firefox"), - }, - ), - ), - FTL.Message( - id=FTL.Identifier("privacy-faq-do-you-collect-more-data-in"), - value=REPLACE( - faq, - "Do you collect more data in pre-release versions of Firefox?", - { - "Firefox": TERM_REFERENCE("brand-name-firefox"), - }, - ), - ), - FTL.Message( - id=FTL.Identifier("privacy-faq-sort-of-in-addition-to-the-data"), - value=REPLACE( - faq, - "Sort-of. In addition to the data described above, we receive crash and error reports by default in pre-release version of Firefox.", - { - "Firefox": TERM_REFERENCE("brand-name-firefox"), - }, - ), - ), - FTL.Message( - id=FTL.Identifier("privacy-faq-we-may-also-collect-additional"), - value=REPLACE( - faq, - 'We may also collect additional data in pre-release for one of our studies. For example, some studies require what we call “web activity data” data, which may include URLs and other information about certain websites. This helps us answer specific questions to improve Firefox, for example, how to better integrate popular websites in specific locales.', - { - "%%": "%", - "%(link)s": VARIABLE_REFERENCE("link"), - "Firefox": TERM_REFERENCE("brand-name-firefox"), - }, - ), - ), - FTL.Message( - id=FTL.Identifier("privacy-faq-mozillas-pre-release-versions"), - value=REPLACE( - faq, - "Mozilla’s pre-release versions of Firefox are development platforms, frequently updated with experimental features. We collect more data in pre-release than what we do after release in order to understand how these experimental features are working. You can opt out of having this data collected in preferences.", - { - "Mozilla": TERM_REFERENCE("brand-name-mozilla"), - "Firefox": TERM_REFERENCE("brand-name-firefox"), - }, - ), - ), - ] - + transforms_from( - """ -privacy-faq-but-why-do-you-collect-any-data = {COPY(faq, "But why do you collect any data at all?",)} -privacy-faq-if-we-dont-know-how-the-browser = {COPY(faq, "If we don’t know how the browser is performing or which features people use, we can’t make it better and deliver the great product you want. We’ve invested in building data collection and analysis tools that allow us to make smart decisions about our product while respecting people's privacy.",)} -privacy-faq-data-collection-still-bugs-me = {COPY(faq, "Data collection still bugs me. Can I turn it off?",)} -""", - faq=faq, - ) - + [ - FTL.Message( - id=FTL.Identifier("privacy-faq-yes-user-control-is-one-of-our"), - value=REPLACE( - faq, - 'Yes. User control is one of our data privacy principles. We put that into practice in Firefox on our privacy settings page, which serves as a one-stop shop for anyone looking to take control of their privacy in Firefox. You can turn off data collection there.', - { - "%%": "%", - "%(settings)s": VARIABLE_REFERENCE("settings"), - "%(data)s": VARIABLE_REFERENCE("data"), - "Firefox": TERM_REFERENCE("brand-name-firefox"), - }, - ), - ), - ] - + transforms_from( - """ -privacy-faq-what-about-my-account-data = {COPY(faq, "What about my account data?",)} -privacy-faq-we-are-big-believers-of-data = {COPY(faq, "We are big believers of data minimization and not asking for things we don't need.",)} -""", - faq=faq, - ) - + [ - FTL.Message( - id=FTL.Identifier("privacy-faq-you-dont-need-an-account-to"), - value=REPLACE( - faq, - "You don't need an account to use Firefox. Accounts are required to sync data across devices, but we only ask you for an email address. We don't want to know things like your name, address, birthday and phone number.", - { - "%%": "%", - "%(accounts)s": VARIABLE_REFERENCE("accounts"), - "Firefox": TERM_REFERENCE("brand-name-firefox"), - }, - ), - ), - ] - + transforms_from( - """ -privacy-faq-you-use-digital-advertising = {COPY(faq, "You use digital advertising as part of your marketing mix. Do you buy people's data to better target your online ads?",)} -privacy-faq-no-we-do-not-buy-peoples-data = {COPY(faq, "No, we do not buy people's data to target advertising.",)} -privacy-faq-we-do-ask-our-advertising-partners = {COPY(faq, "We do ask our advertising partners to use only first party data that websites and publishers know about all users, such as the browser you are using and the device you are on.",)} -privacy-faq-well-it-seems-like-you-really = {COPY(faq, "Well, it seems like you really have my back on this privacy stuff.",)} -privacy-faq-yes-we-do = {COPY(faq, "Yes, we do.",)} -""", - faq=faq, - ) - + [ - FTL.Message( - id=FTL.Identifier("privacy-faq-find-out-more-about-how-mozilla"), - value=REPLACE( - faq, - "Find out more about how Mozilla protects the internet.", - { - "Mozilla": TERM_REFERENCE("brand-name-mozilla"), - }, - ), - ), - ], - ) diff --git a/lib/fluent_migrations/privacy/index.py b/lib/fluent_migrations/privacy/index.py deleted file mode 100644 index ebac041ee3..0000000000 --- a/lib/fluent_migrations/privacy/index.py +++ /dev/null @@ -1,186 +0,0 @@ -from __future__ import absolute_import - -import fluent.syntax.ast as FTL -from fluent.migrate import COPY, REPLACE -from fluent.migrate.helpers import TERM_REFERENCE, VARIABLE_REFERENCE, transforms_from - -index = "privacy/index.lang" - - -def migrate(ctx): - """Migrate bedrock/privacy/templates/privacy/index.html, part {index}.""" - - ctx.add_transforms( - "privacy/index.ftl", - "privacy/index.ftl", - [ - FTL.Message( - id=FTL.Identifier("privacy-index-mozilla-privacy"), - value=REPLACE( - index, - "Mozilla Privacy", - { - "Mozilla": TERM_REFERENCE("brand-name-mozilla"), - }, - ), - ), - FTL.Message( - id=FTL.Identifier("privacy-index-contact-mozilla"), - value=REPLACE( - index, - "Contact Mozilla", - { - "Mozilla": TERM_REFERENCE("brand-name-mozilla"), - }, - ), - ), - ] - + transforms_from( - """ -privacy-index-if-you-want-to-make-a-correction = {COPY(index, "If you want to make a correction to your information, or you have any questions about our privacy policies, please get in touch with:",)} -""", - index=index, - ) - + [ - FTL.Message( - id=FTL.Identifier("privacy-index-see-here-for-data-subject"), - value=REPLACE( - index, - 'See here for Data Subject Access Requests.', - { - "%%": "%", - "%(dsar)s": VARIABLE_REFERENCE("dsar"), - }, - ), - ), - FTL.Message( - id=FTL.Identifier("privacy-index-for-product-support-requests"), - value=REPLACE( - index, - 'For product support requests, please visit our forums.', - { - "%%": "%", - "%(sumo)s": VARIABLE_REFERENCE("sumo"), - }, - ), - ), - ] - + transforms_from( - """ -privacy-index-data-privacy-principles = {COPY(index, "Data Privacy Principles",)} -""", - index=index, - ) - + [ - FTL.Message( - id=FTL.Identifier("privacy-index-mozillas-data-privacy-principles"), - value=REPLACE( - index, - 'Mozilla\'s Data Privacy Principles inspire our practices that respect and protect people who use the Internet. Learn how these principles shape Firefox and all of our products in this FAQ.', - { - "%%": "%", - "%(principles)s": VARIABLE_REFERENCE("principles"), - "%(faq)s": VARIABLE_REFERENCE("faq"), - "Mozilla": TERM_REFERENCE("brand-name-mozilla"), - "Firefox": TERM_REFERENCE("brand-name-firefox"), - }, - ), - ), - FTL.Message( - id=FTL.Identifier("privacy-index-mozillas-data-privacy-principles"), - value=REPLACE( - index, - 'Mozilla\'s Data Privacy Principles inspire our practices that respect and protect people who use the Internet. Learn how these principles shape Firefox and all of our products in this FAQ.', - { - "%%": "%", - "%(faq)s": VARIABLE_REFERENCE("faq"), - "Mozilla": TERM_REFERENCE("brand-name-mozilla"), - "Firefox": TERM_REFERENCE("brand-name-firefox"), - }, - ), - ), - ] - + transforms_from( - """ -privacy-index-transparency-report = {COPY(index, "Transparency Report",)} -""", - index=index, - ) - + [ - FTL.Message( - id=FTL.Identifier("privacy-index-as-an-open-source-project"), - value=REPLACE( - index, - 'As an open source project, transparency and openness are an essential part of Mozilla’s founding principles. Our codebases are open and auditable. Our development work is open. Our bi-annual Transparency Report also demonstrates our commitment to these principles.', - { - "%%": "%", - "%(report)s": VARIABLE_REFERENCE("report"), - "Mozilla": TERM_REFERENCE("brand-name-mozilla"), - }, - ), - ), - FTL.Message( - id=FTL.Identifier("privacy-index-to-review-and-comment-on-proposed"), - value=REPLACE( - index, - 'To review and comment on proposed changes to our privacy policies, subscribe to Mozilla’s governance group.', - { - "%%": "%", - "%(group)s": VARIABLE_REFERENCE("group"), - "Mozilla": TERM_REFERENCE("brand-name-mozilla"), - }, - ), - ), - FTL.Message( - id=FTL.Identifier("privacy-index-to-review-and-comment-on-proposed"), - value=REPLACE( - index, - 'To review and comment on proposed changes to our privacy policies subscribe to Mozilla’s Governance Group.', - { - "%%": "%", - "%(group)s": VARIABLE_REFERENCE("group"), - "Mozilla": TERM_REFERENCE("brand-name-mozilla"), - }, - ), - ), - FTL.Message( - id=FTL.Identifier("privacy-index-read-more-about-our-ongoing"), - value=REPLACE( - index, - 'Read more about our ongoing privacy and security public policy work on Mozilla\'s Open Policy and Advocacy Blog.', - { - "%%": "%", - "%(blog)s": VARIABLE_REFERENCE("blog"), - "Mozilla": TERM_REFERENCE("brand-name-mozilla"), - }, - ), - ), - FTL.Message( - id=FTL.Identifier("privacy-index-mozilla-websites-communications"), - value=REPLACE( - index, - "Mozilla Websites, Communications & Cookies", - { - "Mozilla": TERM_REFERENCE("brand-name-mozilla"), - }, - ), - ), - FTL.Message( - id=FTL.Identifier("privacy-index-firefox-fire-tv"), - value=REPLACE( - index, - "Firefox for Fire TV", - { - "Firefox": TERM_REFERENCE("brand-name-firefox"), - "Fire TV": TERM_REFERENCE("brand-name-fire-tv"), - }, - ), - ), - ] - + transforms_from( - """ -privacy-index-outdated-policies = {COPY(index, "Outdated Policies",)} -""", - index=index, - ), - ) diff --git a/lib/fluent_migrations/privacy/principles.py b/lib/fluent_migrations/privacy/principles.py deleted file mode 100644 index 0185d479a4..0000000000 --- a/lib/fluent_migrations/privacy/principles.py +++ /dev/null @@ -1,65 +0,0 @@ -from __future__ import absolute_import - -import fluent.syntax.ast as FTL -from fluent.migrate import COPY, REPLACE -from fluent.migrate.helpers import TERM_REFERENCE, VARIABLE_REFERENCE, transforms_from - -principles = "privacy/principles.lang" - - -def migrate(ctx): - """Migrate bedrock/privacy/templates/privacy/principles.html, part {index}.""" - - ctx.add_transforms( - "privacy/principles.ftl", - "privacy/principles.ftl", - transforms_from( - """ -privacy-principles-data-privacy-principles = {COPY(principles, "Data Privacy Principles",)} -""", - principles=principles, - ) - + [ - FTL.Message( - id=FTL.Identifier("privacy-principles-mozilla-is-an-open-source"), - value=REPLACE( - principles, - "Mozilla is an open source project with a mission to improve your Internet experience. This is a driving force behind our privacy practices.", - { - "Mozilla": TERM_REFERENCE("brand-name-mozilla"), - }, - ), - ), - FTL.Message( - id=FTL.Identifier("privacy-principles-the-following-five-principles"), - value=REPLACE( - principles, - 'The following five principles stem from the Mozilla Manifesto and inform how we:', - { - "%%": "%", - "%(link)s": VARIABLE_REFERENCE("link"), - "Mozilla": TERM_REFERENCE("brand-name-mozilla"), - }, - ), - ), - ] - + transforms_from( - """ -privacy-principles-develop-our-products = {COPY(principles, "develop our products and services",)} -privacy-principles-manage-user-data-we-collect = {COPY(principles, "manage user data we collect",)} -privacy-principles-select-and-interact-with = {COPY(principles, "select and interact with partners",)} -privacy-principles-shape-our-public-policy = {COPY(principles, "shape our public policy and advocacy work",)} -privacy-principles-no-surprises = {COPY(principles, "No surprises",)} -privacy-principles-use-and-share-information = {COPY(principles, "Use and share information in a way that is transparent and benefits the user.",)} -privacy-principles-user-control = {COPY(principles, "User control",)} -privacy-principles-develop-products-and = {COPY(principles, "Develop products and advocate for best practices that put users in control of their data and online experiences.",)} -privacy-principles-limited-data = {COPY(principles, "Limited data",)} -privacy-principles-collect-what-we-need = {COPY(principles, "Collect what we need, de-identify where we can and delete when no longer necessary.",)} -privacy-principles-sensible-settings = {COPY(principles, "Sensible settings",)} -privacy-principles-design-for-a-thoughtful = {COPY(principles, "Design for a thoughtful balance of safety and user experience.",)} -privacy-principles-defense-in-depth = {COPY(principles, "Defense in depth",)} -privacy-principles-maintain-multi-layered = {COPY(principles, "Maintain multi-layered security controls and practices, many of which are publicly verifiable.",)} -""", - principles=principles, - ), - ) diff --git a/lib/fluent_migrations/ui.py b/lib/fluent_migrations/ui.py deleted file mode 100644 index da5689743e..0000000000 --- a/lib/fluent_migrations/ui.py +++ /dev/null @@ -1,36 +0,0 @@ -from __future__ import absolute_import - -import fluent.syntax.ast as FTL -from fluent.migrate import COPY, REPLACE -from fluent.migrate.helpers import TERM_REFERENCE, VARIABLE_REFERENCE, transforms_from - -main = "main.lang" - - -def migrate(ctx): - """Migrate common UI strings from main.lang, part {index}.""" - - ctx.add_transforms( - "ui.ftl", - "ui.ftl", - transforms_from( - """ -ui-back-to-home-page = {COPY(main, "Back to home page",)} -ui-return-to-top = {COPY(main, "Return to top",)} -ui-close = {COPY(main, "Close",)} -ui-previous = {COPY(main, "Previous",)} -ui-next = {COPY(main, "Next",)} -ui-watch-the-video = {COPY(main, "Watch the video",)} -ui-replay = {COPY(main, "Replay",)} -ui-share = {COPY(main, "Share",)} -ui-menu = {COPY(main, "Menu",)} -ui-please-turn-on-javascript = {COPY(main, "Please turn on JavaScript to display this page correctly.",)} -ui-show-more = {COPY(main, "Show More",)} -ui-show-less = {COPY(main, "Show Less",)} -ui-show-all = {COPY(main, "Show All",)} -ui-hide-all = {COPY(main, "Hide All",)} -ui-learn-more = {COPY(main, "Learn more",)} -""", - main=main, - ), - ) diff --git a/lib/l10n_utils/__init__.py b/lib/l10n_utils/__init__.py index 4b26e2064b..963957ca6c 100644 --- a/lib/l10n_utils/__init__.py +++ b/lib/l10n_utils/__init__.py @@ -12,12 +12,11 @@ from django.template import TemplateDoesNotExist, loader from django.utils.translation.trans_real import parse_accept_lang_header from django.views.generic import TemplateView +from product_details import product_details + from bedrock.base.urlresolvers import split_path -from .dotlang import get_translations_native_names from .fluent import fluent_l10n, get_active_locales as ftl_active_locales -from .gettext import translations_for_template -from .utils import get_l10n_path def template_source_url(template): @@ -94,7 +93,6 @@ def render(request, template, context=None, ftl_files=None, activation_files=Non # Every template gets its own .lang file, so figure out what it is # and pass it in the context context["template"] = template - context["langfile"] = get_l10n_path(template) context["template_source_url"] = template_source_url(template) # if `locales` is given use it as the full list of active translations @@ -102,20 +100,16 @@ def render(request, template, context=None, ftl_files=None, activation_files=Non translations = context["active_locales"] del context["active_locales"] else: + translations = [settings.LANGUAGE_CODE] if activation_files: translations = set() for af in activation_files: - if af.endswith(".html"): - translations.update(translations_for_template(af)) - else: - translations.update(ftl_active_locales(af)) + translations.update(ftl_active_locales(af)) translations = sorted(translations) elif l10n: translations = l10n.active_locales - else: - translations = translations_for_template(template) # if `add_active_locales` is given then add it to the translations for the template if "add_active_locales" in context: @@ -135,21 +129,14 @@ def render(request, template, context=None, ftl_files=None, activation_files=Non response["Vary"] = "Accept-Language" return response - # Render try #1: Look for l10n template in locale/{{ LANG }}/templates/ - l10n_tmpl = "%s/templates/%s" % (request.locale, template) - try: - return django_render(request, l10n_tmpl, context, **kwargs) - except TemplateDoesNotExist: - pass - - # Render try #2: Look for locale-specific template in app/templates/ + # Look for locale-specific template in app/templates/ locale_tmpl = ".{}".format(request.locale).join(splitext(template)) try: return django_render(request, locale_tmpl, context, **kwargs) except TemplateDoesNotExist: pass - # Render try #3: Render originally requested/default template + # Render originally requested/default template return django_render(request, template, context, **kwargs) @@ -209,6 +196,24 @@ def get_best_translation(translations, accept_languages): return translations[0] +def get_translations_native_names(locales): + """ + Return a dict of locale codes and native language name strings. + + Returned dict is suitable for use in view contexts and is filtered to only codes in PROD_LANGUAGES. + + :param locales: list of locale codes + :return: dict, like {'en-US': 'English (US)', 'fr': 'Français'} + """ + translations = {} + for locale in locales: + if locale in settings.PROD_LANGUAGES: + language = product_details.languages.get(locale) + translations[locale] = language["native"] if language else locale + + return translations + + class LangFilesMixin: """Generic views mixin that uses l10n_utils to render responses.""" diff --git a/lib/l10n_utils/dotlang.py b/lib/l10n_utils/dotlang.py index d356a01b62..3093bf200b 100644 --- a/lib/l10n_utils/dotlang.py +++ b/lib/l10n_utils/dotlang.py @@ -10,184 +10,26 @@ system. It caches them using the django caching library, but it could potentially just use thread-local variables. Caching seems safer at the expense of another caching layer.""" -import codecs -import inspect -import os -import re -from functools import partial -from django.conf import settings from django.core.cache import caches from django.utils.functional import lazy from jinja2 import Markup -from product_details import product_details -from lib.l10n_utils import translation -from lib.l10n_utils.utils import ContainsEverything, strip_whitespace - -ALL_THE_THINGS = ContainsEverything() -FORMAT_IDENTIFIER_RE = re.compile( - r"""(% - (?:\((\w+)\))? # Mapping key - s)""", - re.VERBOSE, -) -TAG_REGEX = re.compile(r"^## ([\w-]+) ##") cache = caches["l10n"] -def _replace_variables(match): - var_name = match[2] - if not var_name: - var_name = "VARIABLE_MISSING" - - return f"{{ ${var_name} }}" - - -def convert_variables(lang_str): - return FORMAT_IDENTIFIER_RE.sub(_replace_variables, lang_str) - - -def parse(path, skip_untranslated=True, extract_comments=False): - """ - Parse a dotlang file and return a dict of translations. - :param path: Absolute path to a lang file. - :param skip_untranslated: Exclude strings for which the ID and translation - match. - :param extract_comments: Extract one line comments from template if True - :return: dict - """ - trans = {} - - if not os.path.exists(path): - return trans - - with codecs.open(path, "r", "utf-8", errors="replace") as lines: - source = None - comment = None - - for line in lines: - l10n_tag = None - if "�" in line: - mail_error(path, line) - - line = line.strip() - if not line: - continue - - if line[0] == "#": - comment = line.lstrip("#").strip() - continue - - if line[0] == ";": - source = line[1:] - elif source: - for tag in ("{ok}", "{l10n-extra}"): - if line.lower().endswith(tag): - l10n_tag = tag.strip("{}") - line = line[: -len(tag)] - line = line.strip() - if skip_untranslated and source == line and l10n_tag != "ok": - continue - if extract_comments: - trans[source] = [comment, line] - comment = None - else: - trans[source] = line - - return trans - - -def mail_error(path, message): - """Email managers when an error is detected""" - from django.core import mail - - subject = "%s is corrupted" % path - mail.mail_managers(subject, message) - - def translate(text, files): - """Search a list of .lang files for a translation""" - lang = translation.get_language(True) - - # don't attempt to translate the default language. - if lang == settings.LANGUAGE_CODE: - return Markup(text) - - tweaked_text = strip_whitespace(text) - - for file_ in files: - key = "dotlang-%s-%s" % (lang, file_) - path = str(settings.LOCALES_PATH / lang / f"{file_}.lang") - trans = cache.get(key) - if trans is None: - trans = parse(path) - cache.set(key, trans) - - if tweaked_text in trans: - original = FORMAT_IDENTIFIER_RE.findall(text) - translated = FORMAT_IDENTIFIER_RE.findall(trans[tweaked_text]) - if set(original) != set(translated): - explanation = "The translation has a different set of replaced text (aka %s)" - message = "%s\n\n%s\n%s" % (explanation, text, trans[tweaked_text]) - mail_error(path, message) - return Markup(text) - return Markup(trans[tweaked_text]) + """ + An almost no-op to avoid triggering the old l10n machinery. + """ return Markup(text) -def _get_extra_lang_files(): - frame = inspect.currentframe() - new_lang_files = [] - if frame is None: - if settings.DEBUG: - import warnings - - warnings.warn( - "Your Python runtime does not support the frame stack. Extra LANG_FILES specified in Python source files will not work.", - RuntimeWarning, - ) - else: - try: - # gets value of LANG_FILE constant in calling module if specified. - # have to go back 2x to compensate for this function. - new_lang_files = frame.f_back.f_back.f_globals.get("LANG_FILES", []) - finally: - del frame - if new_lang_files: - if isinstance(new_lang_files, str): - new_lang_files = [new_lang_files] - return [lf for lf in new_lang_files if lf not in settings.DOTLANG_FILES] - - def gettext(text, *args, **kwargs): """ - Translate a piece of text from the global files. If `LANG_FILES` is defined - in the module from which this function is called, those files (or file) - will be searched first for the translation, followed by the default files. - - :param text: string to translate - :param args: items for interpolation into `text` - :param lang_files: extra lang file names to search for a translation. - NOTE: DO NOT USE THIS for string extraction. It will NOT respect - the values in this kwarg when extracting strings. This is only useful - if you know the string is in a different file but you don't want to - add that file for the whole module via the `LANG_FILES` constant. - :return: translated string + An almost no-op to avoid triggering the old l10n machinery. """ - lang_files = kwargs.pop("lang_files", []) - if isinstance(lang_files, list): - lang_files = lang_files[:] - else: - lang_files = [lang_files] - if not lang_files: - lang_files += _get_extra_lang_files() - lang_files += settings.DOTLANG_FILES - - text = translate(text, lang_files) - if args: - text = text % args return text @@ -195,115 +37,9 @@ _lazy_proxy = lazy(gettext, str) def gettext_lazy(*args, **kwargs): - lang_files = _get_extra_lang_files() - if lang_files: - return partial(_lazy_proxy, lang_files=lang_files)(*args, **kwargs) return _lazy_proxy(*args, **kwargs) # backward compat _ = gettext _lazy = gettext_lazy - - -def lang_file_is_active(path, lang=None): - """ - If the lang file for a locale exists and has the correct comment returns - True, and False otherwise. - :param path: the relative lang file name - :param lang: the language code - :return: bool - """ - return lang_file_has_tag(path, lang, "active") - - -def lang_file_tag_set(path, lang=None): - """Return a set of tags for a specific lang file and locale. - - :param path: the relative lang file name - :param lang: the language code or the lang of the request if omitted - :return: set of strings - """ - if settings.DEV or lang == settings.LANGUAGE_CODE: - return ALL_THE_THINGS - - lang = lang or translation.get_language(True) - fpath = settings.LOCALES_PATH / lang / f"{path}.lang" - cache_key = f"tag:locale/{lang}/{path}.lang" - tag_set = cache.get(cache_key) - if tag_set is None: - tag_set = set() - try: - with codecs.open(fpath, "r", "utf-8", errors="replace") as lines: - for line in lines: - # Filter out Byte order Mark - line = line.replace("\ufeff", "") - m = TAG_REGEX.match(line) - if m: - tag_set.add(m.group(1)) - else: - # Stop at the first non-tag line. - break - except IOError: - pass - - cache.set(cache_key, tag_set) - - return tag_set - - -def lang_file_has_tag(path, lang=None, tag="active"): - """ - Return True if the lang file exists and has a line like "^## tag ##" - at the top. Stops looking at the line that doesn't have a tag. - - Always returns true for the default lang. - - :param path: the relative lang file name - :param lang: the language code or the lang of the request if omitted - @param tag: The string that should appear between ##'s. Can contain - alphanumerics and "_". - @return: bool - """ - return tag in lang_file_tag_set(path, lang) - - -def get_translations_for_langfile(langfile): - """ - Return the list of available translations for the langfile. - - :param langfile: the path to a lang file, retrieved with get_l10n_path() - :return: list, like ['en-US', 'fr'] - """ - - cache_key = "translations:%s" % langfile - translations = cache.get(cache_key, None) - - if translations: - return translations - - translations = [] - for lang in settings.PROD_LANGUAGES: - if lang in product_details.languages and (lang == settings.LANGUAGE_CODE or lang_file_is_active(langfile, lang)): - translations.append(lang) - - cache.set(cache_key, translations) - return translations - - -def get_translations_native_names(locales): - """ - Return a dict of locale codes and native language name strings. - - Returned dict is suitable for use in view contexts and is filtered to only codes in PROD_LANGUAGES. - - :param locales: list of locale codes - :return: dict, like {'en-US': 'English (US)', 'fr': 'Français'} - """ - translations = {} - for locale in locales: - if locale in settings.PROD_LANGUAGES: - language = product_details.languages.get(locale) - translations[locale] = language["native"] if language else locale - - return translations diff --git a/lib/l10n_utils/extract.py b/lib/l10n_utils/extract.py deleted file mode 100644 index bd765f5c66..0000000000 --- a/lib/l10n_utils/extract.py +++ /dev/null @@ -1,59 +0,0 @@ -# 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 https://mozilla.org/MPL/2.0/. - -# mostly borrowed from tower - -from babel.messages.extract import extract_python as babel_extract_py -from jinja2 import ext - -from lib.l10n_utils.utils import strip_whitespace - - -def add_context(context, message): - # \x04 is a magic gettext number. - return "%s\x04%s" % (context, message) - - -def tweak_message(message): - """We piggyback on jinja2's babel_extract() (really, Babel's extract_* - functions) but they don't support some things we need so this function will - tweak the message. Specifically: - - 1) We strip whitespace from the msgid. Jinja2 will only strip - whitespace from the ends of a string so linebreaks show up in - your .po files still. - - 2) Babel doesn't support context (msgctxt). We hack that in ourselves - here. - """ - if isinstance(message, str): - message = strip_whitespace(message) - elif isinstance(message, tuple): - # A tuple of 2 has context, 3 is plural, 4 is plural with context - if len(message) == 2: - message = add_context(message[1], message[0]) - elif len(message) == 3: - if all(isinstance(x, str) for x in message[:2]): - singular, plural, num = message - message = (strip_whitespace(singular), strip_whitespace(plural), num) - elif len(message) == 4: - singular, plural, num, ctxt = message - message = (add_context(ctxt, strip_whitespace(singular)), add_context(ctxt, strip_whitespace(plural)), num) - return message - - -def extract_python(fileobj, keywords, comment_tags, options): - for lineno, funcname, message, comments in list(babel_extract_py(fileobj, keywords, comment_tags, options)): - - message = tweak_message(message) - - yield lineno, funcname, message, comments - - -def extract_jinja2(fileobj, keywords, comment_tags, options): - for lineno, funcname, message, comments in list(ext.babel_extract(fileobj, keywords, comment_tags, options)): - - message = tweak_message(message) - - yield lineno, funcname, message, comments diff --git a/lib/l10n_utils/gettext.py b/lib/l10n_utils/gettext.py deleted file mode 100644 index faa741b184..0000000000 --- a/lib/l10n_utils/gettext.py +++ /dev/null @@ -1,375 +0,0 @@ -# coding=utf-8 - -# 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 https://mozilla.org/MPL/2.0/. - -import codecs -import os -import re -from os.path import join -from tokenize import NAME, NEWLINE, OP, generate_tokens, untokenize - -from django.conf import settings -from django.core.cache import caches -from django.template.loader import get_template - -from jinja2 import Environment - -from lib.l10n_utils.utils import ContainsEverything, get_l10n_path - -from .dotlang import ( - get_translations_for_langfile, - lang_file_tag_set, - parse as parse_lang, -) - -ALL_THE_THINGS = ContainsEverything() -REGEX_URL = re.compile(r".* (\S+/\S+\.[^:]+).*") -cache = caches["l10n"] - - -def parse_po(path): - msgs = {} - - if not os.path.exists(path): - return msgs - - with codecs.open(path, "r", "utf-8") as lines: - - def parse_string(s): - # remove first and last characters which are " - s = s.strip()[1:-1] - return s.replace('\\"', '"') - - def extract_content(s): - # strip the first word and quotes - return parse_string(s.split(" ", 1)[1]) - - msgid = None - msgpath = None - msgcomment = None - - for line in lines: - line = line.strip() - if not line: - continue - - if line.startswith("#:"): - matches = REGEX_URL.match(line) - if matches: - msgpath = matches.group(1) - elif line.startswith("#."): - commentline = line.lstrip("#.").strip() - if msgcomment: - msgcomment += " " + commentline - else: - msgcomment = commentline - elif line.startswith("msgid"): - msgid = extract_content(line) - elif line.startswith("msgstr") and msgid and msgpath: - if msgpath not in msgs: - msgs[msgpath] = [] - msgs[msgpath].append([msgcomment, msgid]) - msgid = None - msgpath = None - msgcomment = None - elif msgid is not None: - msgid += parse_string(line) - - return msgs - - -def po_msgs(domain): - path = settings.LOCALES_PATH / "templates" / "LC_MESSAGES" / f"{domain}.pot" - return parse_po(str(path)) - - -def translated_strings(file_): - path = str(settings.LOCALES_PATH / "templates", file_) - trans = list(parse_lang(path, skip_untranslated=False).keys()) - return trans - - -def lang_file(name, lang): - return str(settings.LOCALES_PATH / lang / name) - - -def is_template(path): - (base, ext) = os.path.splitext(path) - return ext == ".html" - - -def is_python(path): - (base, ext) = os.path.splitext(path) - return ext == ".py" - - -def parse_python(path): - """ - Look though a python file and extract the specified `LANG_FILES` constant - value and return it. - - `LANG_FILES` must be defined at the module level, and can be a string or - list of strings. - """ - result = [] - in_lang = False - in_lang_val = False - with codecs.open(path, encoding="utf-8") as src_f: - tokens = generate_tokens(src_f.readline) - for token in tokens: - t_type, t_val, (t_row, t_col) = token[:3] - # find the start of the constant declaration - if t_type == NAME and t_col == 0 and t_val == "LANG_FILES": - in_lang = True - continue - if in_lang: - # we only want the value, so start recording after the = OP - if t_type == OP and t_val == "=": - in_lang_val = True - continue - # stop when there's a newline. continuation newlines are a - # different type so multiline list literals work fine - if t_type == NEWLINE: - break - if in_lang_val: - result.append((t_type, t_val)) - - if result: - new_lang_files = eval(untokenize(result)) - if isinstance(new_lang_files, str): - new_lang_files = [new_lang_files] - # remove empties - return [lf for lf in new_lang_files if lf] - return [] - - -def parse_template(path): - """Look through a template for the lang_files tag and extract the - given lang files""" - - cache_key = "template_lang_files:{0}".format(path) - lang_files = cache.get(cache_key) - if lang_files: - return lang_files - - src = codecs.open(path, encoding="utf-8").read() - tokens = Environment().lex(src) - lang_files = [] - - def ignore_whitespace(tokens): - token = next(tokens) - if token[1] == "whitespace": - return ignore_whitespace(tokens) - return token - - for token in tokens: - if token[1] == "block_begin": - block = ignore_whitespace(tokens) - - if block[1] == "name" and block[2] in ("set_lang_files", "add_lang_files"): - arg = ignore_whitespace(tokens) - - # Extract all the arguments - while arg[1] != "block_end": - lang_files.append(arg[2].strip('"')) - arg = ignore_whitespace(tokens) - - # remove empties - lang_files = [lf for lf in lang_files if lf] - if lang_files: - cache.set(cache_key, lang_files) - return lang_files - return [] - - -def _get_template_tag_set(lang, path): - lang_files = [get_l10n_path(path)] - template = get_template(path) - lang_files.extend(parse_template(template.template.filename)) - tag_set = set() - for lf in lang_files: - tag_set |= lang_file_tag_set(lf, lang) - return tag_set - - -def template_tag_set(path, lang): - """Given a template path, return a set of tags from the lang files for the lang. - - This should be for all of the lang files specified in the template. - - :param path: relative path to the template. - :param lang: language code - :return: set of strings - """ - if settings.DEV or lang == settings.LANGUAGE_CODE: - return ALL_THE_THINGS - - cache_key = "template_tag_set:{path}:{lang}".format(lang=lang, path=path) - tag_set = cache.get(cache_key) - if tag_set is None: - tag_set = _get_template_tag_set(lang, path) - cache.set(cache_key, tag_set) - - return tag_set - - -def template_has_tag(path, lang, tag): - """Given a template path, determine if it has a tag in a locale. - - It has the tag if either the template's lang file, or the lang file - specified in the "set_lang_files" template tag has the tag. - - :param path: relative path to the template. - :param lang: language code - :param tag: the tag in question - :return: boolean - """ - return tag in template_tag_set(path, lang) - - -def template_is_active(path, lang): - """Given a template path, determine if it should be active for a locale. - - It is active if either the template's lang file, or the lang file - specified in the "set_lang_files" template tag has the active tag. - - :param path: relative path to the template. - :param lang: language code - :return: boolean - """ - return template_has_tag(path, lang, "active") - - -def translations_for_template(template_name): - """ - Return the list of available translations for the template. - - :param template_name: name of the template passed to render. - :return: list, like ['en-US', 'fr'] - """ - lang_files = [get_l10n_path(template_name)] - template = get_template(template_name) - lang_files.extend(parse_template(template.template.filename)) - active_translations = [] - for lf in lang_files: - active_translations.extend(get_translations_for_langfile(lf)) - - return active_translations - - -def langfiles_for_path(path): - """ - Find and return any extra lang files specified in templates or python - source files, or the first entry in the DOTLANG_FILES setting if none. - - :param path: path to a file containing strings to translate - :return: list of langfile names. - """ - lang_files = None - - if is_template(path): - # If the template explicitly specifies lang files, use those - lang_files = parse_template(join(settings.ROOT, path)) - # Otherwise, normalize the path name to a lang file - if not lang_files: - lang_files = [get_l10n_path(path)] - elif is_python(path): - # If the python file explicitly specifies lang files, use those - lang_files = parse_python(join(settings.ROOT, path)) - - if not lang_files: - # All other sources use the first main file - lang_files = settings.DOTLANG_FILES[:1] - - return lang_files - - -def pot_to_langfiles(domain="django"): - """Update the lang files in /locale/templates with extracted - strings.""" - - all_msgs = po_msgs(domain) - root = "templates" - - # Start off with some global lang files so that strings don't - # get duplicated everywhere - main_msgs = {} - for default_file in settings.DOTLANG_FILES: - main_msgs.update(parse_lang(lang_file(default_file + ".lang", root), skip_untranslated=False)) - - # Walk through the msgs and put them in the appropriate place. The - # complex part about this is that templates and python files can - # specify a list of lang files to pull from, so we need to check - # all of them for the strings and add it to the first lang file - # specified if not found. - for path, msgs in all_msgs.items(): - lang_files = [lang_file("%s.lang" % f, root) for f in langfiles_for_path(path)] - - # Get the current translations - curr = {} - for f in lang_files: - curr.update(parse_lang(f, skip_untranslated=False)) - - # Filter out the already translated - new_msgs = [msg for msg in msgs if msg[1] not in curr and msg[1] not in main_msgs] - - if new_msgs: - # Add translations to the first lang file - target = lang_files[0] - - _append_to_lang_file(target, new_msgs) - - -def find_lang_files(lang): - for root, dirs, files in os.walk(lang_file(lang, "")): - parts = root.split("locale/%s/" % lang) - if len(parts) > 1: - base = parts[1] - else: - base = "" - - for filename in files: - name, ext = os.path.splitext(filename) - - if ext == ".lang": - yield os.path.join(base, filename) - - -def merge_lang_files(langs): - for lang in langs: - print("Merging into %s..." % lang) - - for f in find_lang_files("templates"): - # Make sure the directory exists (might be a subdirectory) - d = os.path.dirname(f) - if d: - d = lang_file(d, lang) - if not os.path.exists(d): - os.makedirs(d) - - dest = lang_file(f, lang) - src_msgs = parse_lang(lang_file(f, "templates"), skip_untranslated=False, extract_comments=True) - dest_msgs = parse_lang(dest, skip_untranslated=False) - new_msgs = [src_msgs[msg] for msg in src_msgs if msg not in dest_msgs] - - _append_to_lang_file(dest, new_msgs) - - -def _append_to_lang_file(dest, new_msgs): - # make sure directory exists - if not os.path.exists(dest): - d = os.path.dirname(dest) - if not os.path.exists(d): - os.makedirs(d) - - with codecs.open(dest, "a", "utf-8") as out: - for msg in new_msgs: - if isinstance(msg, str): - msg = [None, msg] - out_str = "\n\n" - if msg[0]: - out_str += "# {comment}\n" - out_str += ";{msg}\n{msg}\n" - out.write(out_str.format(msg=msg[1], comment=msg[0])) diff --git a/lib/l10n_utils/management/commands/_fluent.py b/lib/l10n_utils/management/commands/_fluent.py deleted file mode 100644 index 10383177c7..0000000000 --- a/lib/l10n_utils/management/commands/_fluent.py +++ /dev/null @@ -1,71 +0,0 @@ -# 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 https://mozilla.org/MPL/2.0/. - -import re -from collections import OrderedDict -from importlib import import_module -from pathlib import Path - -from django.conf import settings - -from fluent.migrate.context import MigrationContext - -from lib.l10n_utils.utils import strip_whitespace - - -def migration_name(template): - "Derive migration name from template name" - for parent in template.parents: - if parent.name == "templates": - break - return template.relative_to(parent).with_suffix("") - - -def template_name(recipe): - "Find template for a migration recipe path" - name = recipe.resolve().relative_to(settings.FLUENT_MIGRATIONS_PATH).with_suffix(".html") - candidates = list(Path("bedrock").glob(f"*/templates/{name}")) - return candidates[0] - - -def get_migration_context(recipe_or_template, locale="en"): - "Create the merge context associated with the template or recipe" - if recipe_or_template.suffix == ".py": - name = recipe_or_template.resolve().relative_to(settings.FLUENT_MIGRATIONS_PATH).with_suffix("") - else: - name = migration_name(recipe_or_template) - pkg_name = ".".join(("",) + name.parts) - migration = import_module(pkg_name, settings.FLUENT_MIGRATIONS) - no_reference = locale == "en" - if no_reference: - ref_dir = None - # we're using the base localization (en-US) to create en - locale = settings.LANGUAGE_CODE - else: - ref_dir = settings.FLUENT_LOCAL_PATH / "en" - context = MigrationContext(locale, ref_dir, settings.LOCALES_PATH / locale, enforce_translated=no_reference) - migration.migrate(context) - return context - - -def get_lang_files(template, template_str): - lang_files = [Path(str(template).split("/templates/")[1]).with_suffix(".lang")] - for add_lang in ADD_LANG_RE.finditer(template_str): - if add_lang["cmd"] == "set": - lang_files = [] - for p in re.findall(r'"(.*?)"', add_lang["files"]): - f = Path(p).with_suffix(".lang") - lang_files.append(f) - return OrderedDict((f, f.stem.replace("-", "_")) for f in lang_files) - - -def trans_to_lang(string): - string = strip_whitespace(string) - return TRANS_PLACEABLE_RE.sub(lambda m: "%({})s".format(m.group("var")), string) - - -ADD_LANG_RE = re.compile(r"{% (?Padd|set)_lang_files (?P.*?) %}") -GETTEXT_RE = re.compile(r'\b_\([\'"](?P.+?)[\'"]\)' r"(\s*\|\s*format\((?P\w.+?)\))?", re.S) -TRANS_BLOCK_RE = re.compile(r"{%-?\s+trans\s+((?P\w.+?)\s+)?-?%\}\s*" r"(?P.+?)" r"\s*{%-?\s+endtrans\s+-?%\}", re.S) -TRANS_PLACEABLE_RE = re.compile(r"{{\s*(?P\w+)\s*}}") diff --git a/lib/l10n_utils/management/commands/_fluent_activation.py b/lib/l10n_utils/management/commands/_fluent_activation.py deleted file mode 100644 index 2c395f0364..0000000000 --- a/lib/l10n_utils/management/commands/_fluent_activation.py +++ /dev/null @@ -1,33 +0,0 @@ -# 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 https://mozilla.org/MPL/2.0/. - -import json - -from django.test.utils import override_settings - -from lib.l10n_utils.dotlang import get_translations_for_langfile - -from ._fluent import get_lang_files, template_name - - -class Activation: - def __init__(self, cmd): - self.stdout = cmd.stdout - self.dependencies = {} - - def handle(self, recipe_or_template): - if recipe_or_template.suffix == ".py": - template = template_name(recipe_or_template) - else: - template = recipe_or_template - with template.open("r") as tfh: - template_str = tfh.read() - lang_files = get_lang_files(template, template_str) - for lang_file in lang_files: - with override_settings(DEV=False): - locales = get_translations_for_langfile(lang_file.with_suffix("")) - if len(locales) < 2: - # Not the relevant lang file, probably - continue - print(json.dumps({"active_locales": locales}, indent=2)) diff --git a/lib/l10n_utils/management/commands/_fluent_ftl.py b/lib/l10n_utils/management/commands/_fluent_ftl.py deleted file mode 100644 index 1581c252f7..0000000000 --- a/lib/l10n_utils/management/commands/_fluent_ftl.py +++ /dev/null @@ -1,25 +0,0 @@ -# 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 https://mozilla.org/MPL/2.0/. - -from django.conf import settings - -from ._fluent import get_migration_context - - -class FTLCreator: - def __init__(self, cmd): - self.stdout = cmd.stdout - - def handle(self, recipe_or_template, locale): - no_reference = locale == "en" - context = get_migration_context(recipe_or_template, locale=locale) - if no_reference: - base = settings.FLUENT_LOCAL_PATH - else: - base = settings.FLUENT_REPO_PATH - for path, contents in context.serialize_changeset(None).items(): - en_path = base / locale / path - en_path.parent.mkdir(parents=True, exist_ok=True) - with en_path.open("w") as ftl_file: - ftl_file.write(contents) diff --git a/lib/l10n_utils/management/commands/_fluent_recipe.py b/lib/l10n_utils/management/commands/_fluent_recipe.py deleted file mode 100644 index b000a9b3a9..0000000000 --- a/lib/l10n_utils/management/commands/_fluent_recipe.py +++ /dev/null @@ -1,231 +0,0 @@ -# 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 https://mozilla.org/MPL/2.0/. - -import re -from collections import defaultdict - -from django.conf import settings -from django.utils.html import strip_tags -from django.utils.text import slugify - -from fluent.runtime import FluentBundle, FluentResource - -from lib.l10n_utils.utils import strip_whitespace - -from ._fluent import ( - GETTEXT_RE, - TRANS_BLOCK_RE, - get_lang_files, - migration_name, - trans_to_lang, -) - -STR_VARIABLE_RE = re.compile(r"%(?P\(\w+\))?s") -RECIPE_INTRO = """\ -from __future__ import absolute_import -import fluent.syntax.ast as FTL -from fluent.migrate.helpers import transforms_from -from fluent.migrate.helpers import VARIABLE_REFERENCE, TERM_REFERENCE -from fluent.migrate import REPLACE, COPY - -""" - -RECIPE_SIGNATURE = '''\ - -def migrate(ctx): - """Migrate {}, part {{index}}.""" - -''' - -ADD_TRANSFORMS = """\ - ctx.add_transforms( - "{ftl_file}", - "{ftl_file}", - {transforms} - ) -""" - -SIMPLE_WRAPPER = '''\ -transforms_from(""" -{copies} -""", {from_path}={from_path})\ -''' - -REPLACE_TEMPLATE = """\ - FTL.Message( - id=FTL.Identifier("{fluent_id}"), - value=REPLACE( - {from_path}, - "{lang_string}", - {{ -{replacements} - }} - ) - ), -""" - -VAR_REPLACE = """\ - "{lit}": VARIABLE_REFERENCE("{var}"),\ -""" - -TERM_REPLACE = """\ - "{lit}": TERM_REFERENCE("{var}"),\ -""" -BRAND_TERMS = None - - -def get_brand_terms(): - """Return a dict of term IDs and english strings ordered with strings longest to shortest""" - global BRAND_TERMS - if BRAND_TERMS is None: - bundle = FluentBundle(["en"]) - brands_path = settings.FLUENT_LOCAL_PATH / "en" / "brands.ftl" - with brands_path.open(encoding="utf-8") as brands_file: - resource = FluentResource(brands_file.read()) - - bundle.add_resource(resource) - tmp_dict = {k: bundle._lookup(k, term=True).value.value for k, v in bundle._terms.items()} - BRAND_TERMS = {k: tmp_dict[k] for k in sorted(tmp_dict, key=lambda k: len(tmp_dict[k]), reverse=True)} - - return BRAND_TERMS - - -def brand_terms_in_string(lang_string): - terms = [] - for term_id, value in get_brand_terms().items(): - if value in lang_string: - terms.append(term_id) - lang_string = lang_string.replace(value, "") - - return terms - - -class Recipe: - def __init__(self, cmd): - self.stdout = cmd.stdout - - def handle(self, template): - with template.open("r") as tfp: - template_str = tfp.read() - lang_files = get_lang_files(template, template_str) - lang_ids = self.get_lang_ids(template_str) - ids_for_file = self.get_ids_for_file(lang_ids, lang_files) - recipe = RECIPE_INTRO - for legacy, variable in lang_files.items(): - recipe += f'{variable} = "{legacy}"\n' - recipe += RECIPE_SIGNATURE.format(template) - - for from_path, ids in ids_for_file.items(): - transforms = self.get_transforms(template.stem, ids, lang_files[from_path]) - recipe += ADD_TRANSFORMS.format(ftl_file=from_path.with_suffix(".ftl"), transforms=transforms) - self.write_recipe_for(template, recipe) - - def get_lang_ids(self, template_str): - found = [] - found.extend((m.start(), strip_whitespace(m["string"]), m["args"]) for m in GETTEXT_RE.finditer(template_str)) - found.extend((m.start(), trans_to_lang(m["string"]), m["args"]) for m in TRANS_BLOCK_RE.finditer(template_str)) - found.sort(key=lambda t: t[0]) - return {string: args for pos, string, args in found} - - def get_ids_for_file(self, lang_ids, lang_files): - from compare_locales.parser import getParser - - parser = getParser("foo.lang") - ids_for_file = defaultdict(list) - for lf in lang_files.keys(): - f = settings.LOCALES_PATH / "en-US" / lf - if not f.exists(): - continue - parser.readFile(str(f)) - mapping = parser.parse() - for string_id in lang_ids.keys(): - if string_id in mapping: - ids_for_file[lf].append(string_id) - return ids_for_file - - def get_transforms(self, id_stem, lang_ids, from_path): - transforms = "" - simple_transforms = [] - replaces = [] - for lang_string in lang_ids: - fluent_id = self.string_to_ftl_id(id_stem, lang_string) - brands_in_string = brand_terms_in_string(lang_string) - if STR_VARIABLE_RE.search(lang_string) or brands_in_string: - if simple_transforms: - if transforms: - transforms += " + " - transforms += SIMPLE_WRAPPER.format(copies="\n".join(simple_transforms), from_path=from_path) - simple_transforms = [] - replaces.append(self.create_replace(from_path, fluent_id, lang_string, brands_in_string)) - else: - if replaces: - if transforms: - transforms += " + " - transforms += "[\n" - transforms += "".join(replaces) - transforms += " ]" - replaces = [] - escaped_lang_string = lang_string.replace('"', r"\"") - simple_transforms.append(f'{fluent_id} = {"{"}COPY({from_path}, "{escaped_lang_string}",){"}"}') - if simple_transforms: - if transforms: - transforms += " + " - transforms += SIMPLE_WRAPPER.format(copies="\n".join(simple_transforms), from_path=from_path) - if replaces: - if transforms: - transforms += " + " - transforms += "[\n" - transforms += "".join(replaces) - transforms += " ]" - return transforms - - def string_to_ftl_id(self, id_stem, string): - string = strip_tags(string) - slug_parts = slugify(string).split("-") - slug = id_stem - for part in slug_parts: - slug = "-".join([slug, part]) - if len(slug) > 30: - break - - return slug - - def create_replace(self, from_path, fluent_id, lang_string, brands_in_string): - replacers = {} - replacements = "" - for m in STR_VARIABLE_RE.finditer(lang_string): - varname = m.group("var") - if varname is None: - varname = "missing-var" - else: - varname = varname[1:-1] - if varname not in replacers: - replacers[varname] = m.group() - - if replacers: - replacements += ' "%%": "%",\n' - replacements += "\n".join(VAR_REPLACE.format(lit=lit, var=var) for var, lit in replacers.items()) - - if brands_in_string: - brands = get_brand_terms() - if replacements: - replacements += "\n" - replacements += "\n".join(TERM_REPLACE.format(lit=brands[brand], var=brand) for brand in brands_in_string) - - return REPLACE_TEMPLATE.format( - fluent_id=fluent_id, from_path=from_path, lang_string=lang_string.replace('"', r"\""), replacements=replacements - ) - - def write_recipe_for(self, template, recipe): - relpath = migration_name(template).with_suffix(".py") - mod = relpath.parent - (settings.FLUENT_MIGRATIONS_PATH / mod).mkdir(parents=True, exist_ok=True) - for mod in relpath.parents: - init = settings.FLUENT_MIGRATIONS_PATH / mod / "__init__.py" - if init.is_file(): - break - with init.open("w") as ifd: - ifd.write("") - with (settings.FLUENT_MIGRATIONS_PATH / relpath).open("w") as rfd: - rfd.write(recipe) diff --git a/lib/l10n_utils/management/commands/_fluent_templater.py b/lib/l10n_utils/management/commands/_fluent_templater.py deleted file mode 100644 index 5c9caeb679..0000000000 --- a/lib/l10n_utils/management/commands/_fluent_templater.py +++ /dev/null @@ -1,53 +0,0 @@ -# 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 https://mozilla.org/MPL/2.0/. - -from ._fluent import ( - GETTEXT_RE, - TRANS_BLOCK_RE, - get_migration_context, - strip_whitespace, - trans_to_lang, -) - - -class Templater: - def __init__(self, cmd): - self.stdout = cmd.stdout - self.dependencies = {} - - def handle(self, template): - self.dependencies.update(self.get_dependencies(template)) - with template.open("r") as tfp: - template_str = tfp.read() - template_str = GETTEXT_RE.sub(self.gettext_to_fluent, template_str) - template_str = TRANS_BLOCK_RE.sub(self.trans_to_fluent, template_str) - outname = template.stem + "_ftl.html" - with template.with_name(outname).open("w") as tfp: - tfp.write(template_str) - - def get_dependencies(self, template): - context = get_migration_context(template) - deps = {} - for (fluent_file, fluent_id), lang_set in context.dependencies.items(): - for _, lang_string in lang_set: - deps[lang_string] = fluent_id - return deps - - def gettext_to_fluent(self, m): - lang_id = strip_whitespace(m["string"]) - if lang_id not in self.dependencies: - return m.group() - args = "" - if m["args"]: - args = ", " + m["args"] - return f"ftl('{self.dependencies[lang_id]}'{args})" - - def trans_to_fluent(self, m): - lang_id = trans_to_lang(m["string"]) - if lang_id not in self.dependencies: - return m.group() - args = "" - if m["args"]: - args = ", " + m["args"] - return f"{{{{ ftl('{self.dependencies[lang_id]}'{args}) }}}}" diff --git a/lib/l10n_utils/management/commands/clean_ftl.py b/lib/l10n_utils/management/commands/clean_ftl.py deleted file mode 100644 index 402e6b7fab..0000000000 --- a/lib/l10n_utils/management/commands/clean_ftl.py +++ /dev/null @@ -1,55 +0,0 @@ -# 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 https://mozilla.org/MPL/2.0/. -from io import StringIO -from pathlib import Path - -from django.conf import settings -from django.core.management.base import BaseCommand, CommandError - - -class Command(BaseCommand): - help = "Remove porting process artifacts like hash comments" - _filenames = None - base_path = settings.FLUENT_LOCAL_PATH - - def add_arguments(self, parser): - parser.add_argument("filename", nargs="*", help="File(s) to clean.") - parser.add_argument("-q", "--quiet", action="store_true", dest="quiet", default=False, help="If no error occurs, swallow all output."), - - @property - def filenames(self): - return self._filenames - - @filenames.setter - def filenames(self, value): - if value: - self._filenames = [f"{f}.ftl" if not f.endswith(".ftl") else f for f in value] - - def clean_file(self, filename): - file_path = Path(filename) - if not file_path.exists(): - # might be just a ftl name - file_path = self.base_path.joinpath("en", file_path) - if not file_path.exists(): - self.stderr.write(f"Can not find {filename}") - return - - with file_path.open() as fpr: - lines = [l for l in fpr.readlines() if not l.startswith("# LANG_ID_HASH:")] - - with file_path.open("w") as fpw: - fpw.writelines(lines) - - self.stdout.write(f"Cleaned {filename}") - - def handle(self, *args, **options): - self.filenames = options["filename"] - if options["quiet"]: - self.stdout._out = StringIO() - - if not self.filenames: - raise CommandError("At least one filename is required") - - for filename in self.filenames: - self.clean_file(filename) diff --git a/lib/l10n_utils/management/commands/fluent.py b/lib/l10n_utils/management/commands/fluent.py deleted file mode 100644 index 09db10e947..0000000000 --- a/lib/l10n_utils/management/commands/fluent.py +++ /dev/null @@ -1,84 +0,0 @@ -# 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 https://mozilla.org/MPL/2.0/. - -import textwrap -from pathlib import Path - -from django.core.management.base import BaseCommand - - -class Command(BaseCommand): - help = "Convert a template to use Fluent for l10n" - requires_system_checks = False - - def add_arguments(self, parser): - subparsers = parser.add_subparsers(title="subcommand", dest="subcommand") - subparsers.add_parser("help") - - recipe_parser = subparsers.add_parser("recipe", description="Create migration recipe from template") - recipe_parser.add_argument("template", type=Path) - - ftl_parser = subparsers.add_parser("ftl", description="Create Fluent file with existing recipe") - ftl_parser.add_argument("recipe_or_template", type=Path, help="Path to the recipe or the template from which the recipe was generated") - ftl_parser.add_argument("locales", nargs="*", default=["en"], metavar="ab-CD", help="Locale codes to create ftl files for") - - template_parser = subparsers.add_parser("template", description="Create template_ftl.html file with existing recipe") - template_parser.add_argument("template", type=Path) - - activation_parser = subparsers.add_parser("activation", description="Port activation data from .lang for a recipe/template") - activation_parser.add_argument("recipe_or_template", type=Path, help="Path to the recipe or the template from which the recipe was generated") - - def handle(self, subcommand, **kwargs): - if subcommand == "recipe": - return self.create_recipe(**kwargs) - if subcommand == "ftl": - return self.create_ftl(**kwargs) - if subcommand == "template": - return self.create_template(**kwargs) - if subcommand == "activation": - return self.activation(**kwargs) - return self.handle_help(**kwargs) - - def handle_help(self, **kwargs): - self.stdout.write( - textwrap.dedent( - """\ - To migrate a template from .lang to Fluent, use the subcommands like so - - ./manage.py fluent recipe bedrock/app/templates/app/some.html - - # edit IDs in lib/fluent_migrations/app/some.py - - ./manage.py fluent template bedrock/app/templates/app/some.html - ./manage.py fluent ftl bedrock/app/templates/app/some.html - - More documentation on https://bedrock.readthedocs.io/en/latest/fluent-conversion.html. - """ - ) - ) - - def create_recipe(self, template, **kwargs): - from ._fluent_recipe import Recipe - - recipe = Recipe(self) - recipe.handle(template) - - def create_template(self, template, **kwargs): - from ._fluent_templater import Templater - - templater = Templater(self) - templater.handle(template) - - def create_ftl(self, recipe_or_template, locales, **kwargs): - from ._fluent_ftl import FTLCreator - - ftl_creator = FTLCreator(self) - for locale in locales: - ftl_creator.handle(recipe_or_template, locale) - - def activation(self, recipe_or_template, **kwargs): - from ._fluent_activation import Activation - - activation = Activation(self) - activation.handle(recipe_or_template) diff --git a/lib/l10n_utils/management/commands/l10n_check.py b/lib/l10n_utils/management/commands/l10n_check.py deleted file mode 100644 index f83615feb4..0000000000 --- a/lib/l10n_utils/management/commands/l10n_check.py +++ /dev/null @@ -1,460 +0,0 @@ -# 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 https://mozilla.org/MPL/2.0/. - -import codecs -import datetime -import errno -import itertools -import os -import re -from contextlib import closing -from io import StringIO -from os import path - -from django.conf import settings -from django.core.management.base import BaseCommand -from django.utils.functional import cached_property - -from jinja2 import Environment - - -def l10n_file(*args): - return str(settings.LOCALES_PATH.joinpath(*args)) - - -def list_templates(): - """List all the templates in all the installed apps""" - - for app in settings.INSTALLED_APPS: - if app.startswith(settings.PROJECT_MODULE): - app = app[len(settings.PROJECT_MODULE) + 1 :] - tmpl_dir = path.join(settings.ROOT, settings.PROJECT_MODULE, app, "templates") - - if path.exists(tmpl_dir): - # Find all the .html files - for root, dirs, files in os.walk(tmpl_dir): - for filename in files: - name, ext = os.path.splitext(filename) - - if ext in [".txt", ".html"]: - yield os.path.join(root, filename) - - -def update_templates(langs): - """List templates with outdated/incorrect l10n blocks""" - - for tmpl in list_templates(): - template = L10nTemplate(tmpl) - print("%s..." % template.rel_path) - template.process(langs) - - -def get_todays_version(): - """Return the template version string for today""" - - return datetime.date.today().strftime("%Y%m%d") - - -def ensure_dir_exists(path): - """Create directories for this path, like mkdir -p""" - - try: - os.makedirs(path) - except OSError as exc: - if exc.errno == errno.EEXIST: - pass - else: - raise - - -def write_block(block, dest, force_was=False): - """Write out a block to an l10n template""" - dest.write("{%% l10n %s %%}\n" % block["name"]) - dest.write(block["main"]) - if block["was"] or force_was: - dest.write("\n{% was %}") - dest.write("\n%s" % block["was"] if block["was"] else "") - dest.write("\n{% endl10n %}") - dest.write("\n\n") - - -class L10nTemplate: - def __init__(self, template=None, source=None): - """ - Initialize the template class. - - :param template: - Full path to a template file. - :param source: - Template text as a string if there is no template file. - """ - self.full_path = template - self.source = source - self.parser = L10nParser() - - @cached_property - def rel_path(self): - """ - Return the part of the template path after the 'templates' directory. - """ - args = self.full_path.split(path.sep) - args = args[args.index("templates") + 1 :] - return path.join(*args) - - def l10n_path(self, lang): - """ - Return the path to the localized version of the template for lang. - """ - return l10n_file(lang, "templates", self.rel_path) - - @cached_property - def blocks(self): - if self.full_path: - blocks = self.parser.parse_template(self.full_path, only_blocks=True) - elif self.source: - blocks = self.parser.parse(self.source, only_blocks=True) - return tuple(blocks) - - def blocks_for_lang(self, lang): - """Filter blocks to only those that allow this locale or all locales.""" - return tuple(b for b in self.blocks if not b["locales"] or lang in b["locales"]) - - def process(self, langs): - """ - Update existing templates and create new ones for specified langs. - """ - for lang in langs: - if path.exists(self.l10n_path(lang)): - self.update(lang) - else: - self.copy(lang) - - def copy(self, lang): - """Create a new l10n template by copying the l10n blocks""" - blocks = self.blocks_for_lang(lang) - if not blocks: - return - - dest_file = self.l10n_path(lang) - - # Make sure the templates directory for this locale and app exists - ensure_dir_exists(os.path.dirname(dest_file)) - - with codecs.open(dest_file, "w", "utf-8") as dest: - dest.write("{# Version: %s #}\n\n" % get_todays_version()) - dest.write('{%% extends "%s" %%}\n\n' % self.rel_path) - - for block in blocks: - write_block(block, dest) - - print("%s: %s" % (lang, self.rel_path)) - - def _get_ref_block(self, name, blocks=None): - """Return the reference block""" - blocks = blocks or self.blocks - return next((b for b in blocks if b["name"] == name), None) - - def _transfer_content(self, l10n_block, ref_block): - """Transfer any new content from the reference block""" - if ref_block: - # Update if the l10n file is older than this block - if l10n_block["version"] < ref_block["version"]: - # Move the main content to the else content only if it - # doesn't already exist, and then update the main content - if not l10n_block["was"]: - l10n_block["was"] = l10n_block["main"] - l10n_block["main"] = ref_block["main"] - l10n_block["locales"] = ref_block["locales"] - - def update(self, lang): - """Detect outdated l10n blocks and update the template""" - blocks = self.blocks_for_lang(lang) - if not blocks: - return - - file_version = None - parser = L10nParser() - dest_tmpl = self.l10n_path(lang) - written_blocks = [] - - # Make sure the templates directory for this locale and app exists - ensure_dir_exists(os.path.dirname(dest_tmpl)) - - # Parse the l10n template, run through it and update it where - # appropriate into a new template file - with closing(StringIO()) as buffer: - for token in parser.parse_template(dest_tmpl, strict=False, halt_on_content=True): - if not token: - # If False is returned, that means a content block - # exists so we don't do anything to the template since - # it's customized - return - elif token[0] == "content": - buffer.write(token[1]) - elif token[0] == "version": - buffer.write("{# Version: %s #}" % get_todays_version()) - file_version = token[1] - elif token[0] == "block": - if not file_version: - raise Exception("l10n file version tag does not exist before initial l10n block") - - # We have an l10n block, set its version and keep - # track of it for later use - l10n_block = token[1] - l10n_block["version"] = file_version - name = l10n_block["name"] - written_blocks.append(name) - - # Update the block and write it out - self._transfer_content(l10n_block, self._get_ref_block(name, blocks)) - write_block(l10n_block, buffer) - - # Check for any missing blocks - for block in blocks: - if block["name"] not in written_blocks: - write_block(block, buffer) - - # Write out the result to the l10n template - with codecs.open(dest_tmpl, "w", "utf-8") as dest: - dest.write(buffer.getvalue()) - - print("%s: %s" % (lang, self.rel_path)) - - -class L10nParser: - - file_version_re = re.compile(r"\W*Version: (\d+)\W*") - - def __init__(self): - self.tmpl = None - - def parse_tmpl_version(self, tmpl): - line = codecs.open(tmpl, encoding="utf-8").readline().strip() - matches = self.file_version_re.match(line) - if matches: - return int(matches.group(1)) - return None - - def parse_template(self, tmpl, strict=True, halt_on_content=False, only_blocks=False): - """Read a template and parse the l10n blocks""" - - self.tmpl = tmpl - for token in self.parse(codecs.open(tmpl, encoding="utf-8").read(), strict, halt_on_content, only_blocks): - yield token - - def parse(self, src, strict=True, halt_on_content=False, only_blocks=False): - """Analyze a template and get the l10n block information""" - - self.tokens = Environment().lex(src) - - for token in self._parse(strict, halt_on_content): - # Only return the block structure if requesting blocks, - # otherwise return the full token - if only_blocks: - if token[0] == "block": - yield token[1] - else: - yield token - - def _parse(self, strict, halt_on_content): - """Walk through a list of tokens and parse them. This function - yields 2 element tuples in the form (, ), where - is of the following: - - * version: the version of the l10n file - * content: a raw string of content from the template - * block: an l10n block structure - - The full template is effectively emitted as a stream of the - above tokens. - """ - - for token in self.tokens: - name = token[1] - - if name == "comment_begin": - # Check comments for the version string - comment = next(self.tokens)[2] - - matches = self.file_version_re.match(comment) - if matches: - # Found the file version. call the callback and - # ignore the rest of the comment - - version = self.parse_version(matches.group(1)) - - if not version: - raise Exception("Invalid version metadata in template: %s" % self.tmpl) - - yield ("version", version) - self.scan_until("comment_end") - else: - # It's a regular comment, so continue on normally - yield ("content", token[2]) - yield ("content", comment) - - elif name == "block_begin": - space = next(self.tokens) - block = next(self.tokens) - - if block[1] == "name": - type = block[2] - - # Start queue of tokens to yield, because we need - # to control when they are yielded - token_queue = [] - - if type == "l10n": - # Parse l10n block into a useful structure - self.scan_ignore("whitespace") - for x in self.parse_block(strict): - yield x - else: - token_queue = [token, space, block] - - if type == "block" and halt_on_content: - # If it's a block, check if the name is - # "content" and stop parsing if it is because - # that means the template has been customized - # and we shouldn't touch it - - ident_space = next(self.tokens) - ident = next(self.tokens) - - if ident[2] == "content": - # This is the content block, stop parsing - yield False - break - else: - # Otherwise, queue up the seen tokens for - # yielding - token_queue.extend([ident_space, ident]) - - for x in token_queue: - yield ("content", x[2]) - else: - raise Exception("Invalid block syntax: %s", self.tmpl) - else: - yield ("content", token[2]) - - def parse_version(self, version_str): - # Version must be in the date format YYYYMMDD - if len(version_str) != 8: - return None - - try: - return int(version_str) - except ValueError: - return None - - def get_block_version(self, version_str): - block_version = self.parse_version(version_str) - if not block_version: - raise Exception("Invalid l10n block declaration: bad version '%s' in %s" % (block_version, self.tmpl)) - return block_version - - def parse_block(self, strict=True): - """Parse out the l10n block metadata and content""" - - block_name = self.scan_next("name") - block_version = None - locales = [] - - self.scan_ignore("whitespace") - - # Grab the locales if provided - prev_sub = False - for _, token_type, token_value in self.tokens: - if token_type in ["integer", "block_end"]: - break - if token_type == "operator" and token_value in [",", "="]: - continue - if token_type == "name" and token_value != "locales": - if prev_sub: - locales[-1] += token_value - prev_sub = False - else: - locales.append(token_value) - if token_type == "operator" and token_value == "-": - locales[-1] += "-" - prev_sub = True - - if token_type == "integer": - block_version = self.get_block_version(token_value) - self.scan_until("block_end") - elif strict: - raise Exception("Invalid l10n block declaration: missing date for block '%s' in %s" % (block_name, self.tmpl)) - - (main, was_) = self.block_content() - yield ("block", {"name": block_name, "version": block_version, "main": main, "was": was_, "locales": locales}) - - def block_content(self): - """Parse the content from an l10n block""" - - in_was = False - main_content = [] - was_content = [] - - for token in self.tokens: - buffer = was_content if in_was else main_content - - if token[1] == "block_begin": - space = next(self.tokens)[2] - name = next(self.tokens)[2] - - if name == "endl10n": - self.scan_until("block_end") - break - elif name == "was": - in_was = True - self.scan_until("block_end") - continue - else: - buffer.append(token[2]) - buffer.append(space) - buffer.append(name) - continue - else: - buffer.append(token[2]) - - return ["".join(x).replace("\\n", "\n").strip() for x in [main_content, was_content]] - - def scan_until(self, name): - for token in self.tokens: - - if token[1] == name: - return True - return False - - def scan_ignore(self, name): - for token in self.tokens: - if token[1] != name: - # Put it back on the list - self.tokens = itertools.chain([token], self.tokens) - break - - def scan_next(self, name): - token = next(self.tokens) - if token and token[1] == name: - return token[2] - # Put it back on the list - self.tokens = itertools.chain([token], self.tokens) - return False - - -class Command(BaseCommand): - help = "Checks which content needs to be localized." - - def add_arguments(self, parser): - # Positional arguments - parser.add_argument("langs", nargs="*") - - def handle(self, *args, **options): - # Look through languages passed in, or all of them - langs = options["langs"] - if not langs: - langs = os.listdir(l10n_file()) - langs = [x for x in langs if x[0] != "."] - - update_templates(langs) diff --git a/lib/l10n_utils/management/commands/l10n_extract.py b/lib/l10n_utils/management/commands/l10n_extract.py deleted file mode 100644 index a55caae7da..0000000000 --- a/lib/l10n_utils/management/commands/l10n_extract.py +++ /dev/null @@ -1,175 +0,0 @@ -# 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 https://mozilla.org/MPL/2.0/. - -import os -from textwrap import dedent - -from django.conf import settings -from django.core.management import call_command -from django.core.management.base import BaseCommand - -from babel.messages.catalog import Catalog -from babel.messages.extract import extract_from_file -from babel.messages.pofile import write_po -from babel.util import pathmatch -from puente.commands import generate_options_map -from puente.settings import get_setting - -from lib.l10n_utils.gettext import pot_to_langfiles - -DOMAIN = "django" -METHODS = settings.PUENTE["DOMAIN_METHODS"][DOMAIN] - - -def gettext_extract(): - call_command("extract", create=True) - - -def extract_callback(filename, method, options): - if method != "ignore": - print(" %s" % filename) - - -def extract_from_files( - filenames, - method_map=METHODS, - options_map=generate_options_map(), - keywords=get_setting("KEYWORDS"), - comment_tags=get_setting("COMMENT_TAGS"), - callback=extract_callback, - strip_comment_tags=False, -): - """Extract messages from any source files found in the given iterable. - - This function generates tuples of the form: - - ``(filename, lineno, message, comments)`` - - Which extraction method is used per file is determined by the `method_map` - parameter, which maps extended glob patterns to extraction method names. - For example, the following is the default mapping: - - >>> method_map = [ - ... ('**.py', 'python') - ... ] - - This basically says that files with the filename extension ".py" - should be processed by the "python" extraction - method. Files that don't match any of the mapping patterns are ignored. See - the documentation of the `pathmatch` function for details on the pattern - syntax. - - The following extended mapping would also use the "genshi" extraction - method on any file in "templates" subdirectory: - - >>> method_map = [ - ... ('**/templates/**.*', 'genshi'), - ... ('**.py', 'python') - ... ] - - The dictionary provided by the optional `options_map` parameter augments - these mappings. It uses extended glob patterns as keys, and the values are - dictionaries mapping options names to option values (both strings). - - The glob patterns of the `options_map` do not necessarily need to be the - same as those used in the method mapping. For example, while all files in - the ``templates`` folders in an application may be Genshi applications, the - options for those files may differ based on extension: - - >>> options_map = { - ... '**/templates/**.txt': { - ... 'template_class': 'genshi.template:TextTemplate', - ... 'encoding': 'latin-1' - ... }, - ... '**/templates/**.html': { - ... 'include_attrs': '' - ... } - ... } - - :param filenames: an iterable of filenames relative to the ROOT of - the project - :param method_map: a list of ``(pattern, method)`` tuples that maps of - extraction method names to extended glob patterns - :param options_map: a dictionary of additional options (optional) - :param keywords: a dictionary mapping keywords (i.e. names of functions - that should be recognized as translation functions) to - tuples that specify which of their arguments contain - localizable strings - :param comment_tags: a list of tags of translator comments to search for - and include in the results - :param callback: a function that is called for every file that message are - extracted from, just before the extraction itself is - performed; the function is passed the filename, the name - of the extraction method and and the options dictionary as - positional arguments, in that order - :param strip_comment_tags: a flag that if set to `True` causes all comment - tags to be removed from the collected comments. - :return: an iterator over ``(filename, lineno, funcname, message)`` tuples - :rtype: ``iterator`` - :see: `pathmatch` - """ - # adapted from babel.messages.extract.extract_from_dir - for filename in filenames: - matched = False - for pattern, method in method_map: - if pathmatch(pattern, filename): - matched = True - filepath = os.path.join(settings.ROOT, filename) - if not os.path.exists(filepath): - print("! %s does not exist!" % filename) - break - options = {} - for opattern, odict in options_map.items(): - if pathmatch(opattern, filename): - options = odict - if callback: - callback(filename, method, options) - for lineno, message, comments, context in extract_from_file( - method, filepath, keywords=keywords, comment_tags=comment_tags, options=options, strip_comment_tags=strip_comment_tags - ): - yield filename, lineno, message, comments, context - break - if not matched: - print("! %s does not match any domain methods!" % filename) - - -class Command(BaseCommand): - help = dedent( - """ - Extracts a .lang file with new translations from all source files. - If s are provided only extract from those files. - """ - ).strip() - - def add_arguments(self, parser): - # Positional arguments - parser.add_argument("filenames", nargs="*") - - def handle(self, *args, **options): - filenames = options["filenames"] - if filenames: - # mimics puente.management.commands.extract for a list of files - outputdir = str(settings.LOCALES_PATH / "templates" / "LC_MESSAGES") - if not os.path.isdir(outputdir): - os.makedirs(outputdir) - - catalog = Catalog( - header_comment="", - project=get_setting("PROJECT"), - version=get_setting("VERSION"), - msgid_bugs_address=get_setting("MSGID_BUGS_ADDRESS"), - charset="utf-8", - ) - - for filename, lineno, msg, cmts, ctxt in extract_from_files(filenames): - catalog.add(msg, None, [(filename, lineno)], auto_comments=cmts, context=ctxt) - - with open(os.path.join(outputdir, "%s.pot" % DOMAIN), "wb") as fp: - write_po(fp, catalog, width=80) - else: - # This is basically a wrapper around the puente extract - # command, we might want to do some things around this in the - # future - gettext_extract() - pot_to_langfiles(DOMAIN) diff --git a/lib/l10n_utils/management/commands/l10n_merge.py b/lib/l10n_utils/management/commands/l10n_merge.py deleted file mode 100644 index 366cb286ac..0000000000 --- a/lib/l10n_utils/management/commands/l10n_merge.py +++ /dev/null @@ -1,27 +0,0 @@ -# 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 https://mozilla.org/MPL/2.0/. - -import os - -from django.conf import settings -from django.core.management.base import BaseCommand - -from lib.l10n_utils.gettext import merge_lang_files - - -class Command(BaseCommand): - help = "Merges gettext strings into .lang files" - - def add_arguments(self, parser): - # Positional arguments - parser.add_argument("langs", nargs="*") - - def handle(self, *args, **options): - langs = options["langs"] - if not langs: - langs = os.listdir(str(settings.LOCALES_PATH)) - langs = [x for x in langs if x != "templates"] - langs = [x for x in langs if x[0] != "."] - - merge_lang_files(langs) diff --git a/lib/l10n_utils/management/commands/l10n_update.py b/lib/l10n_utils/management/commands/l10n_update.py index b394209360..f00f2f55b9 100644 --- a/lib/l10n_utils/management/commands/l10n_update.py +++ b/lib/l10n_utils/management/commands/l10n_update.py @@ -22,18 +22,8 @@ class Command(BaseCommand): if options["quiet"]: self.stdout._out = StringIO() - self.update_lang_files(options["clean"]) self.update_fluent_files(options["clean"]) - def update_lang_files(self, clean=False): - repo = GitRepo(settings.LOCALES_PATH, settings.LOCALES_REPO) - if clean: - repo.reclone() - else: - repo.update() - - self.stdout.write("Updated .lang files") - def update_fluent_files(self, clean=False): repo = GitRepo(settings.FLUENT_REPO_PATH, settings.FLUENT_REPO_URL) if clean: diff --git a/lib/l10n_utils/management/commands/lang_to_ftl.py b/lib/l10n_utils/management/commands/lang_to_ftl.py deleted file mode 100644 index d192b42ae1..0000000000 --- a/lib/l10n_utils/management/commands/lang_to_ftl.py +++ /dev/null @@ -1,126 +0,0 @@ -# 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 https://mozilla.org/MPL/2.0/. - -from hashlib import md5 -from io import StringIO -from pathlib import Path - -from django.conf import settings -from django.core.management.base import BaseCommand, CommandError -from django.utils.html import strip_tags -from django.utils.text import slugify - -from lib.l10n_utils.dotlang import convert_variables, parse as parse_lang - - -def string_to_ftl_id(string): - string = strip_tags(string) - slug_parts = slugify(string).split("-") - slug = slug_parts.pop(0) - for part in slug_parts: - slug = "-".join([slug, part]) - if len(slug) > 30: - break - - return slug - - -def format_ftl_string(ftl_id, string, string_id, comment): - output = f"# LANG_ID_HASH: {md5(string_id.encode()).hexdigest()}\n" - output += f"# {comment}\n" if comment else "" - return output + f"{ftl_id} = {string}\n\n" - - -class Command(BaseCommand): - help = "Convert an en-US .lang file to an en .ftl file" - _filename = None - - def add_arguments(self, parser): - parser.add_argument("filename") - parser.add_argument("-q", "--quiet", action="store_true", dest="quiet", default=False, help="If no error occurs, swallow all output."), - parser.add_argument("-f", "--force", action="store_true", dest="force", default=False, help="Overwrite the FTL file if it exists."), - - @property - def filename(self): - if self._filename is None: - return "" - - return self._filename - - @filename.setter - def filename(self, value): - if not value.endswith(".lang"): - self._filename = f"{value}.lang" - else: - self._filename = value - - @property - def filename_prefix(self): - """Return a slugified version of the .lang filename for use as a FTL string ID prefix""" - return slugify(Path(self.filename).stem) - - @property - def ftl_file_path(self): - return settings.FLUENT_LOCAL_PATH.joinpath("en", self.filename).with_suffix(".ftl") - - def get_ftl_id(self, string): - return "-".join([self.filename_prefix, string_to_ftl_id(string)]) - - def get_translations(self): - path = settings.LOCALES_PATH.joinpath("en-US", self.filename) - return parse_lang(path, skip_untranslated=False, extract_comments=True) - - def get_ftl_strings(self): - translations = self.get_translations() - all_strings = {} - for str_id, string in translations.items(): - comment, string = string - if comment and comment.startswith("TAG:"): - # ignore tag comments - comment = None - - if "%s" in string: - self.stderr.write("WARNING: Place-holder with no variable name found in string. " 'Look for "$VARIABLE_MISSING" in the new file.') - # percent symbols are doubled in lang file strings - # no need for this in ftl files - # also breaks string matching in templates - string = string.replace("%%", "%") - str_id = str_id.replace("%%", "%") - ftl_id = self.get_ftl_id(str_id) - # make sure it's unique - if ftl_id in all_strings: - ftl_iteration = 0 - ftl_unique = ftl_id - while ftl_unique in all_strings: - ftl_iteration += 1 - ftl_unique = f"{ftl_id}_{ftl_iteration}" - - ftl_id = ftl_unique - - all_strings[ftl_id] = { - "string": convert_variables(string), - "string_id": str_id, - "comment": comment, - } - - return all_strings - - def write_ftl_file(self): - self.ftl_file_path.parent.mkdir(parents=True, exist_ok=True) - strings = self.get_ftl_strings() - with self.ftl_file_path.open("w") as ftl: - for string_id, string_info in strings.items(): - ftl.write(format_ftl_string(string_id, **string_info)) - - def handle(self, *args, **options): - self.filename = options["filename"] - if options["quiet"]: - self.stdout._out = StringIO() - - if self.ftl_file_path.exists() and not options["force"]: - raise CommandError("Output file exists. Use --force to overwrite.") - - self.write_ftl_file() - self.stdout.write(f"Finished converting {self.filename}") - self.stdout.write(f"Inspect the file before converting translations: {self.ftl_file_path}") diff --git a/lib/l10n_utils/management/commands/port_lang_translations.py b/lib/l10n_utils/management/commands/port_lang_translations.py deleted file mode 100644 index c4a4c11d16..0000000000 --- a/lib/l10n_utils/management/commands/port_lang_translations.py +++ /dev/null @@ -1,174 +0,0 @@ -# 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 https://mozilla.org/MPL/2.0/. - -import json -from hashlib import md5 -from io import StringIO -from pathlib import Path - -from django.conf import settings -from django.core.management import call_command -from django.core.management.base import BaseCommand -from django.test import override_settings -from django.utils.functional import cached_property - -from lib.l10n_utils.dotlang import ( - convert_variables, - get_translations_for_langfile, - parse as parse_lang, -) -from lib.l10n_utils.fluent import get_metadata_file_path -from lib.l10n_utils.utils import get_ftl_file_data - - -def format_ftl_string(ftl_id, string, comment): - output = f"# {comment}\n" if comment else "" - return output + f"{ftl_id} = {string}\n\n" - - -class Command(BaseCommand): - help = "Convert existing transations in .lang files to .ftl files" - _filename = None - force = False - - def add_arguments(self, parser): - parser.add_argument("filename") - parser.add_argument("-q", "--quiet", action="store_true", dest="quiet", default=False, help="If no error occurs, swallow all output."), - parser.add_argument("-f", "--force", action="store_true", dest="force", default=False, help="Overwrite the FTL file if it exists."), - - @property - def filename(self): - if self._filename is None: - return "" - - return self._filename - - @filename.setter - def filename(self, value): - if not value.endswith(".ftl"): - self._filename = f"{value}.ftl" - else: - self._filename = value - - @property - def file_path(self): - return settings.FLUENT_LOCAL_PATH.joinpath("en", self.filename) - - @property - def metadata_path(self): - return get_metadata_file_path(self.filename) - - @property - def metadata(self): - try: - with self.metadata_path.open() as mdf: - return json.load(mdf) - except (IOError, ValueError): - return {} - - def write_metadata(self, data): - if not self.metadata_path.exists(): - self.metadata_path.parent.mkdir(parents=True, exist_ok=True) - - with self.metadata_path.open("w") as mdf: - json.dump(data, mdf, indent=2, sort_keys=True) - - @property - def lang_file_path(self): - return Path(self.filename).with_suffix(".lang") - - @cached_property - def ftl_file_data(self): - return get_ftl_file_data(self.filename) - - def get_ftl_id(self, str_id): - data = self.ftl_file_data - hashed_id = md5(str_id.encode()).hexdigest() - return data.get(hashed_id) - - def translated_filepaths(self): - for path in settings.LOCALES_PATH.glob(f"*/{self.lang_file_path}"): - lang = path.relative_to(settings.LOCALES_PATH).parts[0] - if lang not in ["en-US", "templates"]: - yield path - - def get_translation(self, path): - return parse_lang(path, skip_untranslated=True, extract_comments=True) - - def write_ftl_file(self, path, data): - ftl_path = path.relative_to(settings.LOCALES_PATH).with_suffix(".ftl") - ftl_path = settings.FLUENT_REPO_PATH.joinpath(ftl_path) - if ftl_path.exists() and not self.force: - return False - - ftl_path.parent.mkdir(parents=True, exist_ok=True) - with ftl_path.open("w") as ftlf: - for ftl_id, ftl_info in data.items(): - ftlf.write(format_ftl_string(ftl_id, **ftl_info)) - - return True - - def write_ftl_translations(self): - wrote_all = True - for path in self.translated_filepaths(): - translation = self.get_translation(path) - all_strings = {} - for str_id, string in translation.items(): - comment, string = string - if comment and comment.startswith("TAG:"): - # ignore tag comments - comment = None - ftl_id = self.get_ftl_id(str_id) - if ftl_id: - all_strings[ftl_id] = { - "string": convert_variables(string), - "comment": comment, - } - else: - relative_path = path.relative_to(settings.LOCALES_PATH) - self.stderr.write(f'WARNING: Could not find a match for "{str_id}"\n' f"in {relative_path}") - - wrote = self.write_ftl_file(path, all_strings) - if not wrote: - wrote_all = False - - self.stdout.write("." if wrote else "x", ending="") - self.stdout.flush() - - self.stdout.write("") # carriage return - if not wrote_all: - self.stdout.write("Did not modify existing files. Use --force to overwrite.") - - @override_settings(DEV=False) - def record_active_translations(self): - translations = get_translations_for_langfile(self.lang_file_path.with_suffix("")) - data = self.metadata - data["active_locales"] = translations - self.write_metadata(data) - self.stdout.write(f"Recorded active translations in {self.metadata_path}") - - def write_default_file(self): - en_file_path = self.file_path - dest_file_path = self.file_path.relative_to(settings.FLUENT_LOCAL_PATH) - dest_file_path = settings.FLUENT_REPO_PATH.joinpath(dest_file_path) - if not dest_file_path.exists(): - dest_file_path.parent.mkdir(parents=True, exist_ok=True) - - with en_file_path.open() as enf: - lines = [l for l in enf if not l.startswith("# LANG_ID_HASH")] - - with dest_file_path.open("w") as dfp: - dfp.writelines(lines) - - def handle(self, *args, **options): - self.filename = options["filename"] - self.force = options["force"] - if options["quiet"]: - self.stdout._out = StringIO() - - call_command("l10n_update", quiet=options["quiet"]) - self.record_active_translations() - self.write_ftl_translations() - self.write_default_file() - self.stdout.write("Done") diff --git a/lib/l10n_utils/management/commands/template_to_ftl.py b/lib/l10n_utils/management/commands/template_to_ftl.py deleted file mode 100644 index f458e308fc..0000000000 --- a/lib/l10n_utils/management/commands/template_to_ftl.py +++ /dev/null @@ -1,110 +0,0 @@ -# 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 https://mozilla.org/MPL/2.0/. - -import re -from hashlib import md5 -from io import StringIO -from pathlib import Path - -from django.core.management.base import BaseCommand, CommandError -from django.utils.functional import cached_property - -from lib.l10n_utils.extract import tweak_message -from lib.l10n_utils.utils import get_ftl_file_data - -GETTEXT_RE = re.compile(r'\b_\([\'"](?P.+?)[\'"]\)' r"(\s*\|\s*format\((?P\w.+?)\))?", re.S) -TRANS_BLOCK_RE = re.compile(r"{%-?\s+trans\s+((?P\w.+?)\s+)?-?%\}\s*" r"(?P.+?)" r"\s*{%-?\s+endtrans\s+-?%\}", re.S) -STR_VARIABLE_RE = re.compile(r"{{\s*(?P\w+?)\s*}}") - - -class Command(BaseCommand): - help = "Convert a template to use Fluent for l10n" - _filename = None - _template = None - - def add_arguments(self, parser): - parser.add_argument("ftl_file") - parser.add_argument("template") - parser.add_argument("-q", "--quiet", action="store_true", dest="quiet", default=False, help="If no error occurs, swallow all output."), - parser.add_argument("-f", "--force", action="store_true", dest="force", default=False, help="Overwrite the FTL template if it exists."), - - @property - def filename(self): - if self._filename is None: - return "" - - return self._filename - - @filename.setter - def filename(self, value): - if not value.endswith(".ftl"): - self._filename = f"{value}.ftl" - else: - self._filename = value - - @property - def template(self): - return self._template - - @template.setter - def template(self, value): - self._template = Path(value) - - @property - def ftl_template(self): - ftl_template = f"{self.template.stem}_ftl.html" - return self.template.with_name(ftl_template) - - @cached_property - def ftl_file_data(self): - return get_ftl_file_data(self.filename) - - def template_replace(self, match): - trans_block = match[0].startswith("{%") - ftl_data = self.ftl_file_data - str_id = tweak_message(match["string"]) - if "%s" in str_id: - self.stderr.write("WARNING: Place-holder with no variable name found in string. " 'Convert "%s" to a Fluent variable in the new file.') - str_id = STR_VARIABLE_RE.sub(r"%(\1)s", str_id) - str_hash = md5(str_id.encode()).hexdigest() - ftl_id = ftl_data.get(str_hash) - if ftl_id: - if match["args"]: - new_str = f"ftl('{ftl_id}', {match['args']})" - else: - new_str = f"ftl('{ftl_id}')" - - if trans_block: - new_str = f"{{{{ {new_str} }}}}" - - return new_str - - self.stderr.write(f"NO MATCH: {str_id}") - return match[0] - - def ftl_template_lines(self): - with self.template.open("r") as tfp: - template_str = tfp.read() - template_str = GETTEXT_RE.sub(self.template_replace, template_str) - template_str = TRANS_BLOCK_RE.sub(self.template_replace, template_str) - self.stdout.write(".", ending="") - self.stdout.flush() - - return template_str - - def write_ftl_template(self): - with self.ftl_template.open("w") as ftlt: - ftlt.writelines(self.ftl_template_lines()) - - def handle(self, *args, **options): - self.filename = options["ftl_file"] - self.template = options["template"] - if options["quiet"]: - self.stdout._out = StringIO() - - if self.ftl_template.exists() and not options["force"]: - raise CommandError("Output file exists. Use --force to overwrite.") - - self.write_ftl_template() - self.stdout.write("\nDone") diff --git a/lib/l10n_utils/template.py b/lib/l10n_utils/template.py index f80b14a935..b0c8971521 100644 --- a/lib/l10n_utils/template.py +++ b/lib/l10n_utils/template.py @@ -1,7 +1,7 @@ # 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 https://mozilla.org/MPL/2.0/. -from jinja2.ext import Extension, InternationalizationExtension, nodes +from jinja2.ext import InternationalizationExtension from lib.l10n_utils.templatetags.helpers import gettext from lib.l10n_utils.utils import strip_whitespace @@ -18,114 +18,7 @@ class I18nExtension(InternationalizationExtension): return ref, strip_whitespace(buffer) -class L10nBlockExtension(Extension): - """ - Add support for an L10n block that works like a regular "block" for now. - """ - - tags = set(["l10n"]) - - def parse(self, parser): - # Jump over first token ("l10n"), grab line number. - lineno = next(parser.stream).lineno - - # Block name is mandatory. - name = parser.stream.expect("name").value - locales = [] - - parser.stream.skip_if("comma") - - # Grab the locales if provided - if parser.stream.current.type == "name": - parser.stream.skip() # locales - parser.stream.skip() # assign (=) - prev_sub = False - while parser.stream.current.type not in ["integer", "block_end"]: - parser.stream.skip_if("comma") - parser.stream.skip_if("assign") - token = parser.stream.current - if token.type in ["integer", "block_end"]: - break - if token.type == "name": - if prev_sub: - locales[-1] += token.value - prev_sub = False - else: - locales.append(token.value) - if token.type == "sub": - locales[-1] += "-" - prev_sub = True - next(parser.stream) - - # Add version if provided. - if parser.stream.current.type == "integer": - version = int(parser.parse_expression().value) - else: - version = 0 # Default version for unversioned block. - - # Parse content. - body = parser.parse_statements(["name:was", "name:endl10n"], drop_needle=False) - - # Translation fallback: If this is followed by an "was" tag, render - # that block instead. - end_tag = parser.stream.expect("name") # Either was or endl10n. - if end_tag.value == "was": - body = parser.parse_statements(["name:endl10n"], drop_needle=True) - - # Build regular block node with special node name and remember version. - node = nodes.Block() - node.set_lineno(lineno) - node.name = "__l10n__{0}".format(name) - node.version = version # For debugging only, for now. - node.locales = locales - node.body = body - # I *think*, `true` would mean that variable assignments inside this - # block do not persist beyond this block (like a `with` block). - node.scoped = False - - return node - - -class LoadLangExtension(Extension): - """Create a special syntax for specifying additional lang files. - It looks like this: {% lang_files "foo" "bar" %}. We convert it - into a call to a helper method because it needs to context to load - in the correct locale. As a result, this must be within a block.""" - - tags = {"set_lang_files", "add_lang_files"} - - def parse(self, parser): - # Skip over the block name - name = next(parser.stream) - lineno = name.lineno - - # Grab all the args - args = [parser.stream.expect("string").value] - while parser.stream.current.type == "string": - args.append(parser.stream.current.value) - next(parser.stream) - - # Make a node that calls the lang_files helper - content_nodes = [nodes.Call(nodes.Name("lang_files", "load"), [nodes.Const(x) for x in args], [], None, None)] - - if name == "add_lang_files": - # If we are adding files, we need to keep the parent - # template's list of lang files as well - content_nodes.insert(0, nodes.Call(nodes.Name("super", "load"), [], [], None, None)) - - # Since we are a block, we must emit a block too, so make a - # random one that contains a call to the load function - node = nodes.Block().set_lineno(lineno) - node.name = "__langfiles__" - node.scoped = False - node.body = [nodes.Output(content_nodes)] - node.set_lineno(lineno) - return node - - # Makes for a prettier import in settings.py -l10n_blocks = L10nBlockExtension -lang_blocks = LoadLangExtension i18n = I18nExtension # TODO: make an ngettext compatible function. diff --git a/lib/l10n_utils/templatetags/helpers.py b/lib/l10n_utils/templatetags/helpers.py index cd387fd540..c0d7aa126c 100644 --- a/lib/l10n_utils/templatetags/helpers.py +++ b/lib/l10n_utils/templatetags/helpers.py @@ -10,8 +10,6 @@ from babel.dates import format_date from babel.numbers import format_number from django_jinja import library -from lib.l10n_utils.dotlang import lang_file_has_tag, translate -from lib.l10n_utils.gettext import template_has_tag from lib.l10n_utils.translation import get_language babel_format_locale_map = { @@ -20,66 +18,20 @@ babel_format_locale_map = { } -def install_lang_files(ctx): - """Install the initial set of .lang files""" - req = ctx["request"] - - if not hasattr(req, "langfiles"): - files = list(settings.DOTLANG_FILES) - langfile = ctx.get("langfile") - if langfile: - files.insert(0, langfile) - req.langfiles = files - - -def add_lang_files(ctx, files): - """Install additional .lang files""" - req = ctx["request"] - - if hasattr(req, "langfiles"): - req.langfiles = files + req.langfiles - - -# TODO: make an ngettext compatible function. The pluaralize clause of a -# trans block won't work untill we do. @jinja2.contextfunction def gettext(ctx, text): - """Translate a string, loading the translations for the locale if - necessary.""" - install_lang_files(ctx) - return translate(text, ctx["request"].langfiles) + """ + A no-op for backwards compatability. - -@library.global_function -@jinja2.contextfunction -def lang_files(ctx, *files): - """Add more lang files to the translation object""" - # Filter out empty files - install_lang_files(ctx) - add_lang_files(ctx, [f for f in files if f and f not in settings.DOTLANG_FILES]) + Once we remove all uses of `_(...)` in templates this can be removed. + """ + return text # backward compatible for imports _ = gettext -@library.filter -def js_escape(string): - import json - - return json.dumps(string)[1:-1].replace(" ", "\\u00A0") - - -@library.global_function -@jinja2.contextfunction -def l10n_has_tag(ctx, tag, langfile=None): - """Return boolean whether the given template's lang files have the given tag.""" - if langfile: - return lang_file_has_tag(langfile, ctx["LANG"], tag) - else: - return template_has_tag(ctx["template"], ctx["LANG"], tag) - - def get_locale(lang): """Return a babel Locale object for lang. defaults to LANGUAGE_CODE.""" lang = babel_format_locale_map.get(lang) or lang diff --git a/lib/l10n_utils/tests/test_base.py b/lib/l10n_utils/tests/test_base.py index 485efa0f1b..9646dba217 100644 --- a/lib/l10n_utils/tests/test_base.py +++ b/lib/l10n_utils/tests/test_base.py @@ -64,16 +64,15 @@ class TestRender(TestCase): # Should fallback to one of the site's fallback languages self._test(path, template, "es-CL", "es-CL,es;q=0.7,en;q=0.3", 302, "/es-ES/firefox/new/", active_locales=locales) - @patch.object(l10n_utils, "translations_for_template") - def test_add_active_locales(self, tft_mock): + def test_add_active_locales(self): + # expect same results as above, but with locales from `add_active_locales` path = "/firefox/new/" template = "firefox/new.html" - locales = ["en-US", "en-GB"] - tft_mock.return_value = ["fr", "es-ES"] - # expect same results as above, but with locales from different sources + locales = ["en-US", "en-GB", "fr", "es-ES"] # Nothing to do with a valid locale self._test(path, template, "en-US", "en-us,en;q=0.5", 200, add_active_locales=locales) + # en-GB is activated on /firefox/new/ self._test(path, template, "en-GB", "en-gb,en;q=0.5", 200, add_active_locales=locales) @@ -96,9 +95,8 @@ class TestRender(TestCase): assert ftl_files == ["dude", "walter"] @patch.object(l10n_utils, "django_render") - @patch.object(l10n_utils, "translations_for_template") @patch.object(l10n_utils, "ftl_active_locales") - def test_activation_files(self, fal_mock, tft_mock, dr_mock): + def test_activation_files(self, fal_mock, dr_mock): ftl_files = ["dude", "walter"] path = "/firefox/new/" template = "firefox/new.html" @@ -112,7 +110,6 @@ class TestRender(TestCase): ], any_order=True, ) - tft_mock.assert_called_with(template) class TestGetAcceptLanguages(TestCase): diff --git a/lib/l10n_utils/tests/test_commands.py b/lib/l10n_utils/tests/test_commands.py deleted file mode 100644 index cfb31836cf..0000000000 --- a/lib/l10n_utils/tests/test_commands.py +++ /dev/null @@ -1,379 +0,0 @@ -# coding: utf-8 - -# 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 https://mozilla.org/MPL/2.0/. -import codecs -from io import IOBase, StringIO -from os import path -from pathlib import Path -from textwrap import dedent - -from django.conf import settings -from django.test import TestCase, override_settings - -from mock import ANY, MagicMock, Mock, patch - -from lib.l10n_utils.gettext import _append_to_lang_file, merge_lang_files -from lib.l10n_utils.management.commands.l10n_check import ( - L10nParser, - L10nTemplate, - get_todays_version, - update_templates, -) -from lib.l10n_utils.management.commands.l10n_extract import extract_from_files -from lib.l10n_utils.tests import capture_stdio - -ROOT_PATH = Path(__file__).with_name("test_files") -ROOT = str(ROOT_PATH) -LOCALES_PATH = ROOT_PATH / "locale" -TEMPLATE_DIRS = (str(ROOT_PATH / "templates"),) - -METHODS = [ - ("templates/**.html", "lib.l10n_utils.extract.extract_jinja2"), -] - -# doing this to keep @patch from passing a new mock -# we don't need to the decorated method. -TRUE_MOCK = Mock() -TRUE_MOCK.return_value = True - - -@override_settings(ROOT=ROOT, LOCALES_PATH=LOCALES_PATH) -class TestL10nExtract(TestCase): - def test_extract_from_files(self): - """ - Should be able to extract strings from a specific file. - """ - testfile = ("templates/even_more_lang_files.html",) - with capture_stdio() as out: - extracted = next(extract_from_files(testfile, method_map=METHODS)) - self.assertTupleEqual(extracted, (testfile[0], 11, "Mark it 8 Dude.", [], None)) - # test default callback - self.assertEqual(out[0], " %s" % testfile) - - def test_extract_from_multiple_files(self): - """ - Should be able to extract strings from specific files. - """ - basedir = "templates/" - testfiles = ( - basedir + "even_more_lang_files.html", - basedir + "some_lang_files.html", - ) - good_extracts = ( - (testfiles[0], 11, "Mark it 8 Dude.", [], None), - (testfiles[1], 12, "Is this your homework Larry?", ["Said angrily, loudly, and repeatedly."], None), - ) - with capture_stdio() as out: - for i, extracted in enumerate(extract_from_files(testfiles, method_map=METHODS)): - self.assertTupleEqual(extracted, good_extracts[i]) - self.assertEqual(out[0], " %s\n %s" % testfiles) - - def test_extract_from_files_no_match(self): - """ - If the file path doesn't match a domain method, it should be skipped. - """ - testfile = ("bedrock/mozorg/templates/mozorg/home.html",) - with capture_stdio() as out: - extracted = next(extract_from_files(testfile, method_map=METHODS), None) - self.assertIsNone(extracted) - self.assertEqual(out[0], "! %s does not match any domain methods!" % testfile) - - def test_extract_from_files_no_file(self): - """ - If the file path doesn't exist, it should be skipped. - """ - testfile = ("templates/file_does_not_exist.html",) - with capture_stdio() as out: - extracted = next(extract_from_files(testfile, method_map=METHODS), None) - self.assertIsNone(extracted) - self.assertEqual(out[0], "! %s does not exist!" % testfile) - - @patch("lib.l10n_utils.management.commands.l10n_extract.extract_from_file") - def test_extract_from_files_passes_args(self, eff): - """The correct args should be passed through to extract_from_file""" - testfile = ("templates/even_more_lang_files.html",) - testfile_full = path.join(settings.ROOT, testfile[0]) - next(extract_from_files(testfile, method_map=METHODS), None) - eff.assert_called_once_with(METHODS[0][1], testfile_full, keywords=ANY, comment_tags=ANY, options=ANY, strip_comment_tags=ANY) - - def test_extract_from_files_callback_works(self): - """extract_from_files should call our callback""" - testfile = ("templates/even_more_lang_files.html",) - callback = Mock() - next(extract_from_files(testfile, callback=callback, method_map=METHODS), None) - callback.assert_called_once_with(testfile[0], METHODS[0][1], ANY) - - -@override_settings(LOCALES_PATH=LOCALES_PATH) -class TestL10nCheck(TestCase): - def _get_block(self, blocks, name): - """Out of all blocks, grab the one with the specified name.""" - return next((b for b in blocks if b["name"] == name), None) - - def test_parse_templates(self): - """Make sure the parser grabs the l10n block content - correctly.""" - - parser = L10nParser() - blocks = parser.parse( - """ - foo bar bizzle what? - {% l10n baz, 20110914 %} - mumble - {% was %} - wased - {% endl10n %} - qux - """, - only_blocks=True, - ) - - baz = self._get_block(blocks, "baz") - - self.assertEqual(baz["main"], "mumble") - self.assertEqual(baz["was"], "wased") - self.assertEqual(baz["version"], 20110914) - - blocks = parser.parse( - """ - foo bar bizzle what? - {% l10n baz locales=ru,bn-IN,fr 20110914 %} - mumble - {% endl10n %} - qux - """, - only_blocks=True, - ) - - baz = self._get_block(blocks, "baz") - self.assertEqual(baz["main"], "mumble") - self.assertEqual(baz["locales"], ["ru", "bn-IN", "fr"]) - self.assertEqual(baz["version"], 20110914) - - def test_content_halt(self): - """Make sure the parser will halt on the content block if told - to do so.""" - - parser = L10nParser() - content_str = "foo bar {% block content %}baz{% endblock %} hello" - last_token = None - - for token in parser.parse(content_str, halt_on_content=True): - last_token = token - - self.assertEqual(last_token, False) - - def test_filter_blocks(self): - """Should return a list of blocks appropriate for a given lang""" - template = L10nTemplate( - source=""" - {% l10n dude locales=fr,es-ES,ru 20121212 %} - This aggression will not stand, man. - {% endl10n %} - {% l10n walter, locales=es-ES,ru 20121212 %} - I'm stayin'. Finishin' my coffee. - {% endl10n %} - {% l10n donnie 20121212 %} - Phone's ringing Dude. - {% endl10n %} - """ - ) - - lang_blocks = template.blocks_for_lang("fr") - self.assertEqual(len(lang_blocks), 2) - self.assertEqual(lang_blocks[0]["name"], "dude") - self.assertEqual(lang_blocks[1]["name"], "donnie") - - lang_blocks = template.blocks_for_lang("es-ES") - self.assertEqual(len(lang_blocks), 3) - self.assertEqual(lang_blocks[0]["name"], "dude") - self.assertEqual(lang_blocks[1]["name"], "walter") - self.assertEqual(lang_blocks[2]["name"], "donnie") - - lang_blocks = template.blocks_for_lang("pt-BR") - self.assertEqual(len(lang_blocks), 1) - self.assertEqual(lang_blocks[0]["name"], "donnie") - - @patch("lib.l10n_utils.management.commands.l10n_check.settings.ROOT", ROOT) - @patch("lib.l10n_utils.management.commands.l10n_check.list_templates") - @patch("lib.l10n_utils.management.commands.l10n_check.L10nTemplate.copy") - @patch("lib.l10n_utils.management.commands.l10n_check.L10nTemplate.update") - def test_process_template(self, update_mock, copy_mock, lt_mock): - """ - template.process() should update existing templates and create missing - ones. It should only do so for the right locales. - """ - lt_mock.return_value = [ - path.join(TEMPLATE_DIRS[0], "l10n_blocks_with_langs.html"), - path.join(TEMPLATE_DIRS[0], "l10n_blocks_without_langs.html"), - ] - update_templates(["de"]) - copy_mock.assert_called_once_with("de") - update_mock.assert_called_once_with("de") - - def test_blocks_called_once(self): - """ - Test that the cached_property decorator really works in our situation. - """ - template = L10nTemplate( - source=""" - {% l10n donnie 20121212 %} - Phone's ringing Dude. - {% endl10n %} - """ - ) - with patch.object(template, "parser") as mock_parser: - template.blocks - template.blocks_for_lang("de") - template.blocks - self.assertEqual(mock_parser.parse.call_count, 1) - - def test_update_template_no_lang(self): - """ - template.update() should skip files without blocks for the given locale. - """ - template = L10nTemplate(path.join(TEMPLATE_DIRS[0], "l10n_blocks_with_langs.html")) - # cause the template to be read and parsed before mocking open - template.blocks - codecs_open = "lib.l10n_utils.management.commands.l10n_check.codecs.open" - open_mock = MagicMock(spec=IOBase) - with patch(codecs_open, open_mock): - template.update("zh-TW") - file_handle = open_mock.return_value.__enter__.return_value - assert not file_handle.write.called - template.update("de") - assert file_handle.write.called - - @patch("lib.l10n_utils.management.commands.l10n_check.settings.ROOT", ROOT) - def test_update_template(self): - """ - template.update() should update lang specific templates. - """ - template = L10nTemplate(path.join(TEMPLATE_DIRS[0], "l10n_blocks_with_langs.html")) - # cause the template to be read and parsed before mocking open - template.blocks - codecs_open = "lib.l10n_utils.management.commands.l10n_check.codecs.open" - open_mock = MagicMock(spec=IOBase) - open_buffer = StringIO() - # for writing the new file - open_mock.return_value.__enter__.return_value = open_buffer - # for reading the old file - open_mock().read.return_value = codecs.open(template.l10n_path("de")).read() - - with patch(codecs_open, open_mock): - template.update("de") - - # braces doubled for .format() - good_value = dedent( - """\ - {{# - 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 https://mozilla.org/MPL/2.0/. - #}} - - {{# Version: {0} #}} - - {{% extends "l10n_blocks_with_langs.html" %}} - - {{% l10n donnie %}} - Phone's ringing Dude. - {{% was %}} - I am the walrus. - {{% endl10n %}}\n\n - """.format( - get_todays_version() - ) - ) - self.assertEqual(open_buffer.getvalue(), good_value) - - def test_copy_template_no_lang(self): - """ - template.copy() should skip files with no blocks for the given locale. - :return: - """ - template = L10nTemplate(path.join(TEMPLATE_DIRS[0], "l10n_blocks_with_langs.html")) - # cause the template to be read and parsed before mocking open - template.blocks - codecs_open = "lib.l10n_utils.management.commands.l10n_check.codecs.open" - open_mock = MagicMock(spec=IOBase) - with patch(codecs_open, open_mock): - template.copy("zh-TW") - file_handle = open_mock.return_value.__enter__.return_value - assert not file_handle.write.called - template.copy("de") - assert file_handle.write.called - - def test_copy_template(self): - """ - template.copy() should create missing lang specific templates. - """ - template = L10nTemplate(path.join(TEMPLATE_DIRS[0], "l10n_blocks_without_langs.html")) - # cause the template to be read and parsed before mocking open - template.blocks - codecs_open = "lib.l10n_utils.management.commands.l10n_check.codecs.open" - open_mock = MagicMock(spec=IOBase) - open_buffer = StringIO() - open_mock.return_value.__enter__.return_value = open_buffer - with patch(codecs_open, open_mock): - template.copy("de") - - # braces doubled for .format() - good_value = dedent( - """\ - {{# Version: {0} #}} - - {{% extends "l10n_blocks_without_langs.html" %}} - - {{% l10n donnie %}} - Phone's ringing Dude. - {{% endl10n %}}\n - """.format( - get_todays_version() - ) - ) - self.assertEqual(open_buffer.getvalue(), good_value) - - -@override_settings(LOCALES_PATH=LOCALES_PATH) -class Testl10nMerge(TestCase): - @patch("lib.l10n_utils.gettext.settings.ROOT", ROOT) - @patch("lib.l10n_utils.gettext._append_to_lang_file") - def test_merge_lang_files(self, write_mock): - """ - `merge_lang_files()` should see all strings, not skip the untranslated. - Bug 861168. - """ - merge_lang_files(["de"]) - dest_file = str(LOCALES_PATH / "de" / "firefox" / "fx.lang") - write_mock.assert_called_once_with(dest_file, [[None, "Find out if your device is supported  \xbb"]]) - - @patch("os.path.exists", TRUE_MOCK) - @patch("lib.l10n_utils.gettext.codecs.open") - def test_append_to_lang_file(self, open_mock): - """ - `_append_to_lang_file()` should append any new messages to a lang file. - """ - _append_to_lang_file("dude.lang", ["The Dude abides, man."]) - mock_write = open_mock.return_value.__enter__.return_value.write - mock_write.assert_called_once_with("\n\n;The Dude abides, man.\nThe Dude abides, man.\n") - - # make sure writing multiple strings works. - mock_write.reset_mock() - msgs = ["The Dude abides, man.", "Dammit Walter!"] - _append_to_lang_file("dude.lang", msgs) - expected = [(("\n\n;{msg}\n{msg}\n".format(msg=msg),),) for msg in msgs] - self.assertEqual(expected, mock_write.call_args_list) - - @patch("os.path.exists", TRUE_MOCK) - @patch("lib.l10n_utils.gettext.codecs.open") - def test_merge_unicode_strings(self, open_mock): - """ - Bug 869538: Exception when merging unicode. - """ - mock_write = open_mock.return_value.__enter__.return_value.write - msgs = ["Désintéressé et fier de l'être"] - _append_to_lang_file("dude.lang", msgs) - mock_write.assert_called_once_with("\n\n;{msg}\n{msg}\n".format(msg=msgs[0])) diff --git a/lib/l10n_utils/tests/test_dotlang.py b/lib/l10n_utils/tests/test_dotlang.py deleted file mode 100644 index 4ff1e3542e..0000000000 --- a/lib/l10n_utils/tests/test_dotlang.py +++ /dev/null @@ -1,475 +0,0 @@ -# coding=utf-8 - -# 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 https://mozilla.org/MPL/2.0/. - -import io -from pathlib import Path - -from django.conf import settings -from django.core import mail -from django.http import HttpRequest -from django.test.utils import override_settings -from django.urls import clear_url_caches - -from django_jinja.backend import Jinja2 -from mock import patch -from pyquery import PyQuery as pq - -from bedrock.mozorg.tests import TestCase -from lib.l10n_utils import render -from lib.l10n_utils.dotlang import ( - FORMAT_IDENTIFIER_RE, - _, - _lazy, - cache, - lang_file_has_tag, - lang_file_is_active, - parse, - translate, -) -from lib.l10n_utils.extract import extract_python - -LANG_FILES = "test_file" -ROOT_PATH = Path(__file__).with_name("test_files") -LOCALES_PATH = ROOT_PATH / "locale" -ROOT = str(ROOT_PATH) -TEMPLATE_DIRS = [str(ROOT_PATH.joinpath("templates"))] -jinja_env = Jinja2.get_default().env - - -@override_settings( - DEV=False, - ROOT_URLCONF="lib.l10n_utils.tests.test_files.urls", - ROOT=ROOT, - LOCALES_PATH=LOCALES_PATH, - LANGUAGE_CODE="en-US", # Triggers reset of Django's language cache -) -@patch.object(jinja_env.loader, "searchpath", TEMPLATE_DIRS) -class TestLangFilesActivation(TestCase): - def setUp(self): - clear_url_caches() - cache.clear() - - def tearDown(self): - cache.clear() - - def test_lang_file_is_active(self): - """ - `lang_file_is_active` should return true if lang file has the - comment, and false otherwise. - """ - assert lang_file_is_active("active_de_lang_file", "de") - assert lang_file_is_active("active_de_lang_file_bom", "de") - assert not lang_file_is_active("active_de_lang_file", "es") - assert not lang_file_is_active("inactive_de_lang_file", "de") - assert not lang_file_is_active("does_not_exist", "de") - - def test_lang_file_has_tag(self): - """ - `lang_file_has_tag` should return true if lang file has the - comment, and false otherwise. - """ - assert lang_file_has_tag("active_de_lang_file", "de", "active") - assert lang_file_has_tag("active_de_lang_file_bom", "de", "active") - assert not lang_file_has_tag("active_de_lang_file", "es", "active") - assert not lang_file_has_tag("inactive_de_lang_file", "de", "active") - assert not lang_file_has_tag("file_does_not_exist", "de", "active") - assert lang_file_has_tag("main", "de", "guten_tag") - assert not lang_file_has_tag("main", "de", "tag_after_non_tag_lines") - assert not lang_file_has_tag("main", "de", "no_such_tag") - - def test_active_locale_not_redirected(self): - """Active lang file should render correctly. - - Also the template has an inactive lang file manually set, - but that should not cause it to be inactive. - """ - response = self.client.get("/de/active-de-lang-file/") - assert response.status_code == 200 - doc = pq(response.content) - assert doc("h1").text() == "Die Lage von Mozilla" - - def test_inactive_locale_redirected(self): - """Inactive locale should redirect to en-US.""" - response = self.client.get("/de/inactive-de-lang-file/") - assert response.status_code == 302 - assert response["location"] == "/en-US/inactive-de-lang-file/" - response = self.client.get("/de/inactive-de-lang-file/", follow=True) - doc = pq(response.content) - assert doc("h1").text() == "The State of Mozilla" - - @override_settings(DEV=True) - def test_inactive_locale_not_redirected_dev_true(self): - """ - Inactive lang file should not redirect in DEV mode. - """ - response = self.client.get("/de/inactive-de-lang-file/") - assert response.status_code == 200 - doc = pq(response.content) - assert doc("h1").text() == "Die Lage von Mozilla" - - def test_active_alternate_lang_file(self): - """Template with active alternate lang file should activate from it.""" - response = self.client.get("/de/state-of-mozilla/") - assert response.status_code == 200 - doc = pq(response.content) - assert doc("h1").text() == "Die Lage von Mozilla" - - -class TestDotlang(TestCase): - def setUp(self): - cache.clear() - clear_url_caches() - - def tearDown(self): - cache.clear() - - def test_parse(self): - path = str(ROOT_PATH.joinpath("test.lang")) - parsed = parse(path) - expected = { - "Hooray! Your Firefox is up to date.": "F\xe9licitations ! Votre Firefox a \xe9t\xe9 mis \xe0 jour.", - "Your Firefox is out of date.": "Votre Firefox ne semble pas \xe0 jour.", - "Firefox Beta": "Firefox Beta", - "Firefox Aurora": "Firefox Aurora", - } - assert parsed == expected - - def test_parse_not_skip_untranslated(self): - path = str(ROOT_PATH.joinpath("test.lang")) - parsed = parse(path, skip_untranslated=False) - expected = { - "Hooray! Your Firefox is up to date.": "F\xe9licitations ! Votre Firefox a \xe9t\xe9 mis \xe0 jour.", - "Your Firefox is out of date.": "Votre Firefox ne semble pas \xe0 jour.", - "Firefox Beta": "Firefox Beta", - "Firefox Aurora": "Firefox Aurora", - "Firefox Developer Edition": "Firefox Developer Edition", - } - assert parsed == expected - - def test_parse_with_comments(self): - path = str(ROOT_PATH.joinpath("test.lang")) - parsed = parse(path, extract_comments=True) - - expected = { - "Hooray! Your Firefox is up to date.": [ - "This is for the Whatsnew page: http://www-dev.allizom.org/b/firefox/whatsnew/", - "F\xe9licitations ! Votre Firefox a \xe9t\xe9 mis \xe0 jour.", - ], - "Your Firefox is out of date.": [ - None, - "Votre Firefox ne semble pas \xe0 jour.", - ], - "Firefox Beta": [ - None, - "Firefox Beta", - ], - "Firefox Aurora": [ - None, - "Firefox Aurora", - ], - } - assert parsed == expected - - @override_settings(EMAIL_SUBJECT_PREFIX="[bedrock] ", MANAGERS=("dude@example.com",)) - def test_parse_utf8_error(self): - path = str(ROOT_PATH.joinpath("test_utf8_error.lang")) - parsed = parse(path) - assert len(mail.outbox) == 1 - assert mail.outbox[0].subject == "[bedrock] %s is corrupted" % path - expected = {"Update now": "Niha rojane bike", "Supported Devices": "C�haz�n pi�tgiriy�"} - assert parsed == expected - mail.outbox = [] - - def test_parse_ingnores_untranslated(self): - """parse should skip strings that aren't translated.""" - path = str(ROOT_PATH.joinpath("locale/de/main.lang")) - parsed = parse(path) - expected = {"The State of Mozilla": "Awesome Baby! YEEEAAHHHH!!"} - self.assertDictEqual(parsed, expected) - - def test_format_identifier_re(self): - assert FORMAT_IDENTIFIER_RE.findall("%s %s") == [("%s", ""), ("%s", "")] - - assert FORMAT_IDENTIFIER_RE.findall("%(foo_bar)s %s") == [("%(foo_bar)s", "foo_bar"), ("%s", "")] - - @override_settings( - DEV=False, - ROOT=ROOT, - LOCALES_PATH=LOCALES_PATH, - LANGUAGE_CODE="en-US", # Triggers reset of Django's language cache - EMAIL_SUBJECT_PREFIX="[bedrock] ", - MANAGERS=("dude@example.com",), - ) - def test_format_identifier_mismatch(self): - path = "format_identifier_mismatch" - expected = "%(foo)s is the new %s" - with self.activate("fr"): - result = translate(expected, [path]) - assert expected == result - assert len(mail.outbox) == 1 - assert mail.outbox[0].subject == f"[bedrock] {LOCALES_PATH}/fr/{path}.lang is corrupted" - mail.outbox = [] - - @override_settings( - DEV=False, - ROOT=ROOT, - LOCALES_PATH=LOCALES_PATH, - LANGUAGE_CODE="en-US", # Triggers reset of Django's language cache - ) - def test_format_identifier_order(self): - """ - Test that the order in which the format identifier appears doesn't - matter - """ - path = "format_identifier_mismatch" - expected = "%(foo)s is the new %(bar)s" - with self.activate("fr"): - result = translate(expected, [path]) - assert expected != result - assert len(mail.outbox) == 0 - - @patch.object(jinja_env.loader, "searchpath", TEMPLATE_DIRS) - @override_settings( - ROOT_URLCONF="lib.l10n_utils.tests.test_files.urls", - ROOT=ROOT, - LOCALES_PATH=LOCALES_PATH, - LANGUAGE_CODE="en-US", # Triggers reset of Django's language cache - ) - def test_lang_files_queried_in_order(self): - """The more specific lang files should be searched first.""" - response = self.client.get("/de/trans-block-reload-test/") - doc = pq(response.content) - gettext_call = doc("h1") - assert gettext_call.text() == "Die Lage von Mozilla" - - @override_settings( - DEV=False, - ROOT=ROOT, - LOCALES_PATH=LOCALES_PATH, - LANGUAGE_CODE="en-US", # Triggers reset of Django's language cache - ) - def test_extract_message_tweaks_do_not_break(self): - """ - Extraction and translation matching should tweak msgids the same. - """ - clean_string = "Stuff about many things." - dirty_string = "Stuff\xa0about\r\nmany\t things." - trans_string = "This is the translation." - - # extraction - pypath = ROOT_PATH.joinpath("extract_me.py") - with io.open(str(pypath), "rb") as pyfile: - vals = next(extract_python(pyfile, ["_"], [], {})) - assert vals[2] == clean_string - - # translation - # path won't exist for en-US as there isn't a dir for that - # in locale. - with self.activate("fr"): - result = translate(dirty_string, ["does_not_exist"]) - assert result == dirty_string - - result = translate(dirty_string, ["tweaked_message_translation"]) - assert result == trans_string - - @patch("lib.l10n_utils.dotlang.translate") - def test_new_lang_files_do_not_modify_settings(self, trans_patch): - """ - Test to make sure that building the new lang files list does not - modify `settings.DOTLANG_FILES`. - """ - old_setting = settings.DOTLANG_FILES[:] - trans_str = "Translate me" - _(trans_str) - call_lang_files = [LANG_FILES] + settings.DOTLANG_FILES - trans_patch.assert_called_with(trans_str, call_lang_files) - assert old_setting == settings.DOTLANG_FILES - - @patch("lib.l10n_utils.dotlang.translate") - def test_gettext_ignores_default_lang_files(self, trans_patch): - """ - The `l10n_utils.dotlang._` function should search .lang files - specified in the module from which it's called before the - default files, but it should not include the defaults twice. - """ - # use LANG_FILES global in this module - global LANG_FILES - old_lang_files = LANG_FILES - - trans_str = "Translate me" - LANG_FILES = [settings.DOTLANG_FILES[0], "dude", "donnie", "walter"] - _(trans_str) - call_lang_files = LANG_FILES[1:] + settings.DOTLANG_FILES - trans_patch.assert_called_with(trans_str, call_lang_files) - - # restore original value to avoid test leakage - LANG_FILES = old_lang_files - - @patch("lib.l10n_utils.dotlang.translate") - def test_gettext_searches_specified_lang_files(self, trans_patch): - """ - The `l10n_utils.dotlang._` function should search .lang files - specified in the module from which it's called before the - default files. - """ - # use LANG_FILES global in this module - global LANG_FILES - old_lang_files = LANG_FILES - - # test the case when LANG_FILES is a string - trans_str = "Translate me" - _(trans_str) - call_lang_files = [LANG_FILES] + settings.DOTLANG_FILES - trans_patch.assert_called_with(trans_str, call_lang_files) - - # test the case when LANG_FILES is a list - LANG_FILES = ["dude", "donnie", "walter"] - _(trans_str) - call_lang_files = LANG_FILES + settings.DOTLANG_FILES - trans_patch.assert_called_with(trans_str, call_lang_files) - - # restore original value to avoid test leakage - LANG_FILES = old_lang_files - - @patch("lib.l10n_utils.dotlang.translate") - def test_gettext_searches_kwarg_specified_lang_files(self, trans_patch): - """ - The `l10n_utils.dotlang._` function should search .lang files - specified in the `lang_files` keyword arg, and not the ones from the - module. - """ - # test the case when LANG_FILES is a string - trans_str = "Translate me" - _(trans_str, lang_files="maude") - call_lang_files = ["maude"] + settings.DOTLANG_FILES - trans_patch.assert_called_with(trans_str, call_lang_files) - - # test the case when LANG_FILES is a list - lang_files_list = ["maude", "bunny", "uli"] - _(trans_str, lang_files=lang_files_list) - call_lang_files = lang_files_list + settings.DOTLANG_FILES - trans_patch.assert_called_with(trans_str, call_lang_files) - - @patch("lib.l10n_utils.dotlang.translate") - def test_gettext_lazy_searches_kwarg_specified_lang_files(self, trans_patch): - """ - The `l10n_utils.dotlang._lazy` function should search .lang files - specified in the `lang_files` keyword arg, and not the ones from the - module. - """ - # test the case when LANG_FILES is a string - trans_str = "Translate me" - # have to call __str__ directly because the value is a Mock - # object, and the `str()` function throws an exception. - _lazy(trans_str, lang_files="maude").__str__() - call_lang_files = ["maude"] + settings.DOTLANG_FILES - trans_patch.assert_called_with(trans_str, call_lang_files) - - # test the case when LANG_FILES is a list - lang_files_list = ["maude", "bunny", "uli"] - _lazy(trans_str, lang_files=lang_files_list).__str__() - call_lang_files = lang_files_list + settings.DOTLANG_FILES - trans_patch.assert_called_with(trans_str, call_lang_files) - - @patch("lib.l10n_utils.dotlang.translate") - def test_lazy_gettext_searches_specified_lang_files(self, trans_patch): - """ - The `l10n_utils.dotlang._lazy` function should search .lang files - specified in the module from which it's called before the - default files. - """ - from lib.l10n_utils.tests.test_files import extract_me_with_langfiles_lazy - - dude_says = extract_me_with_langfiles_lazy.do_translate() - dirty_string = "I'm The Dude, so that's what you call me, man." - self.assertFalse(trans_patch.called) - # have to call __str__ directly because the value is a Mock - # object, and the `str()` function throws an exception. - dude_says.__str__() - trans_patch.assert_called_with(dirty_string, ["donnie", "walter"] + settings.DOTLANG_FILES) - - @patch("lib.l10n_utils.dotlang.translate") - def test_gettext_works_without_extra_lang_files(self, trans_patch): - """ - The `l10n_utils.dotlang._` function should search the default .lang - files if no others are specified. - """ - from lib.l10n_utils.tests.test_files import extract_me - - extract_me.do_translate() - dirty_string = "Stuff\xa0about\r\nmany\t things." - trans_patch.assert_called_with(dirty_string, settings.DOTLANG_FILES) - - def test_gettext_str_interpolation(self): - result = _("The %s %s.", "dude", "abides") - assert result == "The dude abides." - - @patch("lib.l10n_utils.dotlang.cache") - def test_translate_skips_for_default_locale(self, cache_mock): - """ - Translation calls should not hit the cache for the default language. - There will never be any lang files, and the strings in the calls are - the correct ones already. - """ - with self.activate("fr"): - translate("The Dude abides.", ["main"]) - self.assertEqual(cache_mock.get.call_count, 1) - cache_mock.reset_mock() - with self.activate(settings.LANGUAGE_CODE): - translate("The Dude abides.", ["main"]) - self.assertEqual(cache_mock.get.call_count, 0) - - -@patch.object(jinja_env.loader, "searchpath", TEMPLATE_DIRS) -@override_settings( - DEV=False, - ROOT_URLCONF="lib.l10n_utils.tests.test_files.urls", - ROOT=ROOT, - LOCALES_PATH=LOCALES_PATH, - LANGUAGE_CODE="en-US", # Triggers reset of Django's language cache -) -class TestTranslationList(TestCase): - def setUp(self): - clear_url_caches() - cache.clear() - - def tearDown(self): - cache.clear() - - def _test(self, lang, view_name): - """ - The context of each view should have the 'links' dictionary which - contains the canonical and alternate URLs of the page. - """ - from product_details import product_details - - request = HttpRequest() - request.path = "/" + lang + "/" + view_name + "/" - request.path_info = request.path - request.locale = lang - template = view_name.replace("-", "_") + ".html" - with patch("lib.l10n_utils.django_render") as django_render: - render(request, template, {}) - translations = django_render.call_args[0][2]["translations"] - - # The en-US locale is always active - assert translations["en-US"] == product_details.languages["en-US"]["native"] - # The de locale is active depending on the template - if view_name == "active-de-lang-file": - assert translations["de"] == product_details.languages["de"]["native"] - else: - assert "de" not in translations - # The fr locale is inactive - assert "fr" not in translations - - def test_localized_en(self): - self._test("en-US", "active-de-lang-file") - - def test_localized_de(self): - self._test("de", "active-de-lang-file") - - def test_unlocalized(self): - self._test("en-US", "inactive-de-lang-file") diff --git a/lib/l10n_utils/tests/test_extract.py b/lib/l10n_utils/tests/test_extract.py deleted file mode 100644 index ea017d8b01..0000000000 --- a/lib/l10n_utils/tests/test_extract.py +++ /dev/null @@ -1,146 +0,0 @@ -# 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 https://mozilla.org/MPL/2.0/. - -# taken and modified from tower tests - -import io - -from babel.messages.catalog import Catalog -from babel.messages.extract import extract -from babel.messages.pofile import write_po -from puente.commands import generate_options_map -from puente.settings import get_setting - - -def test_extract_python(): - fileobj = io.BytesIO(TEST_PO_INPUT) - method = "lib.l10n_utils.extract.extract_python" - output = fake_extract_command(filename="filename", fileobj=fileobj, method=method) - - # god help you if these are ever unequal - assert TEST_PO_OUTPUT == output - - -def test_extract_jinja2(): - fileobj = io.BytesIO(TEST_TEMPLATE_INPUT) - method = "lib.l10n_utils.extract.extract_jinja2" - output = fake_extract_command(filename="filename", fileobj=fileobj, method=method) - - # god help you if these are ever unequal - assert TEST_TEMPLATE_OUTPUT == output - - -def fake_extract_command( - filename, fileobj, method, options=generate_options_map(), keywords=get_setting("KEYWORDS"), comment_tags=get_setting("COMMENT_TAGS") -): - catalog = Catalog(charset="utf-8") - extracted = fake_extract_from_dir(filename, fileobj, method, options, keywords, comment_tags) - for filename, lineno, msg, cmts, ctxt in extracted: - catalog.add(msg, None, [(filename, lineno)], auto_comments=cmts, context=ctxt) - - po_out = io.BytesIO() - write_po(po_out, catalog, width=80, omit_header=True) - return po_out.getvalue() - - -def fake_extract_from_dir(filename, fileobj, method, options, keywords, comment_tags): - """We use Babel's exctract_from_dir() to pull out our gettext - strings. In the tests, I don't have a directory of files, I have StringIO - objects. So, we fake the original function with this one.""" - for lineno, message, comments, context in extract(method, fileobj, keywords, comment_tags, options): - - yield filename, lineno, message, comments, context - - -TEST_PO_INPUT = b""" -_('fligtar') -# Make sure several uses collapses to one -ngettext('a fligtar', 'many fligtars', 1) -ngettext('a fligtar', 'many fligtars', 3) -ngettext('a fligtar', 'many fligtars', 5) -# Test comments -# L10N: Turn up the volume -_('fligtar \\n\\n\\r\\t talking') -# Test comments w/ plural and context -# l10n: Turn down the volume -ngettext('fligtar', 'many fligtars', 5) -# Test lazy strings are extracted -_lazy('a lazy string') -""" - -TEST_PO_OUTPUT = b"""\ -#. l10n: Turn down the volume -#: filename:2 filename:12 -msgid "fligtar" -msgid_plural "many fligtars" -msgstr[0] "" -msgstr[1] "" - -#: filename:4 filename:5 filename:6 -msgid "a fligtar" -msgid_plural "many fligtars" -msgstr[0] "" -msgstr[1] "" - -#. L10N: Turn up the volume -#: filename:9 -msgid "fligtar talking" -msgstr "" - -#: filename:14 -msgid "a lazy string" -msgstr "" - -""" - -TEST_TEMPLATE_INPUT = b""" - {{ _('sunshine') }} - {# Regular comment, regular gettext #} - {% trans %} - I like pie. - {% endtrans %} - {# l10N: How many hours? #} - {% trans plural=4, count=4 %} - {{ count }} hour left - {% pluralize %} - {{ count }} hours left - {% endtrans %} - {{ ngettext("one", "many", 5) }} - {# L10n: This string has a hat. #} - {% trans %} - Let me tell you about a string - who spanned - multiple lines. - {% endtrans %} -""" - -TEST_TEMPLATE_OUTPUT = b"""\ -#: filename:2 -msgid "sunshine" -msgstr "" - -#: filename:4 -msgid "I like pie." -msgstr "" - -#. How many hours? -#: filename:8 -#, python-format -msgid "%(count)s hour left" -msgid_plural "%(count)s hours left" -msgstr[0] "" -msgstr[1] "" - -#: filename:13 -msgid "one" -msgid_plural "many" -msgstr[0] "" -msgstr[1] "" - -#. This string has a hat. -#: filename:15 -msgid "Let me tell you about a string who spanned multiple lines." -msgstr "" - -""" diff --git a/lib/l10n_utils/tests/test_files/__init__.py b/lib/l10n_utils/tests/test_files/__init__.py deleted file mode 100644 index 448bb8652d..0000000000 --- a/lib/l10n_utils/tests/test_files/__init__.py +++ /dev/null @@ -1,3 +0,0 @@ -# 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 https://mozilla.org/MPL/2.0/. diff --git a/lib/l10n_utils/tests/test_files/extract_me.py b/lib/l10n_utils/tests/test_files/extract_me.py deleted file mode 100644 index 9afe7d1457..0000000000 --- a/lib/l10n_utils/tests/test_files/extract_me.py +++ /dev/null @@ -1,11 +0,0 @@ -# coding: utf-8 - -# 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 https://mozilla.org/MPL/2.0/. - -from lib.l10n_utils.dotlang import gettext as _ - - -def do_translate(): - _("Stuff\xa0about\r\nmany\t things.") diff --git a/lib/l10n_utils/tests/test_files/extract_me_with_langfiles.py b/lib/l10n_utils/tests/test_files/extract_me_with_langfiles.py deleted file mode 100644 index cec31ef9f1..0000000000 --- a/lib/l10n_utils/tests/test_files/extract_me_with_langfiles.py +++ /dev/null @@ -1,14 +0,0 @@ -# coding: utf-8 - -# 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 https://mozilla.org/MPL/2.0/. - -from lib.l10n_utils.dotlang import _ - -LANG_FILES = [ - "lebowski", - "dude", -] - -dude_says = _("I'm The Dude, so that's what you call me, man.") diff --git a/lib/l10n_utils/tests/test_files/extract_me_with_langfiles_lazy.py b/lib/l10n_utils/tests/test_files/extract_me_with_langfiles_lazy.py deleted file mode 100644 index 1561f6958c..0000000000 --- a/lib/l10n_utils/tests/test_files/extract_me_with_langfiles_lazy.py +++ /dev/null @@ -1,16 +0,0 @@ -# coding: utf-8 - -# 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 https://mozilla.org/MPL/2.0/. - -from lib.l10n_utils.dotlang import _lazy as _ - -LANG_FILES = [ - "donnie", - "walter", -] - - -def do_translate(): - return _("I'm The Dude, so that's what you call me, man.") diff --git a/lib/l10n_utils/tests/test_files/locale/de/active_de_lang_file.lang b/lib/l10n_utils/tests/test_files/locale/de/active_de_lang_file.lang deleted file mode 100644 index 8de010866e..0000000000 --- a/lib/l10n_utils/tests/test_files/locale/de/active_de_lang_file.lang +++ /dev/null @@ -1,8 +0,0 @@ -## active ## - -;The State of Mozilla -Die Lage von Mozilla - - -;Mozilla‘s vision of the Internet is a place where anyone can access information, a place where everyone can hack and tinker; one that has openness, freedom and transparency; where users have control over their personal data and where all minds have the freedom to create and to consume without walls or tight restrictions. -Mozillas Vision des Internets ist ein Ort, wo jeder auf Informationen zugreifen kann, ein Ort, wo jeder programmieren und herumspielen kann; einer, der offen, frei und transparent ist; wo Benutzer die Kontrolle über ihre persönlichen Daten haben und wo jeder Geist die Freiheit hat, zu schaffen und zu konsumieren, ohne Mauern oder enge Einschränkungen. diff --git a/lib/l10n_utils/tests/test_files/locale/de/active_de_lang_file_bom.lang b/lib/l10n_utils/tests/test_files/locale/de/active_de_lang_file_bom.lang deleted file mode 100644 index 44b25b8625..0000000000 --- a/lib/l10n_utils/tests/test_files/locale/de/active_de_lang_file_bom.lang +++ /dev/null @@ -1,9 +0,0 @@ -## active ## - -;Hooray! Your Firefox is up to date. -Hurra! Ihr Firefox ist aktuell. - - -;Your Firefox is out of date. -Ihr Firefox ist veraltet. - diff --git a/lib/l10n_utils/tests/test_files/locale/de/firefox/fx.lang b/lib/l10n_utils/tests/test_files/locale/de/firefox/fx.lang deleted file mode 100644 index 176d777d28..0000000000 --- a/lib/l10n_utils/tests/test_files/locale/de/firefox/fx.lang +++ /dev/null @@ -1,11 +0,0 @@ -;Get the mobile browser that's got your back for free from Google Play » -Get the mobile browser that's got your back for free from Google Play » - - -;Explore Firefox for Android features  » -Explore Firefox for Android features  » - - -;See how the new features in Firefox help you browse faster and more efficiently. -See how the new features in Firefox help you browse faster and more efficiently. - diff --git a/lib/l10n_utils/tests/test_files/locale/de/inactive_de_lang_file.lang b/lib/l10n_utils/tests/test_files/locale/de/inactive_de_lang_file.lang deleted file mode 100644 index b03fe517d4..0000000000 --- a/lib/l10n_utils/tests/test_files/locale/de/inactive_de_lang_file.lang +++ /dev/null @@ -1,6 +0,0 @@ -;The State of Mozilla -Die Lage von Mozilla - - -;Mozilla‘s vision of the Internet is a place where anyone can access information, a place where everyone can hack and tinker; one that has openness, freedom and transparency; where users have control over their personal data and where all minds have the freedom to create and to consume without walls or tight restrictions. -Mozillas Vision des Internets ist ein Ort, wo jeder auf Informationen zugreifen kann, ein Ort, wo jeder programmieren und herumspielen kann; einer, der offen, frei und transparent ist; wo Benutzer die Kontrolle über ihre persönlichen Daten haben und wo jeder Geist die Freiheit hat, zu schaffen und zu konsumieren, ohne Mauern oder enge Einschränkungen. diff --git a/lib/l10n_utils/tests/test_files/locale/de/main.lang b/lib/l10n_utils/tests/test_files/locale/de/main.lang deleted file mode 100644 index aa123ef48e..0000000000 --- a/lib/l10n_utils/tests/test_files/locale/de/main.lang +++ /dev/null @@ -1,7 +0,0 @@ -## guten_tag ## -;The State of Mozilla -Awesome Baby! YEEEAAHHHH!! -## tag_after_non_tag_lines ## - -;The Dude abides. -The Dude abides. diff --git a/lib/l10n_utils/tests/test_files/locale/de/templates/l10n_blocks_with_langs.html b/lib/l10n_utils/tests/test_files/locale/de/templates/l10n_blocks_with_langs.html deleted file mode 100644 index 5fe1f240d2..0000000000 --- a/lib/l10n_utils/tests/test_files/locale/de/templates/l10n_blocks_with_langs.html +++ /dev/null @@ -1,14 +0,0 @@ -{# - 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 https://mozilla.org/MPL/2.0/. -#} - -{# Version: 20120101 #} - -{% extends "l10n_blocks_with_langs.html" %} - -{% l10n donnie %} - I am the walrus. -{% endl10n %} - diff --git a/lib/l10n_utils/tests/test_files/locale/de/trans_block_reload_test.lang b/lib/l10n_utils/tests/test_files/locale/de/trans_block_reload_test.lang deleted file mode 100644 index 8de010866e..0000000000 --- a/lib/l10n_utils/tests/test_files/locale/de/trans_block_reload_test.lang +++ /dev/null @@ -1,8 +0,0 @@ -## active ## - -;The State of Mozilla -Die Lage von Mozilla - - -;Mozilla‘s vision of the Internet is a place where anyone can access information, a place where everyone can hack and tinker; one that has openness, freedom and transparency; where users have control over their personal data and where all minds have the freedom to create and to consume without walls or tight restrictions. -Mozillas Vision des Internets ist ein Ort, wo jeder auf Informationen zugreifen kann, ein Ort, wo jeder programmieren und herumspielen kann; einer, der offen, frei und transparent ist; wo Benutzer die Kontrolle über ihre persönlichen Daten haben und wo jeder Geist die Freiheit hat, zu schaffen und zu konsumieren, ohne Mauern oder enge Einschränkungen. diff --git a/lib/l10n_utils/tests/test_files/locale/en-GB/firefox/new.lang b/lib/l10n_utils/tests/test_files/locale/en-GB/firefox/new.lang deleted file mode 100644 index 116a10b03c..0000000000 --- a/lib/l10n_utils/tests/test_files/locale/en-GB/firefox/new.lang +++ /dev/null @@ -1 +0,0 @@ -## active ## diff --git a/lib/l10n_utils/tests/test_files/locale/es-ES/firefox/new.lang b/lib/l10n_utils/tests/test_files/locale/es-ES/firefox/new.lang deleted file mode 100644 index 116a10b03c..0000000000 --- a/lib/l10n_utils/tests/test_files/locale/es-ES/firefox/new.lang +++ /dev/null @@ -1 +0,0 @@ -## active ## diff --git a/lib/l10n_utils/tests/test_files/locale/fr/firefox/new.lang b/lib/l10n_utils/tests/test_files/locale/fr/firefox/new.lang deleted file mode 100644 index 116a10b03c..0000000000 --- a/lib/l10n_utils/tests/test_files/locale/fr/firefox/new.lang +++ /dev/null @@ -1 +0,0 @@ -## active ## diff --git a/lib/l10n_utils/tests/test_files/locale/fr/format_identifier_mismatch.lang b/lib/l10n_utils/tests/test_files/locale/fr/format_identifier_mismatch.lang deleted file mode 100644 index dfeebc2c26..0000000000 --- a/lib/l10n_utils/tests/test_files/locale/fr/format_identifier_mismatch.lang +++ /dev/null @@ -1,5 +0,0 @@ -;%(foo)s is the new %s -%(foo)s is the new bar - -;%(foo)s is the new %(bar)s -%(bar)s is the new %(foo)s diff --git a/lib/l10n_utils/tests/test_files/locale/fr/tweaked_message_translation.lang b/lib/l10n_utils/tests/test_files/locale/fr/tweaked_message_translation.lang deleted file mode 100644 index 7f84839f77..0000000000 --- a/lib/l10n_utils/tests/test_files/locale/fr/tweaked_message_translation.lang +++ /dev/null @@ -1,2 +0,0 @@ -;Stuff about many things. -This is the translation. diff --git a/lib/l10n_utils/tests/test_files/locale/templates/LC_MESSAGES/messages.pot b/lib/l10n_utils/tests/test_files/locale/templates/LC_MESSAGES/messages.pot deleted file mode 100644 index 244fc8bfac..0000000000 --- a/lib/l10n_utils/tests/test_files/locale/templates/LC_MESSAGES/messages.pot +++ /dev/null @@ -1,35 +0,0 @@ -#, fuzzy -msgid "" -msgstr "" -"Project-Id-Version: PACKAGE VERSION\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2013-08-30 09:58-0700\n" -"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" -"Last-Translator: FULL NAME \n" -"Language-Team: LANGUAGE \n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=utf-8\n" -"Content-Transfer-Encoding: 8bit\n" -"X-Generator: Translate Toolkit 1.8.0\n" - -#. Said angrily, loudly, -#. and repeatedly. -#: templates/some_lang_files.html:10 -msgid "Is this your homework Larry?" -msgstr "" - -#: templates/some_lang_files.html:12 -msgid "The Dude minds!" -msgstr "" - -#: templates/firefox/fx.html:112 -msgid "Find out if your device is supported  »" -msgstr "" - -#. For bug 982755 -#: bedrock/firefox/templates/firefox/os/notes-1.3.html:164 -msgid "" -"The WebIccManager API, which allows support for multiple sim cards, has had " -"updates: iccChangeEvent has been added using using event generator bug 814637" -msgstr "" diff --git a/lib/l10n_utils/tests/test_files/locale/templates/firefox/fx.lang b/lib/l10n_utils/tests/test_files/locale/templates/firefox/fx.lang deleted file mode 100644 index ffdc759526..0000000000 --- a/lib/l10n_utils/tests/test_files/locale/templates/firefox/fx.lang +++ /dev/null @@ -1,16 +0,0 @@ -;Get the mobile browser that's got your back for free from Google Play » -Get the mobile browser that's got your back for free from Google Play » - - -;Explore Firefox for Android features  » -Explore Firefox for Android features  » - - -;Find out if your device is supported  » -Find out if your device is supported  » - - -;See how the new features in Firefox help you browse faster and more efficiently. -See how the new features in Firefox help you browse faster and more efficiently. - - diff --git a/lib/l10n_utils/tests/test_files/templates/active_de_lang_file.html b/lib/l10n_utils/tests/test_files/templates/active_de_lang_file.html deleted file mode 100644 index e31e6c8905..0000000000 --- a/lib/l10n_utils/tests/test_files/templates/active_de_lang_file.html +++ /dev/null @@ -1,22 +0,0 @@ -{# - 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 https://mozilla.org/MPL/2.0/. -#} - -{% set_lang_files "inactive_de_lang_file" %} - - - -

{{ _('The State of Mozilla') }}

-

- {% trans %} - Mozilla‘s vision of the Internet is a place where anyone can - access information, a place where everyone can hack and tinker; - one that has openness, freedom and transparency; where users have - control over their personal data and where all minds have the - freedom to create and to consume without walls or tight restrictions. - {% endtrans %} -

- - diff --git a/lib/l10n_utils/tests/test_files/templates/even_more_lang_files.html b/lib/l10n_utils/tests/test_files/templates/even_more_lang_files.html deleted file mode 100644 index e5ec9172c2..0000000000 --- a/lib/l10n_utils/tests/test_files/templates/even_more_lang_files.html +++ /dev/null @@ -1,12 +0,0 @@ -{# - 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 https://mozilla.org/MPL/2.0/. -#} - -{% extends "some_lang_files.html" %} - -{% block content %} - {% add_lang_files "donnie" "smokey" "jesus" %} - {{ _('Mark it 8 Dude.') }} -{% endblock %} diff --git a/lib/l10n_utils/tests/test_files/templates/inactive_de_lang_file.html b/lib/l10n_utils/tests/test_files/templates/inactive_de_lang_file.html deleted file mode 100644 index 5c321682d9..0000000000 --- a/lib/l10n_utils/tests/test_files/templates/inactive_de_lang_file.html +++ /dev/null @@ -1,20 +0,0 @@ -{# - 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 https://mozilla.org/MPL/2.0/. -#} - - - -

{{ _('The State of Mozilla') }}

-

- {% trans %} - Mozilla‘s vision of the Internet is a place where anyone can - access information, a place where everyone can hack and tinker; - one that has openness, freedom and transparency; where users have - control over their personal data and where all minds have the - freedom to create and to consume without walls or tight restrictions. - {% endtrans %} -

- - diff --git a/lib/l10n_utils/tests/test_files/templates/l10n_blocks_with_langs.html b/lib/l10n_utils/tests/test_files/templates/l10n_blocks_with_langs.html deleted file mode 100644 index ed9aaa4e54..0000000000 --- a/lib/l10n_utils/tests/test_files/templates/l10n_blocks_with_langs.html +++ /dev/null @@ -1,17 +0,0 @@ -{# - 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 https://mozilla.org/MPL/2.0/. -#} - -{% l10n dude locales=fr,es-ES,ru 20121212 %} - This aggression will not stand, man. -{% endl10n %} - -{% l10n walter, locales=es-ES,ru 20121212 %} - I'm stayin'. Finishin' my coffee. -{% endl10n %} - -{% l10n donnie locales=ru,de 20121212 %} - Phone's ringing Dude. -{% endl10n %} diff --git a/lib/l10n_utils/tests/test_files/templates/l10n_blocks_without_langs.html b/lib/l10n_utils/tests/test_files/templates/l10n_blocks_without_langs.html deleted file mode 100644 index a9c0192461..0000000000 --- a/lib/l10n_utils/tests/test_files/templates/l10n_blocks_without_langs.html +++ /dev/null @@ -1,17 +0,0 @@ -{# - 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 https://mozilla.org/MPL/2.0/. -#} - -{% l10n dude locales=fr,es-ES,ru 20121212 %} - This aggression will not stand, man. -{% endl10n %} - -{% l10n walter, locales=es-ES,ru 20121212 %} - I'm stayin'. Finishin' my coffee. -{% endl10n %} - -{% l10n donnie 20121212 %} - Phone's ringing Dude. -{% endl10n %} diff --git a/lib/l10n_utils/tests/test_files/templates/no_lang_files.html b/lib/l10n_utils/tests/test_files/templates/no_lang_files.html deleted file mode 100644 index 50afe5d494..0000000000 --- a/lib/l10n_utils/tests/test_files/templates/no_lang_files.html +++ /dev/null @@ -1,15 +0,0 @@ -{# - 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 https://mozilla.org/MPL/2.0/. -#} - - - - Brandt - - -

That had not occurred to us Dude.

- {% block content %}{% endblock %} - - diff --git a/lib/l10n_utils/tests/test_files/templates/reset_lang_files.html b/lib/l10n_utils/tests/test_files/templates/reset_lang_files.html deleted file mode 100644 index eff0b231ad..0000000000 --- a/lib/l10n_utils/tests/test_files/templates/reset_lang_files.html +++ /dev/null @@ -1,11 +0,0 @@ -{# - 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 https://mozilla.org/MPL/2.0/. -#} - -{% extends "even_more_lang_files.html" %} - -{% block content %} - {% set_lang_files "maud" "bunny" "uli" %} -{% endblock %} diff --git a/lib/l10n_utils/tests/test_files/templates/some_lang_files.html b/lib/l10n_utils/tests/test_files/templates/some_lang_files.html deleted file mode 100644 index 602831aac1..0000000000 --- a/lib/l10n_utils/tests/test_files/templates/some_lang_files.html +++ /dev/null @@ -1,13 +0,0 @@ -{# - 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 https://mozilla.org/MPL/2.0/. -#} - -{% extends "no_lang_files.html" %} - -{% block content %} - {% add_lang_files "dude" "walter" "main" %} - {# L10n: Said angrily, loudly, and repeatedly. #} - {{ _('Is this your homework Larry?') }} -{% endblock %} diff --git a/lib/l10n_utils/tests/test_files/templates/state_of_mozilla.html b/lib/l10n_utils/tests/test_files/templates/state_of_mozilla.html deleted file mode 100644 index 0ccad8595e..0000000000 --- a/lib/l10n_utils/tests/test_files/templates/state_of_mozilla.html +++ /dev/null @@ -1,22 +0,0 @@ -{# - 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 https://mozilla.org/MPL/2.0/. -#} - -{% set_lang_files "active_de_lang_file" "inactive_de_lang_file" %} - - - -

{{ _('The State of Mozilla') }}

-

- {% trans %} - Mozilla‘s vision of the Internet is a place where anyone can - access information, a place where everyone can hack and tinker; - one that has openness, freedom and transparency; where users have - control over their personal data and where all minds have the - freedom to create and to consume without walls or tight restrictions. - {% endtrans %} -

- - diff --git a/lib/l10n_utils/tests/test_files/templates/trans_block_reload_test.html b/lib/l10n_utils/tests/test_files/templates/trans_block_reload_test.html deleted file mode 100644 index fccb27f4f1..0000000000 --- a/lib/l10n_utils/tests/test_files/templates/trans_block_reload_test.html +++ /dev/null @@ -1,20 +0,0 @@ -{# - 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 https://mozilla.org/MPL/2.0/. -#} - - - -

{{ _('The State of Mozilla') }}

-

- {% trans %} - Mozilla‘s vision of the Internet is a place where anyone can - access information, a place where everyone can hack and tinker; - one that has openness, freedom and transparency; where users have - control over their personal data and where all minds have the - freedom to create and to consume without walls or tight restrictions. - {% endtrans %} -

- - diff --git a/lib/l10n_utils/tests/test_files/test.lang b/lib/l10n_utils/tests/test_files/test.lang deleted file mode 100644 index f48e5ac898..0000000000 --- a/lib/l10n_utils/tests/test_files/test.lang +++ /dev/null @@ -1,20 +0,0 @@ -# This is for the Whatsnew page: http://www-dev.allizom.org/b/firefox/whatsnew/ - - -;Hooray! Your Firefox is up to date. -Félicitations ! Votre Firefox a été mis à jour. - - -;Your Firefox is out of date. -Votre Firefox ne semble pas à jour. - - -;Firefox Beta -Firefox Beta {ok} - - -;Firefox Aurora -Firefox Aurora {OK} - -;Firefox Developer Edition -Firefox Developer Edition diff --git a/lib/l10n_utils/tests/test_files/test_utf8_error.lang b/lib/l10n_utils/tests/test_files/test_utf8_error.lang deleted file mode 100644 index 1d16af030c..0000000000 --- a/lib/l10n_utils/tests/test_files/test_utf8_error.lang +++ /dev/null @@ -1,6 +0,0 @@ -;Update now -Niha rojane bike - - -;Supported Devices -Chazn pitgiriy diff --git a/lib/l10n_utils/tests/test_files/urls.py b/lib/l10n_utils/tests/test_files/urls.py deleted file mode 100644 index 72e7724481..0000000000 --- a/lib/l10n_utils/tests/test_files/urls.py +++ /dev/null @@ -1,18 +0,0 @@ -# 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 https://mozilla.org/MPL/2.0/. - -from bedrock.mozorg.util import page -from bedrock.urls import urlpatterns - -# have to append these to existing site patterns -# because calls to e.g. {{ url('mozorg.home') }} -# in templates don't work otherwise. -urlpatterns += ( - page("trans-block-reload-test", "trans_block_reload_test.html"), - page("active-de-lang-file", "active_de_lang_file.html"), - page("inactive-de-lang-file", "inactive_de_lang_file.html"), - page("some-lang-files", "some_lang_files.html"), - page("state-of-mozilla", "state_of_mozilla.html"), - page("firefox/new", "firefox/new.html"), -) diff --git a/lib/l10n_utils/tests/test_gettext.py b/lib/l10n_utils/tests/test_gettext.py deleted file mode 100644 index ffc2ec93db..0000000000 --- a/lib/l10n_utils/tests/test_gettext.py +++ /dev/null @@ -1,345 +0,0 @@ -# -*- coding: utf-8 -*- - -# 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 https://mozilla.org/MPL/2.0/. - -import os -from pathlib import Path - -from django.conf import settings -from django.core.cache import caches -from django.test import TestCase -from django.test.utils import override_settings - -from mock import ANY, MagicMock, Mock, patch - -from lib.l10n_utils.gettext import ( - _append_to_lang_file, - _get_template_tag_set, - langfiles_for_path, - parse_python, - parse_template, - po_msgs, - pot_to_langfiles, - template_has_tag, - template_is_active, -) -from lib.l10n_utils.tests import TempFileMixin - -cache = caches["l10n"] -ROOT_PATH = Path(__file__).with_name("test_files") -LOCALES_PATH = ROOT_PATH / "locale" -ROOT = str(ROOT_PATH) -TEMPLATE_DIRS = os.path.join(ROOT, "templates") -DOTLANG_FILES = ["dude", "walter", "donny"] - -# doing this to keep @patch from passing a new mock -# we don't need to the decorated method. -TRUE_MOCK = Mock() -TRUE_MOCK.return_value = True - - -@override_settings(DEV=False) -class TestTemplateTagFuncs(TestCase): - @patch("lib.l10n_utils.gettext._get_template_tag_set") - @patch("lib.l10n_utils.gettext.cache.get") - @patch("lib.l10n_utils.gettext.cache.set") - def test_cache_hit(self, cache_set_mock, cache_get_mock, template_tags_mock): - """Should not call other methods on cache hit.""" - cache_get_mock.return_value = set(["active"]) - self.assertTrue(template_is_active("the/dude", "de")) - cache_get_mock.assert_called_once_with("template_tag_set:the/dude:de") - self.assertFalse(template_tags_mock.called) - self.assertFalse(cache_set_mock.called) - - @patch("lib.l10n_utils.gettext._get_template_tag_set") - @patch("lib.l10n_utils.gettext.cache.get") - @patch("lib.l10n_utils.gettext.cache.set") - def test_cache_miss(self, cache_set_mock, cache_get_mock, template_tags_mock): - """Should check the files and set the cache on cache miss.""" - cache_get_mock.return_value = None - template_tags_mock.return_value = set(["active"]) - self.assertTrue(template_is_active("the/dude", "de")) - cache_key = "template_tag_set:the/dude:de" - cache_get_mock.assert_called_once_with(cache_key) - self.assertTrue(template_tags_mock.called) - cache_set_mock.assert_called_once_with(cache_key, set(["active"])) - - @patch("lib.l10n_utils.gettext.get_l10n_path") - @patch("lib.l10n_utils.gettext.get_template") - @patch("lib.l10n_utils.gettext.parse_template") - @patch("lib.l10n_utils.gettext.lang_file_tag_set") - def test_get_template_tag_set(self, lang_file_tag_set, parse_template_mock, get_template, get_lang_path): - """Should return a unique set of tags from all lang files.""" - parse_template_mock.return_value = ["dude", "walter"] - lang_file_tag_set.side_effect = [set(["dude", "donny"]), set(["dude", "uli", "bunny"]), set(["walter", "brandt"])] - self.assertSetEqual(_get_template_tag_set("stuff", "es"), set(["dude", "walter", "donny", "uli", "bunny", "brandt"])) - - @override_settings(LANGUAGE_CODE="en-US") - def test_template_tag_set_default_locale(self): - """The default language should always have every tag.""" - assert template_has_tag("the_dude", "en-US", "active") - - -class TestPOFiles(TestCase): - good_messages = [ - ["Said angrily, loudly, and repeatedly.", "Is this your homework Larry?"], - [None, "The Dude minds!"], - ] - - @override_settings(ROOT=ROOT, LOCALES_PATH=LOCALES_PATH) - def test_parse_po(self): - """Should return correct messages""" - msgs = po_msgs("messages") - expected = { - "templates/some_lang_files.html": self.good_messages, - "templates/firefox/fx.html": [[None, "Find out if your device is supported  »"]], - "bedrock/firefox/templates/firefox/os/notes-1.3.html": [ - [ - "For bug 982755", - "The WebIccManager API, which allows support for multiple sim cards, " - "has had updates: iccChangeEvent has been added using using event " - 'generator bug 814637', - ] - ], - } - self.assertDictEqual(msgs, expected) - - @override_settings(ROOT=ROOT, LOCALES_PATH=LOCALES_PATH) - @patch("lib.l10n_utils.gettext._append_to_lang_file") - @patch("lib.l10n_utils.gettext.langfiles_for_path") - def test_po_to_langfiles(self, langfiles_mock, append_mock): - """Should get the correct messages for the correct langfile.""" - # This should exclude the supported device message from the pot file. - langfiles_mock.return_value = ["some_lang_files", "firefox/fx"] - pot_to_langfiles("messages") - append_mock.assert_any_call(ANY, self.good_messages) - - @patch("os.path.exists", TRUE_MOCK) - @patch("lib.l10n_utils.gettext.codecs") - def test_append_to_lang_file(self, codecs_mock): - """Should attempt to write a correctly formatted langfile.""" - _append_to_lang_file("dude.lang", self.good_messages) - lang_vals = codecs_mock.open.return_value - lang_vals = lang_vals.__enter__.return_value.write.call_args_list - lang_vals = [call[0][0] for call in lang_vals] - expected = [ - "\n\n# Said angrily, loudly, and repeatedly.\n;Is this your homework Larry?\nIs this your homework Larry?\n", - "\n\n;The Dude minds!\nThe Dude minds!\n", - ] - self.assertListEqual(lang_vals, expected) - - @patch("os.makedirs") - @patch("lib.l10n_utils.gettext.codecs") - def test_append_to_lang_file_dir_creation(self, codecs_mock, md_mock): - """Should create dirs if required.""" - path_exists = os.path.join(ROOT, "locale", "templates", "firefox", "fx.lang") - path_dir_exists = os.path.join(ROOT, "locale", "templates", "firefox", "new.lang") - path_new = os.path.join(ROOT, "locale", "de", "does", "not", "exist.lang") - with patch("os.path.dirname") as dn_mock: - _append_to_lang_file(path_exists, {}) - assert not dn_mock.called - - dn_mock.reset_mock() - dn_mock.return_value = os.path.join(ROOT, "locale", "templates", "firefox") - _append_to_lang_file(path_dir_exists, {}) - assert dn_mock.called - - md_mock.reset_mock() - _append_to_lang_file(path_dir_exists, {}) - assert not md_mock.called - - md_mock.reset_mock() - _append_to_lang_file(path_new, {}) - assert md_mock.called - - @override_settings(ROOT=ROOT, LOCALES_PATH=LOCALES_PATH, DOTLANG_FILES=DOTLANG_FILES) - @patch("lib.l10n_utils.gettext.parse_lang") - @patch("lib.l10n_utils.gettext.codecs", MagicMock()) - def test_uses_default_lang_files(self, pl_mock): - """Should use the default files from settings""" - pl_mock.return_value = {} # avoid side-effects - pot_to_langfiles() - calls = [(("{0}/locale/templates/{1}.lang".format(ROOT, lf),), {"skip_untranslated": False}) for lf in DOTLANG_FILES] - pl_mock.assert_has_calls(calls) - - -class TestParseTemplate(TempFileMixin, TestCase): - def setUp(self): - cache.clear() - - @patch("lib.l10n_utils.gettext.codecs") - def test_single_lang_file_added(self, codecs_mock): - tempf = self.tempfile( - """ - {% add_lang_files "lebowski" %} - - {% block title %}El Dudarino{% endblock %} - """ - ) - codecs_mock.open.return_value = tempf - lang_files = parse_template("file/doesnt/matter.html") - assert lang_files == ["lebowski"] - - @patch("lib.l10n_utils.gettext.codecs") - def test_multiple_lang_files_added(self, codecs_mock): - tempf = self.tempfile( - """ - {% add_lang_files "lebowski" "walter" "dude" %} - - {% block title %}El Dudarino{% endblock %} - """ - ) - codecs_mock.open.return_value = tempf - lang_files = parse_template("file/doesnt/matter.html") - assert lang_files == ["lebowski", "walter", "dude"] - - -class TestParsePython(TempFileMixin, TestCase): - @patch("lib.l10n_utils.gettext.codecs") - def test_new_lang_file_defined_list(self, codecs_mock): - """ - If `LANG_FILES` is defined as a single item list it should be returned. - """ - tempf = self.tempfile( - """ - from lib.l10n_utils.dotlang import _ - - - LANG_FILES = ['lebowski'] - - walter_says = _("Donnie you're outa your element!") - """ - ) - codecs_mock.open.return_value = tempf - lang_files = parse_python("file/doesnt/matter.py") - assert lang_files == ["lebowski"] - - @patch("lib.l10n_utils.gettext.codecs") - def test_new_multiple_lang_files_defined_list(self, codecs_mock): - """ - If `LANG_FILES` is defined as a list it should be returned. - """ - tempf = self.tempfile( - """ - from lib.l10n_utils.dotlang import _ - - - LANG_FILES = ['lebowski', 'dude'] - - walter_says = _("Donnie you're outa your element!") - """ - ) - codecs_mock.open.return_value = tempf - lang_files = parse_python("file/doesnt/matter.py") - assert lang_files == ["lebowski", "dude"] - - @patch("lib.l10n_utils.gettext.codecs") - def test_new_multiple_lang_files_multi_line(self, codecs_mock): - """ - If `LANG_FILES` is defined as a multiline list it should be returned. - """ - tempf = self.tempfile( - """ - from lib.l10n_utils.dotlang import _ - - - LANG_FILES = [ - 'lebowski', - 'dude', - ] - - walter_says = _("Donnie you're outa your element!") - """ - ) - codecs_mock.open.return_value = tempf - lang_files = parse_python("file/doesnt/matter.py") - assert lang_files == ["lebowski", "dude"] - - @patch("lib.l10n_utils.gettext.codecs") - def test_new_single_lang_file_defined(self, codecs_mock): - """ - If `LANG_FILES` is defined as a string it should be returned as a - list of length 1. - """ - tempf = self.tempfile( - """ - from lib.l10n_utils.dotlang import _ - - - LANG_FILES = 'lebowski' - - walter_says = _("I'm stayin... Finishin' my coffee.") - """ - ) - codecs_mock.open.return_value = tempf - lang_files = parse_python("file/doesnt/matter.py") - assert lang_files == ["lebowski"] - - @patch("lib.l10n_utils.gettext.codecs") - def test_new_single_lang_file_defined_dbl_quote(self, codecs_mock): - """ - If `LANG_FILES` is defined as a double quoted string it should be - returned as a list of length 1. - """ - tempf = self.tempfile( - """ - from lib.l10n_utils.dotlang import _ - - - LANG_FILES = "lebowski" - - walter_says = _("I'm stayin... Finishin' my coffee.") - """ - ) - codecs_mock.open.return_value = tempf - lang_files = parse_python("file/doesnt/matter.py") - assert lang_files == ["lebowski"] - - @patch("lib.l10n_utils.gettext.codecs") - def test_no_lang_files_defined(self, codecs_mock): - """ - If `LANG_FILES` is not defined an empty list should be returned. - """ - tempf = self.tempfile( - """ - from lib.l10n_utils.dotlang import _ - - - stuff = _('whatnot') - """ - ) - codecs_mock.open.return_value = tempf - lang_files = parse_python("file/doesnt/matter.py") - assert lang_files == [] - - -class TestLangfilesForPath(TestCase): - def test_tmpl_no_lang_files_defined(self): - """ - If no lang files are set, a lang file name derived from the template - path should be used. - """ - lang_files = langfiles_for_path("lib/l10n_utils/tests/test_files/templates/no_lang_files.html") - assert lang_files == ["no_lang_files"] - - def test_templ_lang_files_defined(self): - """If lang files are set, they should be returned.""" - lang_files = langfiles_for_path("lib/l10n_utils/tests/test_files/templates/some_lang_files.html") - assert lang_files == ["dude", "walter", "main"] - - def test_py_no_lang_files_defined(self): - """ - If `LANG_FILES` is not defined a list containing the first item in - `settings.DOTLANG_FILES` should be returned. - """ - lang_files = langfiles_for_path("lib/l10n_utils/tests/test_files/extract_me.py") - assert lang_files == [settings.DOTLANG_FILES[0]] - - def test_py_lang_files_defined(self): - """ - If `LANG_FILES` is defined a list of the values should be returned. - """ - lang_files = langfiles_for_path("lib/l10n_utils/tests/test_files/extract_me_with_langfiles.py") - assert lang_files == ["lebowski", "dude"] diff --git a/lib/l10n_utils/tests/test_helpers.py b/lib/l10n_utils/tests/test_helpers.py index 88393950b2..0bf88ece9c 100644 --- a/lib/l10n_utils/tests/test_helpers.py +++ b/lib/l10n_utils/tests/test_helpers.py @@ -23,20 +23,6 @@ def test_get_locale_hsb(): assert helpers.get_locale("hsb").language == "de" -@patch.object(helpers, "lang_file_has_tag") -class TestL10nHasTag(TestCase): - def test_uses_langfile(self, lfht_mock): - """If langfile param specified should only check that file.""" - helpers.l10n_has_tag({"langfile": "dude", "LANG": "fr"}, "abide", langfile="uli") - lfht_mock.assert_called_with("uli", "fr", "abide") - - @patch.object(helpers, "template_has_tag") - def test_checks_template_by_default(self, tht_mock, lfht_mock): - helpers.l10n_has_tag({"langfile": "dude", "template": "home.html", "LANG": "de"}, "abide") - tht_mock.assert_called_with("home.html", "de", "abide") - self.assertFalse(lfht_mock.called) - - class TestCurrentLocale(TestCase): @patch("lib.l10n_utils.templatetags.helpers.Locale") def test_unknown_locale(self, Locale): diff --git a/lib/l10n_utils/tests/test_migration.py b/lib/l10n_utils/tests/test_migration.py deleted file mode 100644 index ad464fc0b6..0000000000 --- a/lib/l10n_utils/tests/test_migration.py +++ /dev/null @@ -1,29 +0,0 @@ -# coding=utf-8 - -# 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 https://mozilla.org/MPL/2.0/. - -from django.test import TestCase - -from lib.l10n_utils.management.commands import _fluent - - -class TestTrans(TestCase): - def test_trans(self): - input = """ - {% trans %} - Just some text - {% endtrans %} - - {% trans one='value' , two=url('privacy.notices.firefox') %} - There's {{one}} and - {{ two }} things to check here. - {% endtrans %} - """ - lang_strings = [] - for trans_match in _fluent.TRANS_BLOCK_RE.finditer(input): - lang_strings.append(_fluent.trans_to_lang(trans_match["string"])) - assert len(lang_strings) == 2 - assert lang_strings[0] == "Just some text" - assert lang_strings[1] == "There's %(one)s and %(two)s things to check here." diff --git a/lib/l10n_utils/tests/test_template.py b/lib/l10n_utils/tests/test_template.py index aee9f75cc0..b52f556ed6 100644 --- a/lib/l10n_utils/tests/test_template.py +++ b/lib/l10n_utils/tests/test_template.py @@ -5,121 +5,25 @@ from pathlib import Path from django.template import TemplateDoesNotExist -from django.test import RequestFactory, override_settings +from django.test import RequestFactory -import pytest from django_jinja.backend import Jinja2 -from jinja2.nodes import Block from mock import ANY, Mock, patch -from pyquery import PyQuery as pq from bedrock.mozorg.tests import TestCase from lib.l10n_utils import render ROOT_PATH = Path(__file__).with_name("test_files") -LOCALES_PATH = ROOT_PATH / "locale" ROOT = str(ROOT_PATH) TEMPLATE_DIRS = [str(ROOT_PATH.joinpath("templates"))] jinja_env = Jinja2.get_default().env -class TestL10nBlocks(TestCase): - def test_l10n_block_locales(self): - """ - Parsing an l10n block with locales info should put that info - on the node. - """ - tree = jinja_env.parse( - """{% l10n dude locales=ru,es-ES,fr 20121212 %} - This stuff is totally translated. - {% endl10n %}""" - ) - l10n_block = tree.find(Block) - self.assertEqual(l10n_block.locales, ["ru", "es-ES", "fr"]) - self.assertEqual(l10n_block.version, 20121212) - - -@patch.object(jinja_env.loader, "searchpath", TEMPLATE_DIRS) -@override_settings( - LOCALES_PATH=LOCALES_PATH, - ROOT=ROOT, - ROOT_URLCONF="lib.l10n_utils.tests.test_files.urls", -) -class TestTransBlocks(TestCase): - def test_trans_block_works(self): - """Sanity check to make sure translations work at all.""" - response = self.client.get("/de/trans-block-reload-test/") - doc = pq(response.content) - gettext_call = doc("h1") - trans_block = doc("p") - assert gettext_call.text() == "Die Lage von Mozilla" - assert trans_block.text().startswith("Mozillas Vision des Internets ist") - - def test_trans_block_works_reload(self): - """ - Translation should work after a reload. - - bug 808580 - """ - self.test_trans_block_works() - self.test_trans_block_works() - - -@patch.object(jinja_env.loader, "searchpath", TEMPLATE_DIRS) -@override_settings( - LOCALES_PATH=LOCALES_PATH, ROOT=ROOT, ROOT_URLCONF="lib.l10n_utils.tests.test_files.urls", DOTLANG_FILES=["download_button", "main", "footer"] -) -class TestTemplateLangFiles(TestCase): - def test_added_lang_files(self): - """ - Lang files specified in the template should be added to the defaults. - """ - template = jinja_env.get_template("some_lang_files.html") - # make a dummy object capable of having arbitrary attrs assigned - request = type("request", (), {})() - template.render({"request": request}) - assert request.langfiles == ["dude", "walter", "download_button", "main", "footer"] - - @pytest.mark.skip(reason="does not pick up the files from the parent. captured in bug 797984.") - def test_added_lang_files_inheritance(self): - """ - Lang files specified in the template should be added to the defaults - and any specified in parent templates. - """ - # TODO fix this. it is broken. hence the skip. - template = jinja_env.get_template("even_more_lang_files.html") - # make a dummy object capable of having arbitrary attrs assigned - request = type("request", (), {})() - template.render(request=request) - assert request.langfiles == ["donnie", "smokey", "jesus", "dude", "walter", "main", "download_button"] - - @patch("lib.l10n_utils.settings.DEV", True) - @patch("lib.l10n_utils.templatetags.helpers.translate") - def test_lang_files_order(self, translate): - """ - Lang files should be queried in order they appear in the file, - excluding defaults and then the defaults. - """ - self.client.get("/de/some-lang-files/") - translate.assert_called_with(ANY, ["dude", "walter", "some_lang_files", "download_button", "main", "footer"]) - - @patch("lib.l10n_utils.settings.DEV", True) - @patch("lib.l10n_utils.templatetags.helpers.translate") - def test_lang_files_default_order(self, translate): - """ - The template-specific lang file should come before the defaults. - """ - self.client.get("/de/active-de-lang-file/") - translate.assert_called_with(ANY, ["inactive_de_lang_file", "active_de_lang_file", "download_button", "main", "footer"]) - - class TestNoLocale(TestCase): - @patch("lib.l10n_utils.get_l10n_path") @patch("lib.l10n_utils.django_render") - def test_render_no_locale(self, django_render, get_l10n_path): + def test_render_no_locale(self, django_render): # Our render method doesn't blow up if the request has no .locale # (can happen on 500 error path, for example) - get_l10n_path.return_value = None request = Mock(spec=object) request.path_info = "/some/path/" # Note: no .locale on request @@ -138,7 +42,7 @@ class TestLocaleTemplates(TestCase): en-US requests without l10n or locale template should render the originally requested template. """ - django_render.side_effect = [TemplateDoesNotExist(""), TemplateDoesNotExist(""), True] + django_render.side_effect = [TemplateDoesNotExist(""), True] request = self.rf.get("/") request.locale = "en-US" render(request, "firefox/new.html", {"active_locales": ["en-US"]}) @@ -149,27 +53,18 @@ class TestLocaleTemplates(TestCase): en-US requests with a locale-specific template should render the locale-specific template. """ - django_render.side_effect = [TemplateDoesNotExist(""), True] + django_render.side_effect = [True] request = self.rf.get("/") request.locale = "en-US" render(request, "firefox/new.html", {"active_locales": ["en-US"]}) django_render.assert_called_with(request, "firefox/new.en-US.html", ANY) - def test_enUS_l10n_render(self, django_render): - """ - en-US requests with an l10n template should render the l10n template. - """ - request = self.rf.get("/") - request.locale = "en-US" - render(request, "firefox/new.html", {"active_locales": ["en-US"]}) - django_render.assert_called_with(request, "en-US/templates/firefox/new.html", ANY) - def test_default_render(self, django_render): """ Non en-US requests without l10n or locale template should render the originally requested template. """ - django_render.side_effect = [TemplateDoesNotExist(""), TemplateDoesNotExist(""), True] + django_render.side_effect = [TemplateDoesNotExist(""), True] request = self.rf.get("/") request.locale = "de" render(request, "firefox/new.html", {"active_locales": ["de"]}) @@ -180,18 +75,8 @@ class TestLocaleTemplates(TestCase): Non en-US requests with a locale-specific template should render the locale-specific template. """ - django_render.side_effect = [TemplateDoesNotExist(""), True] + django_render.side_effect = [True] request = self.rf.get("/") request.locale = "es-ES" render(request, "firefox/new.html", {"active_locales": ["es-ES"]}) django_render.assert_called_with(request, "firefox/new.es-ES.html", ANY) - - def test_l10n_render(self, django_render): - """ - Non en-US requests with an l10n template should render the l10n - template. - """ - request = self.rf.get("/") - request.locale = "es-ES" - render(request, "firefox/new.html", {"active_locales": ["es-ES"]}) - django_render.assert_called_with(request, "es-ES/templates/firefox/new.html", ANY) diff --git a/lib/l10n_utils/utils.py b/lib/l10n_utils/utils.py index f74bd3d4c9..aae5cd03b6 100644 --- a/lib/l10n_utils/utils.py +++ b/lib/l10n_utils/utils.py @@ -9,25 +9,11 @@ import re from django.conf import settings from fluent.runtime import FluentResourceLoader -from fluent.syntax.ast import Message FTL_LOADER = FluentResourceLoader(f"{settings.FLUENT_LOCAL_PATH}/{{locale}}/") COMMENT_RE = re.compile(r"LANG_ID_HASH: (\w{32})") -def get_ftl_file_data(filename): - data = {} - for resources in FTL_LOADER.resources("en", [filename]): - for resource in resources: - for item in resource.body: - if isinstance(item, Message): - match = COMMENT_RE.search(item.comment.content) - if match: - data[match.group(1)] = item.id.name - - return data - - class ContainsEverything: """An object whose instances will claim to contain anything.""" diff --git a/setup.cfg b/setup.cfg index cf4b23ba37..b4af66a754 100644 --- a/setup.cfg +++ b/setup.cfg @@ -11,7 +11,6 @@ exclude= assets, static, bedrock/externalfiles/files_cache, - lib/fluent_migrations [tool:pytest] # Hiding warnings for now, the noise is making test fixes harder