I installed the php-gettext package, and phpinfo()
shows that gettext is enabled.
My app.po looks like:
msgid "Welcome"
msgstr "Willkommen auf meiner Homepage!"
msgid "Hier you can find stuff about me."
msgstr "Hier finden Sie Informationen uber mich."`
My php file looks like:
putenv('LC_ALL=de_DE');
setlocale(LC_ALL, 'de_DE');
bindtextdomain("app", "./lang");
textdomain("app");
echo gettext("Welcome");
echo _('Hier you can find stuff about me.');
The app.mo is in ./lang/de_DE/LC_MESSAGES/
The text isn't getting translated and I'm not getting any error messages.
Have you checked if de_DE is installed as a locale?
Check it with locale -a
.
If not, generate it with locale-gen de_DE
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With