LocaleExtension
class LocaleExtension extends AbstractExtension (View source)
Methods
__construct(TranslatorInterface $translator, LocaleHelper $localeHelper, Config $config, string $defaultLocale)
No description
array
getFilters()
{@inheritdoc}
array
getFunctions()
{@inheritdoc}
string
getHtmlLang(Environment $twig)
No description
string
translate(string $id, array $parameters = [], $domain = null, $locale = null)
No description
Collection
getLocale(string|Collection $localeCode)
No description
Collection
getLocales(Environment $twig, Collection|null $localeCodes = null, bool $all = false)
Takes the list of codes of the locales (languages) enabled in the application and returns an array with the name of each locale written in its own language (e.g. English, Français, Español, etc.).
string
flag(string|Collection $localeCode)
No description
string
localedatetime($dateTime, string $format = '%B %e, %Y %H:%M', string|null $locale = '0')
deprecated
No description
string
localdate($dateTime, string|null $format = null, string|null $locale = null)
No description
Details
__construct(TranslatorInterface $translator, LocaleHelper $localeHelper, Config $config, string $defaultLocale)
array
getFilters()
{@inheritdoc}
array
getFunctions()
{@inheritdoc}
string
getHtmlLang(Environment $twig)
string
translate(string $id, array $parameters = [], $domain = null, $locale = null)
Collection
getLocale(string|Collection $localeCode)
Collection
getLocales(Environment $twig, Collection|null $localeCodes = null, bool $all = false)
Takes the list of codes of the locales (languages) enabled in the application and returns an array with the name of each locale written in its own language (e.g. English, Français, Español, etc.).
string
flag(string|Collection $localeCode)
string
localedatetime($dateTime, string $format = '%B %e, %Y %H:%M', string|null $locale = '0')
deprecated
deprecated