Commit c4252942 authored by Carl Schwan's avatar Carl Schwan 🚴

Add language switcher to every pages

parent c18ed9bd
Pipeline #39000 canceled with stage
......@@ -50,8 +50,12 @@ SPDX-License-Identifier: AGPL-3.0-or-later
{% endblock %}
<link href="https://cdn.kde.org/breeze-icons/icons.css" rel="stylesheet" />
{% block hreflang %}
{% endblock %}
{% block hreflang %}
<link rel="alternate" href="https://apps.kde.org{{ path(app.request.attributes.get('_route'), app.request.attributes.get('_route_params')) }}" hreflang="en" />
{% for translation in translations %}
<link rel="alternate" href="https://apps.kde.org{{ path(app.request.attributes.get('_route'), app.request.attributes.get('_route_params')|merge({'_locale': translation})) }}" hreflang="{{ translation }}" />
{% endfor %}
{% endblock %}
</head>
<body>
<header id="KGlobalHeader" class="header clearfix">
......@@ -78,6 +82,23 @@ SPDX-License-Identifier: AGPL-3.0-or-later
<a class="nav-link text-dark" href="https://kde.org/donations">{% trans %}Donate{% endtrans %}</a>
</li>
</ul>
<ul class="navbar-nav ml-auto">
<li class="nav-item dropdown">
<a class="nav-link dropdown-toggle" href="#" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">
<img src="https://kde.org/Language-Icons/icon20x24px-exported-transparent.png" alt="" />
<span>{% trans %}Languages{% endtrans %}</span>
</a>
<div class="dropdown-menu dropdonw-trans">
{% for translation in translations %}
{% set lang = translation | language_name(translation) | capitalize %}
{% if translation == "ca_valencia" %}
{% set lang = "Valencià" %}
{% endif %}
<a class="dropdown-item" hreflang="{{ translation }}" href="{{ path(app.request.attributes.get('_route'), app.request.attributes.get('_route_params')|merge({'_locale': translation})) }}">{{ lang }}</a>
{% endfor %}
</div>
</li>
</ul>
</div>
</nav>
</header>
......@@ -88,13 +109,13 @@ SPDX-License-Identifier: AGPL-3.0-or-later
<section id="kFooterIncome" class="container">
<div id="kDonateForm">
<div class="center">
<h3>Donate to KDE <a href="/community/donations/index.php#money" target="_blank">Why Donate?</a></h3>
<h3>Donate to KDE <a href="https://kde.org/community/donations/index.php#money" target="_blank">Why Donate?</a></h3>
<form action="https://www.paypal.com/en_US/cgi-bin/webscr" method="post"
onsubmit="return amount.value >= 2 || window.confirm('Your donation is smaller than 2€. This means that most of your donation\nwill end up in processing fees. Do you want to continue?');">
<input type="hidden" name="cmd" value="_donations">
<input type="hidden" name="lc" value="GB">
<input type="hidden" name="item_name" value="Development and communication of KDE software">
<input type="hidden" name="custom" value="//kde.org//donation_box{% block donation %}{% endblock %}">
<input type="hidden" name="custom" value="https://kde.org//donation_box{% block donation %}{% endblock %}">
<input type="hidden" name="currency_code" value="EUR">
<input type="hidden" name="cbt" value="Return to kde.org">
<input type="hidden" name="return" value="https://kde.org/community/donations/thanks_paypal">
......@@ -105,7 +126,7 @@ SPDX-License-Identifier: AGPL-3.0-or-later
<button type="submit" id="donateSubmit">Donate via PayPal</button>
</form>
<a href="/community/donations/others" id="otherWaysDonate" target="_blank">Other ways to donate</a>
<a href="https://kde.org/community/donations/others" id="otherWaysDonate" target="_blank">Other ways to donate</a>
</div>
</div>
<div id="kMetaStore">
......
......@@ -14,13 +14,6 @@ SPDX-License-Identifier: AGPL-3.0-or-later
{% block canonical %}https://apps.kde.org{{ path('app_main_application_intl', {'_locale': locale, 'application': application.simplifiedId}) }}{% endblock %}
{% block donation %}#{{ name }}{% endblock %}
{% block hreflang %}
<link rel="alternate" href="https://kde.org{{ path('app_main_application_intl', {'_locale': 'en', 'application' : application.simplifiedId }) }}" hreflang="en" />
{% for translation in translations %}
<link rel="alternate" href="https://kde.org{{ path('app_main_application_intl', {'_locale': translation, 'application' : application.simplifiedId }) }}" hreflang="{{ translation }}" />
{% endfor %}
{% endblock %}
{% block body %}
<main itemscope itemtype="http://schema.org/SoftwareApplication">
<meta itemprop="operatingSystem" content="GNU/Linux"/>
......
......@@ -12,13 +12,6 @@ SPDX-License-Identifier: AGPL-3.0-or-later
{% block canonical %}https://apps.kde.org{{ path('app_main_category_intl', {'_locale': locale, 'category': category.name | lower }) }}{% endblock %}
{% block imageSize %}summary{% endblock %}
{% block hreflang %}
<link rel="alternate" href="https://kde.org{{ path('app_main_category_intl', {'_locale': "en", 'category': category.name | lower }) }}" hreflang="en" />
{% for translation in translations %}
<link rel="alternate" href="https://kde.org{{ path('app_main_category_intl', {'_locale': translation, 'category': category.name | lower }) }}" hreflang="{{ translation }}" />
{% endfor %}
{% endblock %}
{% block body %}
<main class="container">
<h1><a href="{{ path('app_main_index', {'_locale': locale}) }}">
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment