Skip to content

Commit f5c98cf

Browse files
authored
Remove old L10n machinery (#10660)
1 parent 9b3353c commit f5c98cf

File tree

191 files changed

+73
-18634
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

191 files changed

+73
-18634
lines changed

.coveragerc

-2
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,6 @@ omit =
1818
tests/*
1919
venv/*
2020
wsgi/*
21-
# There are no unit tests for this dir, and it is slated for removal anyway:
22-
lib/fluent_migrations*
2321

2422
[report]
2523
exclude_lines =

.gitlab-ci.yml

-3
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,6 @@ update-l10n:
4242
- "l10n/**/*"
4343
refs:
4444
- master
45-
except:
46-
changes:
47-
- "lib/fluent_migrations/**/*"
4845
script:
4946
- bin/open-ftl-pr.sh
5047
retry: 2

.pre-commit-config.yaml

-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ exclude: >
88
| static
99
| bedrock/externalfiles/files_cache
1010
| git-repos
11-
| lib/fluent_migrations
1211
)
1312
repos:
1413
# Note: hooks that add content must run before ones which check formatting, lint, etc

bedrock/base/templates/base-protocol.html

-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
file, You can obtain one at https://mozilla.org/MPL/2.0/.
55
#}
66

7-
{% set_lang_files "main" %}
87
<!doctype html>
98
{# Note the "windows" class, without javascript platform-specific assets default to windows #}
109
<html class="windows x86 no-js" lang="{{ LANG|replace('en-US', 'en') }}" dir="{{ DIR }}" data-country-code="{{ country_code }}" data-latest-firefox="{{ latest_firefox_version }}" data-esr-versions="{{ esr_firefox_versions|join(' ') }}" {% if settings.GTM_CONTAINER_ID %}data-gtm-container-id="{{ settings.GTM_CONTAINER_ID }}"{% endif %} {% block gtm_page_id %}{% endblock %} {% if settings.STUB_ATTRIBUTION_RATE %}data-stub-attribution-rate="{{ settings.STUB_ATTRIBUTION_RATE }}"{% endif %} {% block html_attrs %}{% endblock %} {% if settings.SENTRY_FRONTEND_DSN %}data-sentry-dsn="{{ settings.SENTRY_FRONTEND_DSN }}"{% endif %}>

bedrock/base/views.py

-6
Original file line numberDiff line numberDiff line change
@@ -57,14 +57,8 @@ def get_template_names(self):
5757

5858

5959
def get_l10n_repo_info():
60-
repo = git.GitRepo(settings.LOCALES_PATH, settings.LOCALES_REPO)
6160
fluent_repo = git.GitRepo(settings.FLUENT_REPO_PATH, settings.FLUENT_REPO_URL)
6261
return (
63-
{
64-
"latest_ref": repo.current_hash,
65-
"last_updated": repo.last_updated,
66-
"repo_url": repo.clean_remote_url,
67-
},
6862
{
6963
"latest_ref": fluent_repo.current_hash,
7064
"last_updated": fluent_repo.last_updated,

bedrock/firefox/templates/firefox/set-as-default/landing.html

-26
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@
3434
{% endcall %}
3535

3636
<ul class="mzp-l-columns mzp-t-columns-three mzp-l-content mzp-t-content-lg">
37-
{% if l10n_has_tag('default-browser-012020') %}
3837
{% call picto(
3938
title=ftl('set-as-default-landing-choose-automatic-privacy'),
4039
image_url='protocol/img/icons/brand/violet/no-eye.svg',
@@ -58,31 +57,6 @@
5857
) %}
5958
<p>{{ ftl('set-as-default-landing-firefox-is-the-only') }}</p>
6059
{% endcall %}
61-
{% else %}
62-
{% call picto(
63-
title=ftl('set-as-default-landing-choose-automatic-privacy'),
64-
image_url='protocol/img/icons/brand/violet/no-eye.svg',
65-
body=true,
66-
) %}
67-
<p>{{ ftl('set-as-default-landing-the-internet-keeps') }}</p>
68-
{% endcall %}
69-
70-
{% call picto(
71-
title=ftl('set-as-default-landing-choose-freedom-on-every'),
72-
image_url='protocol/img/icons/brand/orange/devices.svg',
73-
body=true,
74-
) %}
75-
<p>{{ ftl('set-as-default-landing-firefox-is-fast-no-interest') }}</p>
76-
{% endcall %}
77-
78-
{% call picto(
79-
title=ftl('set-as-default-landing-choose-corporate-independence'),
80-
image_url='protocol/img/icons/brand/blue/mountain.svg',
81-
body=true,
82-
) %}
83-
<p>{{ ftl('set-as-default-landing-firefox-is-the-only-major') }}</p>
84-
{% endcall %}
85-
{% endif %}
8660
</ul>
8761
</main>
8862
{% endblock %}

bedrock/firefox/templates/firefox/welcome/page1.html

+2-7
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,8 @@
1919
{% set _utm_campaign = 'welcome-1-monitor' %}
2020
{% set _cta_type = 'lifecycle-monitor' %}
2121

22-
{% if l10n_has_tag('monitor_title_30102019') %}
23-
{% set hero_title = ftl('welcome-page1-stay-ahead-of-hackers-check') %}
24-
{% set _utm_content = 'stay-ahead-hackers' %}
25-
{% else %}
26-
{% set hero_title = ftl('welcome-page1-youre-on-track-to-stay-protected') %}
27-
{% set _utm_content = 'on-track-protected' %}
28-
{% endif %}
22+
{% set hero_title = ftl('welcome-page1-stay-ahead-of-hackers-check') %}
23+
{% set _utm_content = 'stay-ahead-hackers' %}
2924

3025
{% block content_intro %}
3126
{% call hero(

bedrock/firefox/views.py

+1-2
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,7 @@
4141
from bedrock.products.forms import VPNWaitlistForm
4242
from bedrock.releasenotes import version_re
4343
from lib import l10n_utils
44-
from lib.l10n_utils import L10nTemplateView
45-
from lib.l10n_utils.dotlang import get_translations_native_names
44+
from lib.l10n_utils import L10nTemplateView, get_translations_native_names
4645
from lib.l10n_utils.fluent import ftl, ftl_file_is_active
4746

4847
UA_REGEXP = re.compile(r"Firefox/(%s)" % version_re)

bedrock/foundation/templates/foundation/annualreport/2011.html

-2
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@
66

77
{% extends "base-article.html" %}
88

9-
{% add_lang_files "foundation/annualreport/2011faq" %}
10-
119
{% block page_title %}{{ _('The State of Mozilla: 2011 Annual Report') }}{% endblock %}
1210
{% block body_id %}annual-2011{% endblock %}
1311
{% block body_class %}mzp-t-mozilla{% endblock %}

bedrock/foundation/templates/foundation/annualreport/2011faq.html

-2
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@
66

77
{% extends "base-article.html" %}
88

9-
{% add_lang_files "foundation/annualreport/2011" %}
10-
119
{% block page_title %}{{ _('The State of Mozilla: 2011 Annual Report') }} | {{ _('Frequently Asked Questions') }}{% endblock %}
1210
{% block body_id %}annual-2011{% endblock %}
1311
{% block body_class %}mzp-t-mozilla{% endblock %}

bedrock/foundation/templates/foundation/annualreport/2012/faq.html

-2
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@
66

77
{% extends "base-protocol-mozilla.html" %}
88

9-
{% add_lang_files "foundation/annualreport/2012/index" %}
10-
119
{% block page_title %}{{ _('The State of Mozilla: 2012 Annual Report') }} | {{ _('Frequently Asked Questions') }}{% endblock %}
1210
{% block body_id %}annual-2012{% endblock %}
1311

bedrock/foundation/templates/foundation/annualreport/2013/faq.html

-2
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@
66

77
{% extends "base-protocol-mozilla.html" %}
88

9-
{% add_lang_files "foundation/annualreport/2013/index" %}
10-
119
{% block page_title %}{{ _('The State of Mozilla: 2013 Annual Report') }} | {{ _('Frequently Asked Questions') }}{% endblock %}
1210
{% block body_id %}annual-2013{% endblock %}
1311

bedrock/foundation/templates/foundation/annualreport/2014/faq.html

-2
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@
66

77
{% extends "base-protocol-mozilla.html" %}
88

9-
{% add_lang_files "foundation/annualreport/2014/index" %}
10-
119
{% block page_title %}{{ _('The State of Mozilla: 2014 Annual Report') }} | {{ _('Frequently Asked Questions') }}{% endblock %}
1210
{% block body_id %}annual-2014{% endblock %}
1311

bedrock/foundation/templates/foundation/annualreport/2015/faq.html

-2
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@
66

77
{% extends "base-protocol-mozilla.html" %}
88

9-
{% add_lang_files "foundation/annualreport/2015/index" %}
10-
119
{% block page_title %}{{ _('The State of Mozilla: 2015 Annual Report') }} | {{ _('Frequently Asked Questions') }}{% endblock %}
1210
{% block body_id %}annual-2015{% endblock %}
1311

bedrock/foundation/templates/foundation/annualreport/2017/index.html

+3-14
Original file line numberDiff line numberDiff line change
@@ -307,20 +307,9 @@ <h3>{{ _('Continuously building our core to fuel growth') }}</h3>
307307
{% set lockwise='https://testpilot.firefox.com/experiments/firefox-lockbox/' %}
308308
{% set lockbox=lockwise %}
309309

310-
{% if l10n_has_tag('lockwise_update_201906') %}
311-
{% trans vpn=vpn, lockwise=lockwise %}
312-
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 (<a href="{{ vpn }}">VPN</a>) service and a password manager called <a href="{{ lockwise }}">Lockwise</a> which is currently being offered for free. Over time, with deep engagement with our users, we expect to offer premium solutions.
313-
{% endtrans %}
314-
{% else %}
315-
{% trans vpn=vpn, lockbox=lockbox %}
316-
The overhaul of our core browser has given Mozilla Corporation the ability to begin the exploration
317-
of new user engagement and revenue models derived from Firefox to meet these ambitious goals.
318-
Specifically in 2018 we began testing in Firefox a new paid virtual private network
319-
(<a href="{{ vpn }}">VPN</a>) service and a password manager called <a href="{{ lockbox }}">Lockbox</a>
320-
which is currently being offered for free. Over time, with deep engagement with our users, we expect
321-
to offer premium solutions.
322-
{% endtrans %}
323-
{% endif %}
310+
{% trans vpn=vpn, lockwise=lockwise %}
311+
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 (<a href="{{ vpn }}">VPN</a>) service and a password manager called <a href="{{ lockwise }}">Lockwise</a> which is currently being offered for free. Over time, with deep engagement with our users, we expect to offer premium solutions.
312+
{% endtrans %}
324313
</p>
325314
<p>
326315
{% trans sponsored='https://blog.mozilla.org/futurereleases/2018/04/30/a-privacy-conscious-approach-to-sponsored-content/' %}

bedrock/foundation/templates/foundation/base.html

-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
file, You can obtain one at https://mozilla.org/MPL/2.0/.
55
#}
66

7-
{% set_lang_files "foundation/index" %}
87
{% extends "base-article.html" %}
98

109
{% block page_title_suffix %}{% endblock %}

bedrock/foundation/templates/foundation/trademarks/policy.html

-2
Original file line numberDiff line numberDiff line change
@@ -118,9 +118,7 @@ <h4 id="firefox-add-on">{{ _('Firefox Add-on Guidelines') }}</h4>
118118

119119
</ul>
120120

121-
{% if l10n_has_tag('trademarks-policy-0918') %}
122121
<p>{{ _(' 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”.') }}</p>
123-
{% endif %}
124122

125123
<h4 id="social-media">{{ _('Social Media Guidelines') }}</h4>
126124

bedrock/mozorg/templates/mozorg/about-base.html

-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
file, You can obtain one at https://mozilla.org/MPL/2.0/.
55
#}
66

7-
{%- set_lang_files "main" -%}
87
{% extends "base-article.html" %}
98

109
{% set navigation_bar = [

bedrock/mozorg/templates/mozorg/about/manifesto.html

-2
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,6 @@
88

99
{% extends "base-protocol-mozilla.html" %}
1010

11-
{% set_lang_files "mozorg/about/manifesto" %}
12-
1311
{% from 'macros.html' import twitter_share_url with context %}
1412

1513
{% block page_title %}{{ ftl('manifesto-details-the-mozilla-manifesto') }}{% endblock %}

bedrock/newsletter/tests/test_footer_form.py

-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212

1313

1414
@patch("bedrock.newsletter.forms.get_lang_choices", lambda *x: [["en", "English"], ["fr", "French"], ["pt", "Portuguese"]])
15-
@patch("lib.l10n_utils.translations_for_template", lambda *x: ["en-US", "fr", "pt-BR", "af"])
1615
class TestNewsletterFooter(TestCase):
1716
def setUp(self):
1817
self.view_name = "newsletter.subscribe"

bedrock/settings/base.py

-29
Original file line numberDiff line numberDiff line change
@@ -224,14 +224,9 @@ def data_path(*args):
224224
"zu",
225225
)
226226

227-
LOCALES_PATH = DATA_PATH / "locale"
228-
default_locales_repo = "www.mozilla.org" if DEV else "bedrock-l10n"
229-
default_locales_repo = "https://github.com/mozilla-l10n/{}".format(default_locales_repo)
230-
LOCALES_REPO = config("LOCALES_REPO", default=default_locales_repo)
231227
GITHUB_REPO = "https://github.com/mozilla/bedrock"
232228

233229
# Global L10n files.
234-
DOTLANG_FILES = ["main"]
235230
FLUENT_DEFAULT_FILES = [
236231
"banners/firefox-app-store",
237232
"banners/fundraising",
@@ -268,8 +263,6 @@ def data_path(*args):
268263
# remote FTL files from l10n team
269264
FLUENT_REPO_PATH,
270265
]
271-
FLUENT_MIGRATIONS = "lib.fluent_migrations"
272-
FLUENT_MIGRATIONS_PATH = ROOT_PATH / "lib" / "fluent_migrations"
273266

274267
# templates to exclude from having an "edit this page" link in the footer
275268
# these are typically ones for which most of the content is in the DB
@@ -502,22 +495,6 @@ def set_whitenoise_headers(headers, path, url):
502495

503496
ROOT_URLCONF = "bedrock.urls"
504497

505-
# Tells the extract script what files to look for L10n in and what function
506-
# handles the extraction.
507-
PUENTE = {
508-
"BASE_DIR": ROOT,
509-
"PROJECT": "Bedrock",
510-
"MSGID_BUGS_ADDRESS": "https://bugzilla.mozilla.org/enter_bug.cgi?product=www.mozilla.org&component=L10N",
511-
"DOMAIN_METHODS": {
512-
"django": [
513-
("bedrock/**.py", "lib.l10n_utils.extract.extract_python"),
514-
("bedrock/**/templates/**.html", "lib.l10n_utils.extract.extract_jinja2"),
515-
("bedrock/**/templates/**.js", "lib.l10n_utils.extract.extract_jinja2"),
516-
("bedrock/**/templates/**.jsonp", "lib.l10n_utils.extract.extract_jinja2"),
517-
],
518-
},
519-
}
520-
521498

522499
def get_app_name(hostname):
523500
"""
@@ -573,7 +550,6 @@ def get_app_name(hostname):
573550
# Third-party apps, patches, fixes
574551
"commonware.response.cookies",
575552
# L10n
576-
"puente", # for ./manage.py extract
577553
"product_details",
578554
# third-party apps
579555
"django_jinja_markdown",
@@ -652,12 +628,9 @@ def get_app_name(hostname):
652628
"watchman.checks.databases",
653629
)
654630

655-
LOCALE_PATHS = (str(LOCALES_PATH),)
656-
657631
TEMPLATES = [
658632
{
659633
"BACKEND": "django_jinja.backend.Jinja2",
660-
"DIRS": LOCALE_PATHS,
661634
"APP_DIRS": True,
662635
"OPTIONS": {
663636
"match_extension": None,
@@ -690,8 +663,6 @@ def get_app_name(hostname):
690663
"django_jinja.builtins.extensions.StaticFilesExtension",
691664
"django_jinja.builtins.extensions.DjangoFiltersExtension",
692665
"lib.l10n_utils.template.i18n",
693-
"lib.l10n_utils.template.l10n_blocks",
694-
"lib.l10n_utils.template.lang_blocks",
695666
"django_jinja_markdown.extensions.MarkdownExtension",
696667
],
697668
},

bin/compile-mo.sh

-32
This file was deleted.

0 commit comments

Comments
 (0)