{# Variables {like_this} are going to be formatted in javascript using the format function. It's like Python's str.format. #} {% set app_url = { amo.FIREFOX: 'http://getfirefox.com/?src=amo', amo.THUNDERBIRD: 'http://www.mozillamessaging.com/', amo.MOBILE: 'http://www.mozilla.com/m/', amo.SEAMONKEY: 'http://www.seamonkey-project.org/', }[APP] %} {% set beta_url = 'http://www.mozilla.com/firefox/beta/' %} {% macro learn_more() %} {# js vars: url #}
{% if APP == amo.FIREFOX %}

{% trans %} To install this add-on and thousands more, get Firefox, a free and open web browser from Mozilla. {% endtrans %}

{{ _('Learn more about Firefox') }}

{% trans %} or download anyway {% endtrans %}

{% elif APP == amo.THUNDERBIRD %}

{% trans %} How to Install in Thunderbird

  1. Download and save the file to your hard disk.
  2. In Mozilla Thunderbird, open Add-ons from the Tools menu.
  3. From the options button next to the add-on search field, select "Install Add-on From File..." and locate the downloaded add-on.
{% endtrans %}

{% endif %}
{% endmacro %} {% macro learn_more_personas() %}
{% if APP == amo.THUNDERBIRD %}

{% trans %} To install this Theme, get Thunderbird, a free and open source email client from Mozilla Messaging and install the Personas Plus add-on. {% endtrans %}

{{ _('Learn more about Thunderbird') }}

{% else %}

{% trans %} To install this Theme and thousands more, get Firefox, a free and open web browser from Mozilla. {% endtrans %}

{{ _('Learn more about Firefox') }}

{% endif %}
{% endmacro %} {% macro not_updated() %} {# js vars: url #}

{% trans app=APP.pretty %} This add-on has not been updated to work with your version of {{ app }}. {% endtrans %}

{{ _('Install Anyway') }}

{% endmacro %} {% macro newer_version() %} {# js vars: new_version, old_version, addon #}

{% trans app=APP.pretty %} This add-on requires a version of Firefox that has not been released yet. {% endtrans %}

{{ _('Help test new Firefox Versions') }}

{% trans app=APP.pretty %} This add-on requires {{ app }} {new_version}. You are currently using {{ app }} {old_version}. {% endtrans %}

{# L10n: {0} is an app name, like Firefox. #}

{{ _('Upgrade {0}')|f(APP.pretty) }}

{# Building a url with a fake addon that's replaced with a js placeholder? Sketchy. #}

{% trans href="/addons/versions/{addon}" %} or view older versions of this add-on. {% endtrans %}

{% endmacro %} {% macro personas_need_upgrade() %} {# js vars: old_version #}
{% set new_version = (amo.PERSONAS_THUNDERBIRD_MIN if APP == amo.THUNDERBIRD else amo.PERSONAS_FIREFOX_MIN) %}

{% trans app=APP.pretty %} This Persona requires {{ app }} {{ new_version }}. You are currently using {{ app }} {old_version}. {% endtrans %}

{# L10n: {0} is an app name, like Firefox. #}

{{ _('Upgrade {0}')|f(APP.pretty) }}

{% endmacro %} {% macro unreviewed() %} {# js vars: url, msg #}

{% trans %} Caution: This add-on has not been reviewed by Mozilla and can't be installed on release versions of Firefox 43 and above. Be careful when installing third-party software that might harm your computer. {% endtrans %}

{msg}

{% endmacro %} {% macro bad_platform() %} {# js vars: platforms #}

{% trans %} Please note: This add-on is not compatible with your operating system. {% endtrans %}

{% endmacro %} {% macro platform_link() %} {# js vars: href, msg #}
  • {msg}
  • {% endmacro %} {% macro not_compatible() %} {# js vars: reasons, url, versions_url #}

    {% trans app=APP.pretty %} This add-on is not compatible with your version of {{ app }} because of the following:{% endtrans %}

    {{ _('Install Anyway') }}

    {{ _('View other versions') }}

    {% endmacro %} {% macro not_compatible_no_reasons() %} {# js vars: reasons, url, versions_url #}

    {% trans app=APP.pretty %} This add-on is not compatible with your version of {{ app }}.{% endtrans %}

    {{ _('Install Anyway') }}

    {{ _('View other versions') }}

    {% endmacro %} {# These all go through normal Jinja templating. #} z.button.messages = { learn_more: {{ learn_more()|json|safe }}, learn_more_personas: {{ learn_more_personas()|json|safe }}, not_updated: {{ not_updated()|json|safe }}, newer_version: {{ newer_version()|json|safe }}, personas_need_upgrade: {{ personas_need_upgrade()|json|safe }}, unreviewed: {{ unreviewed()|json|safe }}, platform_link: {{ platform_link()|json|safe }}, bad_platform: {{ bad_platform()|json|safe }}, not_compatible: {{ not_compatible()|json|safe }}, not_compatible_no_reasons: {{ not_compatible_no_reasons()|json|safe }} };