Migrate Mozilla home page to Fluent (Fixes #9911) [skip l10n] (#9919)

This commit is contained in:
Alex Gibson 2021-02-17 15:47:24 +00:00 коммит произвёл GitHub
Родитель 1e58bea75b
Коммит 0ec2fd964d
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
10 изменённых файлов: 204 добавлений и 67 удалений

Просмотреть файл

@ -4,8 +4,6 @@
{% extends "mozorg/home/home-en.html" %}
{% add_lang_files "mozorg/home/index-quantum" %}
{% block page_title %}Internet für Menschen, nicht für Profit{% endblock %}
{% block page_desc %}Mozilla ist die gemeinnützige Organisation hinter Firefox. Menschen sollten auch online die Kontrolle über ihr Leben haben. Dafür setzen wir uns ein.{% endblock %}

Просмотреть файл

@ -7,8 +7,6 @@
{% extends "base-protocol-mozilla.html" %}
{% add_lang_files "mozorg/home/index-quantum" %}
{% block gtm_page_id %}data-gtm-page-id="Homepage"{% endblock %}
{% block page_title %}{{ _('Internet for people, not profit') }}{% endblock %}

Просмотреть файл

@ -4,8 +4,6 @@
{% extends "mozorg/home/home-en.html" %}
{% add_lang_files "mozorg/home/index-quantum" %}
{% block page_title %}Internet est un bien commun, nous le défendons.{% endblock %}
{% block page_desc %}

Просмотреть файл

@ -6,18 +6,10 @@
{% extends "base-protocol-mozilla.html" %}
{% add_lang_files "mozorg/home/index-quantum" %}
{% block gtm_page_id %}data-gtm-page-id="Homepage"{% endblock %}
{% block page_title %}
{{ _('Internet for people, not profit') }}
{% endblock %}
{% block page_desc %}
{{ _('Did you know? Mozilla — the maker of Firefox — fights to keep the Internet a global public resource, open and
accessible to all.') }}
{% endblock %}
{% block page_title %}{{ ftl('home-internet-for-people-not-profit') }}{% endblock %}
{% block page_desc %}{{ ftl('home-did-you-know-mozilla-the-maker') }}{% endblock %}
{% block body_class %}lang-{{ LANG }}{% endblock %}
@ -59,11 +51,10 @@ accessible to all.') }}
) %}
<h2 class="c-primary-cta-logo"><img alt="Firefox" src="{{ static('protocol/img/logos/firefox/logo-word-hor.svg') }}" height="40" width="125"></h2>
<h3 class="c-primary-cta-title">{{ _('Fast for good.') }}</h3>
<h3 class="c-primary-cta-title">{{ ftl('home-fast-for-good') }}</h3>
<p class="c-primary-cta-desc">
{{ _('With 2x the speed, built-in privacy protection and Mozilla behind it, the new Firefox is the better way to
browse.') }}
{{ ftl('home-with-2x-the-speed-built-in') }}
</p>
{{ download_firefox_thanks(dom_id='download-intro', download_location='primary cta') }}
@ -71,51 +62,29 @@ accessible to all.') }}
<div class="mzp-l-content mzp-t-mozilla">
{{ billboard(
title=_('We make the internet safer, healthier and faster for good.'),
desc=_('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.'),
title=ftl('home-we-make-the-internet-safer'),
desc=ftl('home-mozilla-is-the-not-for-profit'),
image_url='img/home/dino.svg'
)}}
<section class="c-column-container">
<div class="c-column">
<div class="c-column-content">
<h2>{{ _('Our impact') }}</h2>
<p>
{% if l10n_has_tag('home-update-20171116') %}
{% trans %}
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.
{% endtrans %}
{% elif l10n_has_tag('mozorg-home-impact-health') %}
{% trans %}
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.
{% endtrans %}
{% else %}
{% trans %}
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.
{% endtrans %}
{% endif %}
</p>
<h2>{{ ftl('home-our-impact') }}</h2>
<p>{{ ftl('home-when-you-use-firefox-you-help') }}</p>
<ul class="mzp-u-list-styled">
<li>
<a class="mzp-c-cta-link" rel="external" href="https://blog.mozilla.org/blog/2017/08/08/mozilla-information-trust-initiative-building-movement-fight-misinformation-online/{{ referrals }}">{{ _('Mozilla Information Trust Initiative') }}</a>
<a class="mzp-c-cta-link" rel="external" href="https://blog.mozilla.org/blog/2017/08/08/mozilla-information-trust-initiative-building-movement-fight-misinformation-online/{{ referrals }}">{{ ftl('home-mozilla-information-trust-initiative') }}</a>
</li>
<li>
<a class="mzp-c-cta-link" rel="external" href="https://learning.mozilla.org/blog/new-partnership-with-un-women-to-teach-key-digital-skills-to-women/{{ referrals }}">{{ _('Empowering Women Online') }}</a>
<a class="mzp-c-cta-link" rel="external" href="https://learning.mozilla.org/blog/new-partnership-with-un-women-to-teach-key-digital-skills-to-women/{{ referrals }}">{{ ftl('home-empowering-women-online') }}</a>
</li>
<li>
<a class="mzp-c-cta-link" rel="external" href="https://blog.mozilla.org/blog/2017/09/06/mozilla-washington-post-reinventing-online-comments/{{ referrals }}">{{ _('The Coral Project') }}</a>
<a class="mzp-c-cta-link" rel="external" href="https://blog.mozilla.org/blog/2017/09/06/mozilla-washington-post-reinventing-online-comments/{{ referrals }}">{{ ftl('home-the-coral-project') }}</a>
</li>
<li>
<a class="mzp-c-cta-link" rel="external" href="https://internethealthreport.org/{{ referrals }}">{{ _('Read our Internet Health Report') }}</a>
<a class="mzp-c-cta-link" rel="external" href="https://internethealthreport.org/{{ referrals }}">{{ ftl('home-read-our-internet-health-report') }}</a>
</li>
</ul>
</div>
@ -123,21 +92,17 @@ accessible to all.') }}
<div class="c-column">
<div class="c-column-content">
<h2>{{ _('Our innovations') }}</h2>
<h2>{{ ftl('home-our-innovations') }}</h2>
<p>
{% trans %}
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.
{% endtrans %}
{{ ftl('home-using-the-web-as-the-platform') }}
</p>
<ul class="mzp-u-list-styled">
<li>
<a class="mzp-c-cta-link" rel="external" href="https://voice.mozilla.org/{{ referrals }}">{{ _('Common Voice') }}</a>
<a class="mzp-c-cta-link" rel="external" href="https://voice.mozilla.org/{{ referrals }}">{{ ftl('home-common-voice') }}</a>
</li>
<li>
<a class="mzp-c-cta-link" rel="external" href="https://vr.mozilla.org/{{ referrals }}">{{ _('Virtual Reality Platform') }}</a>
<a class="mzp-c-cta-link" rel="external" href="https://vr.mozilla.org/{{ referrals }}">{{ ftl('home-virtual-reality-platform') }}</a>
</li>
<li>
<a class="mzp-c-cta-link" rel="external" href="https://research.mozilla.org/servo-engines/{{ referrals }}">{{ _('Servo') }}</a>
@ -157,10 +122,10 @@ accessible to all.') }}
custom_desc=True,
class='extensions') %}
<a class="mzp-c-cta-link" rel="external" href="https://addons.mozilla.org/{{ referrals }}">
<h2 class="mzp-c-card-picto-title">{{ _('Extensions') }}</h2>
<h2 class="mzp-c-card-picto-title">{{ ftl('home-extensions') }}</h2>
</a>
<p class="mzp-c-card-picto-desc">
{{ _('Personalize Firefox with your favorite extras like password managers, ad blockers and more.') }}
{{ ftl('home-personalize-firefox-with-your') }}
</p>
{% endcall %}
</li>
@ -169,10 +134,10 @@ accessible to all.') }}
custom_desc=True,
class='careers') %}
<a class="mzp-c-cta-link" rel="external" href="https://careers.mozilla.org/{{ referrals }}">
<h2 class="mzp-c-card-picto-title">{{ _('Careers') }}</h2>
<h2 class="mzp-c-card-picto-title">{{ ftl('home-careers') }}</h2>
</a>
<p class="mzp-c-card-picto-desc">
{{ _('Learn about the benefits of working at Mozilla and view open positions around the world.') }}
{{ ftl('home-learn-about-the-benefits-of') }}
</p>
{% endcall %}
</li>
@ -181,10 +146,10 @@ accessible to all.') }}
custom_desc=True,
class='help') %}
<a class="mzp-c-cta-link" rel="external" href="https://support.mozilla.org/{{ referrals }}">
<h2 class="mzp-c-card-picto-title">{{ _('Need help?') }}</h2>
<h2 class="mzp-c-card-picto-title">{{ ftl('home-need-help') }}</h2>
</a>
<p class="mzp-c-card-picto-desc">
{{ _('Get answers to your questions about Firefox and all Mozilla products from our support team.') }}
{{ ftl('home-get-answers-to-your-questions') }}
</p>
{% endcall %}
</li>
@ -200,7 +165,7 @@ accessible to all.') }}
{{ email_newsletter_form(
newsletters='mozilla-and-you',
button_class='button-dark',
submit_text=_('Sign up now')
submit_text=ftl('home-sign-up-now')
)}}
</div>
</aside>

Просмотреть файл

@ -4,8 +4,6 @@
{% extends "base-protocol-mozilla.html" %}
{% add_lang_files "mozorg/moss/index" %}
{% block page_title %}{{ _('Mozilla Open Source Support') }}{% endblock %}
{% block page_title_suffix %}{% endblock %}

Просмотреть файл

@ -119,7 +119,9 @@ def home_view(request):
donate_params['preset_list'] = donate_params['presets'].split(',')
ctx = {
'donate_params': donate_params,
'pocket_articles': PocketArticle.objects.all()[:4]
'pocket_articles': PocketArticle.objects.all()[:4],
'ftl_files': ['mozorg/home'],
'add_active_locales': ['de', 'fr']
}
if locale.startswith('en-'):

Просмотреть файл

@ -161,6 +161,9 @@ locales = [
[[paths]]
reference = "en/mozorg/contribute.ftl"
l10n = "{locale}/mozorg/contribute.ftl"
[[paths]]
reference = "en/mozorg/home.ftl"
l10n = "{locale}/mozorg/home.ftl"
[[paths]]
reference = "en/mozorg/mission.ftl"
l10n = "{locale}/mozorg/mission.ftl"

30
l10n/en/mozorg/home.ftl Normal file
Просмотреть файл

@ -0,0 +1,30 @@
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
### URL: https://www-dev.allizom.org/ ('en-US', 'en-CA', 'en-GB', 'de' and 'fr' excluded)
home-internet-for-people-not-profit = Internet for people, not profit
home-did-you-know-mozilla-the-maker = Did you know? { -brand-name-mozilla } — the maker of { -brand-name-firefox } — fights to keep the internet a global public resource, open and accessible to all.
home-fast-for-good = Fast for good.
home-with-2x-the-speed-built-in = With 2x the speed, built-in privacy protection and { -brand-name-mozilla } behind it, the new { -brand-name-firefox } is the better way to browse.
home-we-make-the-internet-safer = We make the internet safer, healthier and faster for good.
home-mozilla-is-the-not-for-profit = { -brand-name-mozilla } is the not-for-profit behind { -brand-name-firefox }, the original alternative browser. We create products and policy to keep the internet in service of people, not profit.
home-our-impact = Our impact
home-when-you-use-firefox-you-help = When you use { -brand-name-firefox }, you help { -brand-name-mozilla } fight misinformation online, teach digital skills and make the comments section more human. Check out what helps create a healthier internet.
home-working-to-keep-the-internet = 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 = 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.
home-mozilla-information-trust-initiative = { -brand-name-mozilla } Information Trust Initiative
home-empowering-women-online = Empowering Women Online
home-the-coral-project = The Coral Project
home-read-our-internet-health-report = Read our Internet Health Report
home-our-innovations = Our innovations
home-using-the-web-as-the-platform = 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 = Virtual Reality Platform
home-common-voice = { -brand-name-common-voice }
home-extensions = Extensions
home-personalize-firefox-with-your = Personalize { -brand-name-firefox } with your favorite extras like password managers, ad blockers and more.
home-careers = Careers
home-learn-about-the-benefits-of = Learn about the benefits of working at { -brand-name-mozilla } and view open positions around the world.
home-need-help = Need help?
home-get-answers-to-your-questions = Get answers to your questions about { -brand-name-firefox } and all { -brand-name-mozilla } products from our support team.

Просмотреть файл

Просмотреть файл

@ -0,0 +1,145 @@
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
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"),
}
)
),
]
)