php-i18n Digest 21 Nov 2001 03:40:38 -0000 Issue 96
Topics (messages 223 through 230):
Re: [PHP-WIN] how to get php_gettext.dll work on windows2000 / iis5 server?
223 by: Phil Driscoll
225 by: Hace
226 by: Zak Greant
227 by: Hace
229 by: Hace
Re: how to get php_gettext.dll work on windows2000 / iis5 server?
224 by: Johan Holst Nielsen
228 by: Zak Greant
Hi Diana Look at This!! Password is 53441815
230 by: Helen
Administrivia:
To subscribe to the digest, e-mail:
[EMAIL PROTECTED]
To unsubscribe from the digest, e-mail:
[EMAIL PROTECTED]
To post to the list, e-mail:
[EMAIL PROTECTED]
----------------------------------------------------------------------
--- Begin Message ---
On Wednesday 14 November 2001 11:47 am, Hace wrote:
> Hi,
>
> I'm trying to get the gettext-function to work on Windows2000 with
> IIS5, so included the php_gettext.dll in php.ini (unmarked the ";").
>
> I get the following error if I use the php_gettext.dll extension:
>
> "PHP Warning: Unable to load dynamic library './php_gettext.dll' - The
> specified module could not be found. in Unknown on line 0 "
>
> I have placed the dll in the C:\winnt\system32\ directory and this is
> ok for other included dll's (like php_mssql.dll), but supposedly not
> for the php_gettext.dll?
>
> I assume that the message "Unknown on line 0" means that the
> php_gettext.dll 'needs' another dll to work??
>
> Does anybody have any suggestions for me to get the 'gettext' function
> to work?
You have to put the extensions dlls in the directory you set extension_dir
to in php.ini.
--
Phil Driscoll
--- End Message ---
--- Begin Message ---
On Wed, 14 Nov 2001 11:47:35 +0000, [EMAIL PROTECTED] (Phil
Driscoll) wrote:
>> Does anybody have any suggestions for me to get the 'gettext' function
>> to work?
>
>You have to put the extensions dlls in the directory you set extension_dir
>to in php.ini.
I did that already.
I have now found out that the gnu_gettext.dll was needed as well: so
the call to the gettext function now works.
However: Can someone explain to me how to create *.po files in
windows? I have tried poEdit, with which I can create a *.po file, but
I'm not sure how to add entries..
I can add entries to the *.po file using a simple text-editor like
notepad though. However: how should gettext be able to 'know' where
the *.po file is resided?
Anybody got any hints? (the gnu-gettext documentation seems to be very
unix based....)
Thanks in advance,
--
http://hace.dyndns.org/
Everything I say is my own opinion and not necessarily that of my employer.
--- End Message ---
--- Begin Message ---
On November 14, 2001 08:07 am, Hace wrote:
> On Wed, 14 Nov 2001 11:47:35 +0000, [EMAIL PROTECTED] (Phil
>
> Driscoll) wrote:
> >> Does anybody have any suggestions for me to get the 'gettext'
> >> function to work?
> >
> >You have to put the extensions dlls in the directory you set
> > extension_dir to in php.ini.
>
> I did that already.
>
> I have now found out that the gnu_gettext.dll was needed as well: so
> the call to the gettext function now works.
>
> However: Can someone explain to me how to create *.po files in
> windows? I have tried poEdit, with which I can create a *.po file,
> but I'm not sure how to add entries..
> I can add entries to the *.po file using a simple text-editor like
> notepad though. However: how should gettext be able to 'know' where
> the *.po file is resided?
>
> Anybody got any hints? (the gnu-gettext documentation seems to be
> very unix based....)
Drop by http://www.php-er.com and take a look at the chapter on
gettext.
I have written a complete overview of using gettext with PHP. It is
also Unix-centric, but it is easier to understand than the gettext
docs. : )
--
Zak Greant
PHP Quality Assurance Team
http://qa.php.net/
"We must be the change we wish to see." - M. K. Ghandi
--- End Message ---
--- Begin Message ---
On Wed, 14 Nov 2001 08:01:54 -0700, [EMAIL PROTECTED] (Zak Greant) wrote:
>Drop by http://www.php-er.com and take a look at the chapter on
>gettext.
>
>I have written a complete overview of using gettext with PHP. It is
>also Unix-centric, but it is easier to understand than the gettext
>docs. : )
Your page at:
http://www.php-er.com/chapters/Gettext_Functions.html
is very clear!
I have also completed the 'msgfmt' utility, so I have succesfully
created a "binary language file" (the .mo file from the .po file)
But.. unfortunately I still could not manage to get it work :-(
This is what I have done.
On the W2000-webserver, I've put the nl.mo file in the following
folder (directory):
[webroot]\melle\includes\translations\nl\LC_MESSAGES
so, in that directory resides the 'nl.mo' file.
I've altered your .php example to read:
=========
<HTML>
<BODY>
<?
// Bind a domain to directory
// Gettext uses domains to know what directories to
// search for translations to messages passed to gettext
bindtextdomain ('greetings', './includes/translations'); // Set the
current domain that gettext will use
textdomain ('greetings'); # Make an array
# Use the ISO two-letter codes as keys
# Use the language names as values
$iso_codes = array (
'en'=>'English',
'fr'=>'French',
'it'=>'Italian',
'pt'=>'Portuguese',
'es'=>'Spanish',
'nl'=>'Nederlands'
); foreach ($iso_codes as $iso_code => $language) {
# Set the LANGUAGE environment variable to the desired language
putenv ('LANGUAGE='.$iso_code); # Print out the language name and
greeting
# Filter the greeting through gettext
printf ("<b>%12s:</b> %s\n", $language, _("str_hello"));
}
?></BODY></HTML>
=======
I've put the above .php file in the [webroot]\melle folder.
The (wrong) output is:
English: str_hello
French: str_hello
Italian: str_hello
Portuguese: str_hello
Spanish: str_hello
Nederlands: str_hello
And, in the nl.po file, I have entered:
======
msgid ""
msgstr ""
"Project-Id-Version: \n"
"POT-Creation-Date: \n"
"PO-Revision-Date: 2001-11-14 17:11+0100\n"
"Last-Translator: Melle Koning <[EMAIL PROTECTED]>\n"
"Language-Team: <>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=utf-8\n"
"Content-Transfer-Encoding: 8bit\n"
msgid "str_hello"
msgstr "hallo"
======
So, what I expected was:
===
English: str_hello
French: str_hello
Italian: str_hello
Portuguese: str_hello
Spanish: str_hello
Nederlands: hallo
===
So this does not work!
Now, what I think could still be going wrong is that 'gettext' is
unable to find the nl.mo file, in other words gettext is unable to
find the right folder(directory)...
My question:
How should I alter:
bindtextdomain ('greetings', './includes/translations');
I have already done this:
echo bindtextdomain ('greetings', '.\includes\translations');
This returns:
C:/Inetpub/PowerPlate/melle/includes/translations
Which seems to be ok, with the difference that I guess windows wants
to have:
C:\Inetpub\PowerPlate\melle\includes\translations
(backslashes instead of forward slashes)?
Any other hints to get gettext to find the .mo files???
Thanks,
--
http://hace.dyndns.org/
Everything I say is my own opinion and not necessarily that of my employer.
--- End Message ---
--- Begin Message ---
On Wed, 14 Nov 2001 08:01:54 -0700, [EMAIL PROTECTED] (Zak Greant) wrote:
>I have written a complete overview of using gettext with PHP. It is
>also Unix-centric, but it is easier to understand than the gettext
>docs. : )
Whooaa!
I finally! got it working!
===
C:/Inetpub/PowerPlate/melle/includes/translations
English: str_hello
French: allo
Italian: str_hello
Portuguese: str_hello
Spanish: str_hello
Nederlands: hallo
===
What I had to change (back) was:
bindtextdomain ("greetings", ".\includes\translations");
Above does not work. When I changed this to:
bindtextdomain ("greetings", ".\\includes\\translations");
ALSO, I had to change the filename to be 'greetings.mo': This was NOT
clear from all the gnu-pages I read. I had named those files: nl.mo
(for dutch) and fr.mo (for french etcetera). I simply tried to change
the *.mo filename to be the same as the 'domain' and it worked...
gettext suddenly worked on windows! :-)
I provide my code and folder-structure here for other windows-users:
<?
// Bind a domain to directory
// Gettext uses domains to know what directories to
// search for translations to messages passed to gettext
bindtextdomain ("greetings", ".\\includes\\translations"); // Set the
current domain that gettext will use
textdomain ('greetings'); # Make an array
# Use the ISO two-letter codes as keys
# Use the language names as values
$iso_codes = array (
'en'=>'English',
'fr'=>'French',
'it'=>'Italian',
'pt'=>'Portuguese',
'es'=>'Spanish',
'nl'=>'Nederlands'
); foreach ($iso_codes as $iso_code => $language) {
# Set the LANGUAGE environment variable to the desired language
putenv ('LANGUAGE='.$iso_code); # Print out the language name and
greeting
# Filter the greeting through gettext
printf ("<b>%12s:</b> %s\n", $language, gettext("str_hello")) & "\n";
}
?>
In the windows-webfolder I have the following directory-structure:
==
\includes\translations
\includes\translations\en
\includes\translations\en\LC_MESSAGES
\includes\translations\en\LC_MESSAGES\greetings.po
\includes\translations\fr
\includes\translations\fr\LC_MESSAGES
\includes\translations\fr\LC_MESSAGES\greetings.mo
\includes\translations\fr\LC_MESSAGES\greetings.po
\includes\translations\it
\includes\translations\it\LC_MESSAGES
\includes\translations\it\LC_MESSAGES\greetings.po
\includes\translations\nl
\includes\translations\nl\LC_MESSAGES
\includes\translations\nl\LC_MESSAGES\greetings.mo
\includes\translations\nl\LC_MESSAGES\greetings.po
\includes\translations\pt
\includes\translations\pt\LC_MESSAGES
\includes\translations\pt\LC_MESSAGES\greetings.po
\includes\translations\sp
\includes\translations\sp\LC_MESSAGES
\includes\translations\sp\LC_MESSAGES\greetings.po
===
To get this working you will need a greetings.po file like this:
(this one is in the 'nl' subdir for dutch language:
===
msgid ""
msgstr ""
"Project-Id-Version: \n"
"POT-Creation-Date: \n"
"PO-Revision-Date: 2001-11-14 17:11+0100\n"
"Last-Translator: Melle Koning <[EMAIL PROTECTED]>\n"
"Language-Team: <>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=utf-8\n"
"Content-Transfer-Encoding: 8bit\n"
msgid "str_hello"
msgstr "hallo"
===
and you have to 'compile' this .po file to a .mo file with the
following command-line (go to 'command prompt'):
==
msgfmt -o greetings.mo greetings.po
==
To get msgfmt working on your windows machine, you will need to have
libiconv.dll, libintl.dll and msgfmt.exe in your path. What I did was
put these three files in a new c:\utils folder and than run the
command:
path=%path%;c:\utils
I hope this helps some windows-users like me to get gettext() to work
on their systems.......
Cheers,
Melle
[EMAIL PROTECTED]
--
http://hace.dyndns.org/
Everything I say is my own opinion and not necessarily that of my employer.
--- End Message ---
--- Begin Message ---
> I'm trying to get the gettext-function to work on Windows2000 with
> IIS5, so included the php_gettext.dll in php.ini (unmarked the ";").
>
> I get the following error if I use the php_gettext.dll extension:
>
> "PHP Warning: Unable to load dynamic library './php_gettext.dll' - The
> specified module could not be found. in Unknown on line 0 "
>
> I have placed the dll in the C:\winnt\system32\ directory and this is
> ok for other included dll's (like php_mssql.dll), but supposedly not
> for the php_gettext.dll?
>
> I assume that the message "Unknown on line 0" means that the
> php_gettext.dll 'needs' another dll to work??
>
> Does anybody have any suggestions for me to get the 'gettext' function
> to work?
Remember that you also need gnu_gettext.dll
http://www.php.net/manual/en/install.windows.php#install.windows.extensions
Regards,
Johan
--- End Message ---
--- Begin Message ---
On November 15, 2001 02:43 am, Hace wrote:
> On Wed, 14 Nov 2001 08:01:54 -0700, [EMAIL PROTECTED] (Zak Greant) wrote:
> >Drop by http://www.php-er.com and take a look at the chapter on
> >gettext.
> >
> >I have written a complete overview of using gettext with PHP. It is
> >also Unix-centric, but it is easier to understand than the gettext
> >docs. : )
>
> Your page at:
> http://www.php-er.com/chapters/Gettext_Functions.html
> is very clear!
I am glad that it helped you!
> I have also completed the 'msgfmt' utility, so I have succesfully
> created a "binary language file" (the .mo file from the .po file)
> But.. unfortunately I still could not manage to get it work :-(
>
...
Windows may use a different environment variable to store
language information. IIRC, you can use set from a DOS window
to see what variables have been set. Try changing LANGUAGE
to LC_ALL in your PHP code.
Also, make very sure that everything is where you expect it to be.
Check that the .mo files are in the right directory, etc.
Other than that, I can't offer much more help. Try digging around on
the web for information on gettext and win32.
Good Luck!
--
Zak Greant
PHP Quality Assurance Team
http://qa.php.net/
"We must be the change we wish to see." - M. K. Ghandi
PS. It is best to not crosspost when asking questions like this. Just
choose one mailing list - like php-i18n or php-general.
--- End Message ---
--- Begin Message ---
Hi Diana!
Look at this !
ILLEGAL Ukrainian Lolitas real hardcore Video archive
http://www.cybcity.com/kdz/index.htm
Helen.
Don't forget the password!! (53441815)
--- End Message ---