Skip to content

Commit

Permalink
WNP 129 NA + EU (fixes mozilla#14864) (mozilla#14882)
Browse files Browse the repository at this point in the history
  • Loading branch information
wen-2018 authored Jul 26, 2024
1 parent 9c344d2 commit 94fb77f
Show file tree
Hide file tree
Showing 17 changed files with 926 additions and 19 deletions.
86 changes: 86 additions & 0 deletions bedrock/firefox/templates/firefox/whatsnew/whatsnew-fx129-eu.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
{#
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 "firefox/whatsnew/base.html" %}

{% from "macros-protocol.html" import split with context %}

{% block page_title %}{{ ftl('whatsnew-page-title-v2') }}{% endblock %}

{#- This will appear as <meta property="og:description"> which can be used for social share -#}
{% block page_og_desc %}{{ ftl('whatsnew-page-description') }}{% endblock %}

{% block body_id %}firefox-whatsnew{% endblock %}

{% block page_css %}
{{ css_bundle('protocol-split') }}
{{ css_bundle('firefox_whatsnew_129_eu') }}
{% endblock %}

{% if LANG == "fr" %}
{% set main_title = 'Dites ‘Hello’ à Firefox translations (Édition Été)' %}
{% set main_tagline = 'Firefox translations débarque sur Android !' %}
{% set main_body = 'Tu peux dorénavant traduire le site web des excursions de plongée directement sur place avec Firefox. Plouf !' %}
{% set cta = 'Scanner le code QR pour démarrer' %}
{% elif LANG == "de" %}
{% set main_title = 'Sag Hola zu Firefox translations (Strand-Edition)' %}
{% set main_tagline = 'Firefox translations gibt es jetzt auch auf Android!' %}
{% set main_body = 'Du kannst bei deinem nächsten Urlaub also die Website für Schnorcheltouren direkt vor Ort in Firefox übersetzen. Blubb!' %}
{% set cta = 'Scanne den QR-Code' %}
{% elif LANG == "es-ES" %}
{% set main_title = 'Di “Hello” a Firefox translations (edición de viaje)' %}
{% set main_tagline = 'Firefox translations ya está disponible para Android.' %}
{% set main_body = 'Para que puedas traducir la web de tu tour de snorkel directamente desde Firefox… y desde la playa. ¡Glug!' %}
{% set cta = 'Escanea el código QR' %}
{% elif LANG == "it" %}
{% set main_title = 'Hola! Sono arrivate le traduzioni di Firefox (anche per mobile)' %}
{% set main_tagline = 'Firefox translations è disponibile su Android!' %}
{% set main_body = 'Ora puoi tradurre il sito delle immersioni subacquee che farai quest’estate, direttamente da Firefox e pure dalla spiaggia. Plufff!' %}
{% set cta = 'Scannerizza il QR-Code' %}
{% elif LANG == "pl" %}
{% set main_title = 'Hola! Przywitaj się z translatorem Firefoksa (wersja plażowa)' %}
{% set main_tagline = 'Funkcja Firefox translations jest teraz dostępna dla Androida!' %}
{% set main_body = 'Możesz w spokoju tłumaczyć stronki wycieczek, na które pojedziesz w te wakacje bezpośrednio w Firefoksie. Plum plum!' %}
{% set cta = 'Zeskanuj kod QR' %}
{% else %}
{% set main_title = 'Say Hola to Firefox translations (Beach Edition)' %}
{% set main_tagline = 'Firefox translations is now on Android!' %}
{% set main_body = 'So you can translate the website for snorkeling tours directly at location in Firefox. Blub!' %}
{% set cta = 'Scan the QR-Code' %}
{% endif %}

{% block site_header %}{% endblock %}
{% block wnp_content %}
<section class="wnp-content-main">
<div class="mzp-c-split mzp-l-split-body-wide mzp-l-content mzp-t-content-xl">
<div class="mzp-c-split-container">
<div class="mzp-c-split-body ">
<div class="wnp-icon-wrapper">
<svg width="51" height="45" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M45.583 44.485h4.834L39.663 19.15a2.227 2.227 0 0 0-2.046-1.356h-2.459c-.892 0-1.699.534-2.046 1.355l-5.48 12.91c-.013-.006-.015-.026-.03-.03-3.556-1.536-6.827-3.74-9.677-6.524 3.286-3.588 5.898-7.826 7.53-12.411l1.488-4.197h2.714V4.45H17.053V0h-4.449v4.449H0v4.448h22.222l-.964 2.708c-1.379 3.879-3.565 7.47-6.302 10.552-2.058-2.67-3.722-5.65-4.852-8.811H5.377l.51 1.432a36.86 36.86 0 0 0 5.866 10.537 32.113 32.113 0 0 1-8.787 5.294v4.686a36.455 36.455 0 0 0 11.753-6.7c3.286 3.23 7.067 5.775 11.18 7.542l-3.544 8.348h4.834l3.147-7.414h12.1l3.147 7.414ZM32.225 32.623l4.161-9.805 4.161 9.805h-8.322Z" fill="#312A64"/></svg>
</div>
<h1 class="mzp-u-title-md">{{ main_title }}</h1>
<p class="wnp-sub-title"><strong>{{ main_tagline }}</strong></p>
<p>{{ main_body }}</p>
</div>
<div class="mzp-c-split-media mzp-c-emphasis-box">
<div class="wnp-cta-container">
<div class="wnp-cta-image"></div>
<p class="wnp-cta-content"><strong>{{ cta }}</strong></p>
{{ picture(
url='firefox/wnp-129/qr-code.png',
optional_attributes={
'class': 'wnp-main-image',
'width': '150',
'height': '150',
"l10n": True,
}
) }}
</div>
</div>
</div>
</div>
</section>
{% endblock %}
71 changes: 71 additions & 0 deletions bedrock/firefox/templates/firefox/whatsnew/whatsnew-fx129-na.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
{#
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 "firefox/whatsnew/base.html" %}

{% block page_title %}{{ ftl('whatsnew-page-title-v2') }}{% endblock %}

{#- This will appear as <meta property="og:description"> which can be used for social share -#}
{% block page_og_desc %}{{ ftl('whatsnew-page-description') }}{% endblock %}

{% block body_id %}firefox-whatsnew{% endblock %}

{% block page_css %}
{{ css_bundle('firefox_whatsnew_129_na') }}
{% endblock %}

{% block site_header %}{% endblock %}

{% block wnp_content %}
<section class="wnp-content-main">
<div class="wnp-grid mzp-l-content mzp-t-content-lg">
<div class="wnp-grid-body">
<h1 class="wnp-main-title">Webpages, simplified.</h1>

<p class="wnp-main-tagline has-reader-icon">Click the little <strong>Reader View</strong> icon in Firefox’s address
bar, and boom. No more ads, buttons, background colors or videos. Just you and your undivided attention.</p>

<p class="cta-holder"><span></span></p>

<p class="wnp-main-cta fx-not-default">
<a class="mzp-c-button mzp-t-product" href="{{ url('firefox.set-as-default.thanks') }}" data-cta-type="button" data-cta-text="Always use Firefox">
Always use Firefox
</a>
</p>

<p class="wnp-main-cta fx-is-default">
<a class="mzp-c-button mzp-t-product" href="https://support.mozilla.org/kb/firefox-reader-view-clutter-free-web-pages" data-cta-text="Learn more" data-cta-type="button">
Learn more
</a>
</p>
</div>

<p class="wnp-sign-off">
<strong>Powered by Mozilla.</strong> Putting people before profits since 1998.
</p>

<div class="wnp-grid-head">
<div class="eyesore eyesore-one" role="presentation"><span></span></div>
</div>

<div class="wnp-grid-col1">
<div class="eyesore eyesore-two" role="presentation"></div>
<div class="eyesore eyesore-three" role="presentation"></div>
<div class="eyesore eyesore-four" role="presentation"><span></span></div>
</div>

<div class="wnp-grid-col2">
<div class="eyesore eyesore-five" role="presentation"></div>
<div class="eyesore eyesore-six" role="presentation"></div>
</div>
</div>

</section>
{% endblock %}

{% block js %}
{{ js_bundle('firefox_whatsnew_129_na') }}
{% endblock %}
78 changes: 77 additions & 1 deletion bedrock/firefox/tests/test_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -854,7 +854,83 @@ def test_fx_128_0_0_de_v3(self, render_mock):
template = render_mock.call_args[0][1]
assert template == ["firefox/whatsnew/whatsnew-fx128-eu-donate.html"]

# end 127.0 whatsnew tests
# end 128.0 whatsnew tests

# begin 129.0 whatsnew tests

@override_settings(DEV=True)
def test_fx_129_0_0_en_us(self, render_mock):
"""Should use whatsnew-fx129-na template for en-US locale"""
req = self.rf.get("/firefox/whatsnew/")
req.locale = "en-US"
self.view(req, version="129.0")
template = render_mock.call_args[0][1]
assert template == ["firefox/whatsnew/whatsnew-fx129-na.html"]

@override_settings(DEV=True)
def test_fx_129_0_0_en_ca(self, render_mock):
"""Should use whatsnew-fx129-na template for en-CA locale"""
req = self.rf.get("/firefox/whatsnew/")
req.locale = "en-CA"
self.view(req, version="129.0")
template = render_mock.call_args[0][1]
assert template == ["firefox/whatsnew/whatsnew-fx129-na.html"]

@override_settings(DEV=True)
def test_fx_129_0_0_en_gb(self, render_mock):
"""Should use whatsnew-fx129-eu template for en-GB locale"""
req = self.rf.get("/firefox/whatsnew/")
req.locale = "en-GB"
self.view(req, version="129.0")
template = render_mock.call_args[0][1]
assert template == ["firefox/whatsnew/whatsnew-fx129-eu.html"]

@override_settings(DEV=True)
def test_fx_129_0_0_fr(self, render_mock):
"""Should use whatsnew-fx129-eu template for fr locale"""
req = self.rf.get("/firefox/whatsnew/")
req.locale = "fr"
self.view(req, version="129.0")
template = render_mock.call_args[0][1]
assert template == ["firefox/whatsnew/whatsnew-fx129-eu.html"]

@override_settings(DEV=True)
def test_fx_129_0_0_de(self, render_mock):
"""Should use whatsnew-fx129-eu template for de locale"""
req = self.rf.get("/firefox/whatsnew/")
req.locale = "de"
self.view(req, version="129.0")
template = render_mock.call_args[0][1]
assert template == ["firefox/whatsnew/whatsnew-fx129-eu.html"]

@override_settings(DEV=True)
def test_fx_129_0_0_es_es(self, render_mock):
"""Should use whatsnew-fx129-eu template for es-ES locale"""
req = self.rf.get("/firefox/whatsnew/")
req.locale = "es-ES"
self.view(req, version="129.0")
template = render_mock.call_args[0][1]
assert template == ["firefox/whatsnew/whatsnew-fx129-eu.html"]

@override_settings(DEV=True)
def test_fx_129_0_0_it(self, render_mock):
"""Should use whatsnew-fx129-eu template for it locale"""
req = self.rf.get("/firefox/whatsnew/")
req.locale = "it"
self.view(req, version="129.0")
template = render_mock.call_args[0][1]
assert template == ["firefox/whatsnew/whatsnew-fx129-eu.html"]

@override_settings(DEV=True)
def test_fx_129_0_0_pl(self, render_mock):
"""Should use whatsnew-fx129-eu template for pl locale"""
req = self.rf.get("/firefox/whatsnew/")
req.locale = "pl"
self.view(req, version="129.0")
template = render_mock.call_args[0][1]
assert template == ["firefox/whatsnew/whatsnew-fx129-eu.html"]

# end 129.0 whatsnew tests


@patch("bedrock.firefox.views.l10n_utils.render", return_value=HttpResponse())
Expand Down
Loading

0 comments on commit 94fb77f

Please sign in to comment.