Switch to symfony/translation for translations (#250)

This commit is contained in:
Pierre Rudloff 2019-11-27 23:15:49 +01:00
parent 0b1ce90f47
commit a5bd827d21
16 changed files with 399 additions and 212 deletions

View file

@ -1,4 +1,3 @@
{locale path="../i18n" domain="Alltube"}
<!doctype html>
<html {if isset($locale)}lang="{$locale->getBcp47()}"{/if}>
<head>

View file

@ -2,7 +2,7 @@
{if isset($supportedLocales) AND count($supportedLocales) > 1}
<div class="locales small-font">
<button class="localesBtn small-font" title="{t}Switch language{/t}">
{if isset($locale)}
{if isset($locale) AND $locale->getCountry()}
{$locale->getCountry()->getEmoji()}
{else}
Set language
@ -11,7 +11,16 @@
<ul class="supportedLocales">
{foreach $supportedLocales as $supportedLocale}
{if $supportedLocale != $locale}
<li><a hreflang="{$supportedLocale->getBcp47()}" lang="{$supportedLocale->getBcp47()}" href="{path_for name='locale' data=['locale'=>$supportedLocale->getIso15897()]}">{$supportedLocale->getCountry()->getEmoji()} {$supportedLocale->getFullName()|ucfirst}</a></li>
<li>
<a hreflang="{$supportedLocale->getBcp47()}"
lang="{$supportedLocale->getBcp47()}"
href="{path_for name='locale' data=['locale'=>$supportedLocale->getIso15897()]}">
{if $supportedLocale->getCountry()}
{$supportedLocale->getCountry()->getEmoji()}
{/if}
{$supportedLocale->getFullName()|ucfirst}
</a>
</li>
{/if}
{/foreach}
</ul>