We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
From this code:
require_once __DIR__ . "/vendor/autoload.php"; use Gettext\Loader\PoLoader; $loader = new PoLoader(); $dir = "/app/"; $t = $loader->loadFile($dir . "languages/fr.po");
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 ( ) )
The text was updated successfully, but these errors were encountered:
The register function is not longer available.
register
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:
find
$text = $t->find(null, 'Hi'); echo $text->getTranslation();
Sorry, something went wrong.
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.
No branches or pull requests
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 ( ) )
The text was updated successfully, but these errors were encountered: