Searches for a translation in the source as defined by $sourceName
(interpretation depends on concrete translation provider used).
If any arguments are provided in the $arguments array, they will be inserted
to the translated string (in place of corresponding placeholders, with
format defined by these placeholders).
If $quantity is provided, correct plural form for provided $locale will
be chosen and used to choose correct translation variant.
If no $locale is provided, default system locale will be used.
public translateByOriginalLabel ( string $originalLabel, array $arguments = [], mixed $quantity = null, |
||
$originalLabel | string | Untranslated message |
$arguments | array | An array of values to replace placeholders with |
$quantity | mixed | A number to find plural form for (float or int), NULL to not use plural forms |
$locale | Locale to use (NULL for default one) | |
$sourceName | string | Name of file with translations, base path is $packageKey/Resources/Private/Locale/Translations/ |
$packageKey | string | Key of the package containing the source file |
return | string | Translated $originalLabel or $originalLabel itself on failure |