Display each locale in its own language

This commit is contained in:
Pierre Rudloff 2017-05-30 23:49:49 +02:00
parent 3ead8dd458
commit 90dc6f4478
2 changed files with 3 additions and 5 deletions

View File

@ -51,13 +51,11 @@ class Locale
/**
* Get the full name of the locale.
*
* @param Locale $displayLocale Locale to get the name in
*
* @return string
*/
public function getFullName(Locale $displayLocale)
public function getFullName()
{
return \Locale::getDisplayName($this->getIso15897(), $displayLocale->getIso15897());
return \Locale::getDisplayName($this->getIso15897(), $this->getIso15897());
}
/**

View File

@ -7,7 +7,7 @@
<ul class="locales">
{if isset($locales)}
{foreach $locales as $supportedLocale}
<li><a href="{path_for name='locale' data=['locale'=>$supportedLocale->getIso15897()]}"><span class="flag-icon flag-icon-{$supportedLocale->getIso3166()}"></span> {$supportedLocale->getFullName($locale)}</a></li>
<li><a href="{path_for name='locale' data=['locale'=>$supportedLocale->getIso15897()]}"><span class="flag-icon flag-icon-{$supportedLocale->getIso3166()}"></span> {$supportedLocale->getFullName()}</a></li>
{/foreach}
{/if}
</ul>