TranslatorHelper::transChoice()

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

TranslatorInterface

interface TranslatorInterface XPath expression translator interface. This component is a port of the Python cssselect library, which is copyright Ian Bicking, see https://github.com/SimonSapin/cssselect. Methods string cssToXPath(string $cssExpr, string $prefix = 'descendant-or-self::') Translates a CSS selector to an XPath expression. string selectorToXPath(SelectorNode $selector, string $prefix = 'descendant-or-self::') Translates a parsed selector node to an XPath expression.

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

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::setLocale()

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

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::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::setFallbackLocales()

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

Translator::registerExtension()

Translator registerExtension(ExtensionInterface $extension) Registers an extension. Parameters ExtensionInterface $extension Return Value Translator