Closed Stephirio closed 4 years ago
The register
function is not longer available.
To use the translations in your code, you need to install gettext/translator: https://github.com/php-gettext/Translator
Similar question here: #240
If you only want to find a translation, other way is using the function find
:
$text = $t->find(null, 'Hi');
echo $text->getTranslation();
The
register
function is not longer available.To use the translations in your code, you need to install gettext/translator: https://github.com/php-gettext/Translator
Similar question here: #240
If you only want to find a translation, other way is using the function
find
:$text = $t->find(null, 'Hi'); echo $text->getTranslation();
Thank you so much.
From this code:
How can I get a translation (for example "Hi") from the $t variable? Can i register ($t->register) it or is no longer available?
$t returns me this:
Gettext\Translation Object ( [id:protected] => Hi [context:protected] => [original:protected] => Hi [plural:protected] => [translation:protected] => Salut [pluralTranslations:protected] => Array ( ) [disabled:protected] => [references:protected] => Gettext\References Object ( ) [flags:protected] => Gettext\Flags Object ( ) [comments:protected] => Gettext\Comments Object ( ) [extractedComments:protected] => Gettext\Comments Object ( ) )