Skip to content

Commit

Permalink
Merge pull request #958 from openeuropa/EWPP-1557
Browse files Browse the repository at this point in the history
EWPP-1557: Translate "@Date in" to Arabic and Turkish languages.
  • Loading branch information
upchuk authored Nov 10, 2021
2 parents d3309cc + 208e5f2 commit 3580a88
Show file tree
Hide file tree
Showing 32 changed files with 86 additions and 56 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,15 @@
{{ date }}
{% else %}
{% set _link %}
{% include '@ecl-twig/link' with {
{%- include '@ecl-twig/link' with {
link: {
type: 'standalone',
label: link.title,
path: link.url,
icon_position: 'after'
},
icon: get_link_icon(link.url)
} %}
} -%}
{% endset %}
{{ '@date in'|t({'@date': date }) }} {{ _link }}
{{ '@date in @journal'|t({'@date': date, '@journal': _link|create_markup}) }}
{% endif %}
14 changes: 14 additions & 0 deletions modules/oe_theme_helper/src/TwigExtension/TwigExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ public function getFilters(): array {
new TwigFilter('smart_trim', [$this, 'smartTrim'], ['needs_environment' => TRUE]),
new TwigFilter('is_external_url', [UrlHelper::class, 'isExternal']),
new TwigFilter('filter_empty', [$this, 'filterEmpty']),
new TwigFilter('create_markup', [$this, 'createMarkup']),
];
}

Expand Down Expand Up @@ -703,4 +704,17 @@ public function eclFooterLinks(array $context, array $links): array {
return $ecl_links;
}

/**
* Creates a Markup object.
*
* @param mixed $string
* The string to mark as safe. This value will be cast to a string.
*
* @return \Drupal\Component\Render\MarkupInterface
* A safe string.
*/
public function createMarkup($string): MarkupInterface {
return Markup::create($string);
}

}
9 changes: 9 additions & 0 deletions modules/oe_theme_helper/tests/src/Unit/TwigExtensionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

namespace Drupal\Tests\oe_theme_helper\Unit;

use Drupal\Component\Render\MarkupInterface;
use Drupal\Core\Language\LanguageInterface;
use Drupal\Core\Language\LanguageManagerInterface;
use Drupal\Core\Render\Renderer;
Expand Down Expand Up @@ -361,4 +362,12 @@ public function toEclIconProvider(): array {
];
}

/**
* Test that create_markup filter returns MarkupInterface object.
*/
public function testCreateMarkup() {
$markup_object = $this->extension->createMarkup('Some string');
$this->assertInstanceOf(MarkupInterface::class, $markup_object);
}

}
4 changes: 4 additions & 0 deletions modules/oe_theme_helper/translations/oe_theme_helper-ar.po
Original file line number Diff line number Diff line change
Expand Up @@ -520,8 +520,12 @@ msgstr "محتويات الصفحة"
msgid "Name"
msgstr "الاسم"

msgid "@date in @journal"
msgstr "@journal في @date"

msgid "I have read and agree with the @link"
msgstr "قرأت شر @link وأوافق عليها"

msgid "data protection terms"
msgstr "وط حماية البيانات"

4 changes: 2 additions & 2 deletions modules/oe_theme_helper/translations/oe_theme_helper-bg.po
Original file line number Diff line number Diff line change
Expand Up @@ -229,8 +229,8 @@ msgstr "Няколко крайни срока"
msgid "Permanent"
msgstr "Постоянен"

msgid "@date in"
msgstr "@date в"
msgid "@date in @journal"
msgstr "@date в @journal"

msgid "Contact us"
msgstr "За контакти"
Expand Down
4 changes: 2 additions & 2 deletions modules/oe_theme_helper/translations/oe_theme_helper-ca.po
Original file line number Diff line number Diff line change
Expand Up @@ -520,8 +520,8 @@ msgstr "Contingut de la pàgina"
msgid "Name"
msgstr "Nom"

msgid "@date in"
msgstr "@date en"
msgid "@date in @journal"
msgstr "@date en @journal"

msgid "I have read and agree with the @link"
msgstr "He llegit la @link i accepto les condicions"
Expand Down
4 changes: 2 additions & 2 deletions modules/oe_theme_helper/translations/oe_theme_helper-cs.po
Original file line number Diff line number Diff line change
Expand Up @@ -229,8 +229,8 @@ msgstr "Několik termínů"
msgid "Permanent"
msgstr "Stálý"

msgid "@date in"
msgstr "@date v"
msgid "@date in @journal"
msgstr "@date v @journal"

msgid "Contact us"
msgstr "Kontakt"
Expand Down
4 changes: 2 additions & 2 deletions modules/oe_theme_helper/translations/oe_theme_helper-da.po
Original file line number Diff line number Diff line change
Expand Up @@ -229,8 +229,8 @@ msgstr "Flere faser"
msgid "Permanent"
msgstr "Permanent"

msgid "@date in"
msgstr "@date i"
msgid "@date in @journal"
msgstr "@date i @journal"

msgid "Contact us"
msgstr "Kontakt os"
Expand Down
4 changes: 2 additions & 2 deletions modules/oe_theme_helper/translations/oe_theme_helper-de.po
Original file line number Diff line number Diff line change
Expand Up @@ -229,8 +229,8 @@ msgstr "Mehrere Enddaten"
msgid "Permanent"
msgstr "Unbefristet"

msgid "@date in"
msgstr "@date im"
msgid "@date in @journal"
msgstr "@date im @journal"

msgid "Contact us"
msgstr "Kontakt"
Expand Down
4 changes: 2 additions & 2 deletions modules/oe_theme_helper/translations/oe_theme_helper-el.po
Original file line number Diff line number Diff line change
Expand Up @@ -229,8 +229,8 @@ msgstr "Πολλές ημερομηνίες λήξης"
msgid "Permanent"
msgstr "Μόνιμος"

msgid "@date in"
msgstr "@date στην"
msgid "@date in @journal"
msgstr "@date στην @journal"

msgid "Contact us"
msgstr "Επικοινωνήστε μαζί μας"
Expand Down
4 changes: 2 additions & 2 deletions modules/oe_theme_helper/translations/oe_theme_helper-es.po
Original file line number Diff line number Diff line change
Expand Up @@ -229,8 +229,8 @@ msgstr "Múltiples fechas límite"
msgid "Permanent"
msgstr "Permanente"

msgid "@date in"
msgstr "@date en"
msgid "@date in @journal"
msgstr "@date en @journal"

msgid "Contact us"
msgstr "Contacto"
Expand Down
4 changes: 2 additions & 2 deletions modules/oe_theme_helper/translations/oe_theme_helper-et.po
Original file line number Diff line number Diff line change
Expand Up @@ -229,8 +229,8 @@ msgstr "Mitme tähtajaga"
msgid "Permanent"
msgstr "Alaline"

msgid "@date in"
msgstr "@date väljaandes"
msgid "@date in @journal"
msgstr "@date väljaandes @journal"

msgid "Contact us"
msgstr "Võtke meiega ühendust"
Expand Down
4 changes: 2 additions & 2 deletions modules/oe_theme_helper/translations/oe_theme_helper-fi.po
Original file line number Diff line number Diff line change
Expand Up @@ -229,8 +229,8 @@ msgstr "Monivaiheinen"
msgid "Permanent"
msgstr "Jatkuva"

msgid "@date in"
msgstr "@date julkaisu"
msgid "@date in @journal"
msgstr "@date julkaisu @journal"

msgid "Contact us"
msgstr "Yhteydenotot"
Expand Down
4 changes: 2 additions & 2 deletions modules/oe_theme_helper/translations/oe_theme_helper-fr.po
Original file line number Diff line number Diff line change
Expand Up @@ -229,8 +229,8 @@ msgstr "Dates limites multiples"
msgid "Permanent"
msgstr "Permanent"

msgid "@date in"
msgstr "@date au"
msgid "@date in @journal"
msgstr "@date au @journal"

msgid "Contact us"
msgstr "Nous contacter"
Expand Down
4 changes: 2 additions & 2 deletions modules/oe_theme_helper/translations/oe_theme_helper-ga.po
Original file line number Diff line number Diff line change
Expand Up @@ -229,8 +229,8 @@ msgstr "Scoitheadh ilchéimneach"
msgid "Permanent"
msgstr "Buan"

msgid "@date in"
msgstr "@date sa"
msgid "@date in @journal"
msgstr "@date sa @journal"

msgid "Contact us"
msgstr "Sonraí teagmhála"
Expand Down
4 changes: 2 additions & 2 deletions modules/oe_theme_helper/translations/oe_theme_helper-hr.po
Original file line number Diff line number Diff line change
Expand Up @@ -229,8 +229,8 @@ msgstr "Više rokova"
msgid "Permanent"
msgstr "Stalno"

msgid "@date in"
msgstr "@date,"
msgid "@date in @journal"
msgstr "@date, @journal"

msgid "Contact us"
msgstr "Kontakt"
Expand Down
4 changes: 2 additions & 2 deletions modules/oe_theme_helper/translations/oe_theme_helper-hu.po
Original file line number Diff line number Diff line change
Expand Up @@ -229,8 +229,8 @@ msgstr "Többkörös"
msgid "Permanent"
msgstr "Állandó"

msgid "@date in"
msgstr "@date,"
msgid "@date in @journal"
msgstr "@date, @journal"

msgid "Contact us"
msgstr "Kapcsolatfelvétel"
Expand Down
4 changes: 2 additions & 2 deletions modules/oe_theme_helper/translations/oe_theme_helper-is.po
Original file line number Diff line number Diff line change
Expand Up @@ -516,8 +516,8 @@ msgstr "Innihald síðu"
msgid "Name"
msgstr "Heiti"

msgid "@date in"
msgstr "@date í"
msgid "@date in @journal"
msgstr "@date í @journal"

msgid "The response period for this consultation has ended. Thank you for your input."
msgstr "Svarfrestur vegna þessarar ráðgjafar er liðinn. Takk fyrir þitt innlegg."
Expand Down
4 changes: 2 additions & 2 deletions modules/oe_theme_helper/translations/oe_theme_helper-it.po
Original file line number Diff line number Diff line change
Expand Up @@ -229,8 +229,8 @@ msgstr "In più fasiIn più fasi"
msgid "Permanent"
msgstr "Permanente"

msgid "@date in"
msgstr "@date in"
msgid "@date in @journal"
msgstr "@date in @journal"

msgid "Contact us"
msgstr "Contattaci"
Expand Down
4 changes: 2 additions & 2 deletions modules/oe_theme_helper/translations/oe_theme_helper-lt.po
Original file line number Diff line number Diff line change
Expand Up @@ -229,8 +229,8 @@ msgstr "Keli terminai"
msgid "Permanent"
msgstr "Nuolatinis"

msgid "@date in"
msgstr "@date"
msgid "@date in @journal"
msgstr "@date @journal"

msgid "Contact us"
msgstr "Susisiekite su mumis"
Expand Down
4 changes: 2 additions & 2 deletions modules/oe_theme_helper/translations/oe_theme_helper-lv.po
Original file line number Diff line number Diff line change
Expand Up @@ -229,8 +229,8 @@ msgstr "Vairāki termiņi"
msgid "Permanent"
msgstr "Pastāvīgs"

msgid "@date in"
msgstr "@date"
msgid "@date in @journal"
msgstr "@date @journal"

msgid "Contact us"
msgstr "Sazinieties ar mums"
Expand Down
4 changes: 2 additions & 2 deletions modules/oe_theme_helper/translations/oe_theme_helper-mt.po
Original file line number Diff line number Diff line change
Expand Up @@ -229,8 +229,8 @@ msgstr "Fi stadji multipli"
msgid "Permanent"
msgstr "Permanenti"

msgid "@date in"
msgstr "@date fi"
msgid "@date in @journal"
msgstr "@date fi @journal"

msgid "Contact us"
msgstr "Ikkuntattjana"
Expand Down
4 changes: 2 additions & 2 deletions modules/oe_theme_helper/translations/oe_theme_helper-nb.po
Original file line number Diff line number Diff line change
Expand Up @@ -519,8 +519,8 @@ msgstr "Sideinnhold"
msgid "Name"
msgstr "Navn"

msgid "@date in"
msgstr "@date i"
msgid "@date in @journal"
msgstr "@date i @journal"

msgid "The response period for this consultation has ended. Thank you for your input."
msgstr "Høringsfristen har utløpt. Takk for ditt bidrag."
Expand Down
4 changes: 2 additions & 2 deletions modules/oe_theme_helper/translations/oe_theme_helper-nl.po
Original file line number Diff line number Diff line change
Expand Up @@ -229,8 +229,8 @@ msgstr "Meerdere deadlines"
msgid "Permanent"
msgstr "Permanent"

msgid "@date in"
msgstr "@date in"
msgid "@date in @journal"
msgstr "@date in @journal"

msgid "Contact us"
msgstr "Contact"
Expand Down
4 changes: 2 additions & 2 deletions modules/oe_theme_helper/translations/oe_theme_helper-pl.po
Original file line number Diff line number Diff line change
Expand Up @@ -229,8 +229,8 @@ msgstr "Więcej dat zakończenia"
msgid "Permanent"
msgstr "Stały"

msgid "@date in"
msgstr "@date w"
msgid "@date in @journal"
msgstr "@date w @journal"

msgid "Contact us"
msgstr "Kontakt"
Expand Down
4 changes: 2 additions & 2 deletions modules/oe_theme_helper/translations/oe_theme_helper-pt-pt.po
Original file line number Diff line number Diff line change
Expand Up @@ -229,8 +229,8 @@ msgstr "Prazos múltiplos"
msgid "Permanent"
msgstr "Permanente"

msgid "@date in"
msgstr "@date no"
msgid "@date in @journal"
msgstr "@date no @journal"

msgid "Contact us"
msgstr "Contacte-nos"
Expand Down
4 changes: 2 additions & 2 deletions modules/oe_theme_helper/translations/oe_theme_helper-ro.po
Original file line number Diff line number Diff line change
Expand Up @@ -229,8 +229,8 @@ msgstr "Cu mai multe etape"
msgid "Permanent"
msgstr "Permanent(ă)"

msgid "@date in"
msgstr "@date în"
msgid "@date in @journal"
msgstr "@date în @journal"

msgid "Contact us"
msgstr "Contactați-ne"
Expand Down
4 changes: 2 additions & 2 deletions modules/oe_theme_helper/translations/oe_theme_helper-sk.po
Original file line number Diff line number Diff line change
Expand Up @@ -229,8 +229,8 @@ msgstr "Viacfázový"
msgid "Permanent"
msgstr "Stály"

msgid "@date in"
msgstr "@date v"
msgid "@date in @journal"
msgstr "@date v @journal"

msgid "Contact us"
msgstr "Kontakt"
Expand Down
4 changes: 2 additions & 2 deletions modules/oe_theme_helper/translations/oe_theme_helper-sl.po
Original file line number Diff line number Diff line change
Expand Up @@ -229,8 +229,8 @@ msgstr "Več končnih datumov"
msgid "Permanent"
msgstr "Stalno"

msgid "@date in"
msgstr "@date v"
msgid "@date in @journal"
msgstr "@date v @journal"

msgid "Contact us"
msgstr "Kontakt"
Expand Down
4 changes: 2 additions & 2 deletions modules/oe_theme_helper/translations/oe_theme_helper-sv.po
Original file line number Diff line number Diff line change
Expand Up @@ -229,8 +229,8 @@ msgstr "Flera tidsfrister"
msgid "Permanent"
msgstr "Ständigt pågående"

msgid "@date in"
msgstr "@date i"
msgid "@date in @journal"
msgstr "@date i @journal"

msgid "Contact us"
msgstr "Kontakta oss"
Expand Down
3 changes: 3 additions & 0 deletions modules/oe_theme_helper/translations/oe_theme_helper-tr.po
Original file line number Diff line number Diff line change
Expand Up @@ -523,6 +523,9 @@ msgstr "Sayfa İçeriği"
msgid "Name"
msgstr "İsim"

msgid "@date in @journal"
msgstr "@date tarihli @journal yayını"

msgid "I have read and agree with the @link"
msgstr "@link okudum ve kabul ediyorum"

Expand Down
2 changes: 1 addition & 1 deletion tests/src/Functional/ContentCallForProposalsRenderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ public function testProposalRendering(): void {
])->save();
$this->drupalGet($node->toUrl());

$details_expected_values['items'][2]['body'] = "12 February 2020 in Official Journal Reference";
$details_expected_values['items'][2]['body'] = "12 February 2020 in Official Journal Reference";
$field_list_assert->assertPattern($details_expected_values, $content_items[0]->getHtml());

$journal_link_selector = '//*[text() = "Publication date"]/following-sibling::dd[1]/div';
Expand Down

0 comments on commit 3580a88

Please sign in to comment.