TranslatorHelper::transChoice()

transChoice($id, $number, array $parameters = array(), $domain = 'messages', $locale = null) Parameters $id $number array $parameters $domain $locale See also TranslatorInterface::transChoice()

TranslatorHelper::trans()

trans($id, array $parameters = array(), $domain = 'messages', $locale = null) Parameters $id array $parameters $domain $locale See also TranslatorInterface::trans()

TranslatorHelper::getName()

string getName() Returns the canonical name of this helper. Return Value string The canonical name

TranslatorHelper

class TranslatorHelper extends Helper TranslatorHelper. Methods setCharset(string $charset) Sets the default charset. from Helper string getCharset() Gets the default charset. from Helper __construct(TranslatorInterface $translator) Constructor. trans($id, array $parameters = array(), $domain = 'messages', $locale = null) transChoice($id, $number, array $parameters = array(), $domain = 'messages', $locale = null) string getName() Returns the canonical name of thi

TranslatorBagInterface

interface TranslatorBagInterface TranslatorBagInterface. Methods MessageCatalogueInterface getCatalogue(string|null $locale = null) Gets the catalogue by locale. Details MessageCatalogueInterface getCatalogue(string|null $locale = null) Gets the catalogue by locale. Parameters string|null $locale The locale or null to use the default Return Value MessageCatalogueInterface Exceptions InvalidArgumentException If the locale contains invalid cha

Translator::transChoice()

string transChoice(string $id, int $number, array $parameters = array(), string|null $domain = null, string|null $locale = null) Translates the given choice message by choosing a translation according to a number. Parameters string $id The message id (may also be an object that can be cast to string) int $number The number to use to find the indice of the message array $parameters An array of parameters for the message string|null $domain The domain for the message or null to u

Translator::trans()

string trans(string $id, array $parameters = array(), string|null $domain = null, string|null $locale = null) Translates the given message. Parameters string $id The message id (may also be an object that can be cast to string) array $parameters An array of parameters for the message string|null $domain The domain for the message or null to use the default string|null $locale The locale or null to use the default Return Value string The translated string Exceptions InvalidArgum

Translator::setLocale()

setLocale(string $locale) Sets the current locale. Parameters string $locale The locale Exceptions InvalidArgumentException If the locale contains invalid characters

Translator::setFallbackLocales()

setFallbackLocales(array $locales) Sets the fallback locales. Parameters array $locales The fallback locales Exceptions InvalidArgumentException If a locale contains invalid characters

Translator::setConfigCacheFactory()

setConfigCacheFactory(ConfigCacheFactoryInterface $configCacheFactory) Sets the ConfigCache factory to use. Parameters ConfigCacheFactoryInterface $configCacheFactory