php-i18n Digest 4 Aug 2004 16:39:40 -0000 Issue 240

Topics (messages 742 through 746):

Gettext only returns english
        742 by: clouser.engr.orst.edu
        743 by: Michael Wallner
        744 by: Wil Clouser
        745 by: Michael Wallner
        746 by: Wil Clouser

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 ---
This is one of those "it could be a lot of things" problems, so I'll try to
answer as many questions as possible in this first email, but I'm sure i'll
forget something.  I'll be happy to answer follow up questions and ideas. :)

The problem is, gettext() does not translate anything for me - the text is
always returned as english.  

I've followed the excellent oreilly tutorial, as well as the one in the php
documentation.  Both come up with the same results.  

I've tried the ll and the ll_CC abbreviations.  I've tried installing the
languages into the linux system.  I've run msgfmt verbosely, but it just tells
me how many translations were written.

There are no errors in any of the logs related to gettext.

I've tried my code on three different servers (different flavors of linux, no
windows) with the same results on all.

I've looked back through the entire mailing list archives, and there have been a
few people with my problem, but there doesnt appear to be any definite causes.

Has anyone run into this before?  I've double checked all my directory
structure, etc.  Could this be a config problem?  If so, would someone mind if
I could take a look at their php/apache config?

Thanks for the ideas.

Apache version 1.3.31
PHP Version 4.3.8
Current system is Debian Linux 2.4.18, sparc64

--- End Message ---
--- Begin Message ---
Hi [EMAIL PROTECTED], you wrote:

> The problem is, gettext() does not translate anything for me - the
> text is always returned as english.

> I've tried my code on three different servers (different flavors of
> linux, no windows) with the same results on all.

> Thanks for the ideas.

Have you tried putEnv('LANG=ll'); ?

Regards,
-- 
Michael - < mike(@)php.net >

Attachment: signature.asc
Description: OpenPGP digital signature


--- End Message ---
--- Begin Message ---
Hi,

Throughout my googling for this, I came across several variables to set, and
I've tried all combinations of these with both ll and ll_CC:

putenv('LANG=$lang');
putenv('LANGUAGE=$lang');
putenv('LC_ALL=$lang');

I've also tried calling setlocale(LC_ALL,''), (I read that somewhere
online).  In fact, here is my test page.  You can see I've experimented with
a bit of stuff, and commented it out.
Page: http://micropipes.com:8080/~clouser/index.php
Source: http://micropipes.com:8080/~clouser/index.phps
Phpinfo: http://micropipes.com:8080/phpinfo.php

Sorry about the weird port number.  
Thanks for your thoughts,

Wil

Quoting Michael Wallner <[EMAIL PROTECTED]>:
> 
> Have you tried putEnv('LANG=ll'); ?
> 
> Regards,
> --
> Michael - < mike(@)php.net >
> 

--- End Message ---
--- Begin Message ---
Hi Wil Clouser, you wrote:

[...]

Ususally a composition of

setlocale(LC_ALL, 'de_DE');
putenv('LANG=de');
putenv('LANGUAGE=de');

should work...

If you've got PEAR installed try the feollowing
with File_Gettext and I18Nv2 installed:

<?php
require_once 'System.php';
require_once 'File/Gettext.php';
require_once 'I18Nv2.php';

$po = &File_Gettext::factory('PO');
$po->strings = array('one' => 'eins');
$mo = &$po->toMO();
System::mkdir('-p locales/de/LC_MESSAGES');
$mo->save('locales/de/LC_MESSAGES/myapp.mo');
unset($mo, $po);

I18Nv2::setLocale('de');

bindTextDomain('myapp', 'locales');
textDomain('myapp');

echo _('one'), "\n";
?>

Cheers,
-- 
Michael - < mike(@)php.net >

Attachment: signature.asc
Description: OpenPGP digital signature


--- End Message ---
--- Begin Message ---
Thanks for your help.

I tried combinations of the commands in the first part of your email, both
with ll and ll_CC.  Source is here:
http://micropipes.com:8080/~clouser/index.phps

And no changes.  I installed the pear modules you suggested, and they appear
to run, but again, the return is all in english.

Output page is here:
http://micropipes.com:8080/~clouser/pear.php

And the source is here:
http://micropipes.com:8080/~clouser/pear.phps

Thanks,

Wil

--- End Message ---

Reply via email to