|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2001-04-15 09:27 UTC] daniele at dcs dot it
I have compiled php with the following options (from
phpinfo() output):
'./configure' '--with-apxs=/usr/sbin/apxs' '--with-mysql'
'--with-zlib' '--with-config-file-path=/etc' '--with-bz2'
'--enable-ftp' '--with-gd' '--with-unixODBC'
'--enable-inline-optimization' '--with-gettext'
Always from phpinfo, i get this line:
GNU GetText Support => enabled
so, it seems gettext has been installed properly.
I have also built gettext from sources (I already had both
gettext and gettext-devel installed as RPMs), and put it
in its standard location (/usr/local).
So, I write a script like the following:
putenv ("LANG=it");
putenv ("LC_ALL=it");
bindtextdomain ("messages", "./locale");
textdomain ("messages");
echo _("welcome");
(as concernes the first two lines, I've tried out all of
the possible permutations, changing their order,
commenting the first, then the latter and so on)
then I put a valid messages.mo file in the
./locale/it/LC_MESSAGES directory, and correctly compiled
it with the command
msgfmt -f -v -o messages.mo messages.po
so, I'm sure the file is correctly compiled as the -v
option gave clear output.
In the file there is a valid replacement for "welcome":
msgid "welcome"
msgstr "benvenuto"
but the string (though it compiles without errors)
would'nt be translated.
So, the problem is this.
Good job!
Daniele
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Fri Oct 24 01:00:02 2025 UTC |
I have compiled php with the following options (from phpinfo() output): './configure' '--with-apxs=/usr/sbin/apxs' '--with-mysql' '--with-zlib' '--with-config-file-path=/etc' '--with-bz2' '--enable-ftp' '--with-gd' '--with-unixODBC' '--enable-inline-optimization' '--with-gettext' Always from phpinfo, i get this line: GNU GetText Support => enabled so, it seems gettext has been installed properly. I have also built gettext from sources (I already had both gettext and gettext-devel installed as RPMs), and put it in its standard location (/usr/local). So, I write a script like the following: putenv ("LANG=it"); putenv ("LC_ALL=it"); bindtextdomain ("messages", "./locale"); textdomain ("messages"); echo _("welcome"); (as concernes the first two lines, I've tried out all of the possible permutations, changing their order, commenting the first, then the latter and so on) then I put a valid messages.po file in the ./locale/it/LC_MESSAGES directory (I tried both with a xgettext generated and not), and correctly compiled it with the command msgfmt -f -v -o messages.mo messages.po so, I'm sure the file is correctly compiled as the -v option gave clear output. In the file there is a valid replacement for "welcome": msgid "welcome" msgstr "benvenuto" but the string (though it compiles without errors) would'nt be translated. So, the problem is this. Good job! Daniele