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

Fix valencia language (non standard)

parent 39171d30
Pipeline #37626 passed with stage
in 3 minutes and 15 seconds
......@@ -21,6 +21,9 @@ function import_po_files # First parameter will be a path that will contain seve
mkdir -p translations
for translation in $podir/*.po; do
lang=`basename $translation`
if [ "$lang" = "ca@valencia" ]; then
lang="ca_valencia"
do
msgattrib --translated --no-fuzzy --no-obsolete -o "translations/messages.${lang}" "$translation"
done
......
......@@ -12,12 +12,12 @@ foreach (\ResourceBundle::getLocales('') as $name) {
$localeRequirements[] = $name;
}
$container->setParameter('app.locales', implode('|', $localeRequirements));
$container->setParameter('app.locales', implode('|', $localeRequirements) . '|ca_valencia');
$container->setParameter('app.translations', [
"ca",
"ca@valencia",
"ca_valencia",
"cs",
"de",
"el",
......
......@@ -12,7 +12,7 @@ foreach (\ResourceBundle::getLocales('') as $name) {
$localeRequirements[] = $name;
}
$container->setParameter('app.locales', implode('|', $localeRequirements));
$container->setParameter('app.locales', implode('|', $localeRequirements) . '|ca_valencia');
$container->setParameter('app.translations', [
......@@ -35,11 +35,14 @@ SPDX-License-Identifier: AGPL-3.0-or-later
</li>
{% for translation in translations %}
<li class="list-inline-item">
{% set lang = translation | language_name(translation) | capitalize %}
{% if translation == "ca_valencia" %}
{% set lang = "Valencià" %}
{% endif %}
{% if locale == translation %}
{% set lang = translation | language_name(translation) | capitalize %}
<span aria-label="{% trans %}Selected language: %lang%{% endtrans %}">{{ lang }}</span>
{% else %}
<a href="{{ path('app_main_index', {'_locale': translation}) }}">{{ translation | language_name(translation) | capitalize}}</a>
<a href="{{ path('app_main_index', {'_locale': translation}) }}">{{ lang }}</a>
{% endif %}
{% if not loop.last %}
<span aria-hidden="true">|</span>
......
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