change language

19 views
Skip to first unread message

Harald bieger

unread,
Jun 20, 2016, 4:45:28 PM6/20/16
to vexim
Hello

Another question .
How is the correct way to change language of the fronted ?
I try to set in /config/i18n.php  the language corresponding to ./locale folders  no change
do i need to regenerate the *po files ? or is there another way i didnt found


thanks for advice

regards
harry

Rimas Kudelis

unread,
Jun 21, 2016, 1:05:32 AM6/21/16
to ve...@googlegroups.com
Hi Harry!

2016-06-20 23:45, Harald bieger rašė:
> Another question .
> How is the correct way to change language of the fronted ?
> I try to set in /config/i18n.php the language corresponding to
> ./locale folders no change
> do i need to regenerate the *po files ? or is there another way i
> didnt found

There are a few prerequisites for our localization to work:

1. you must have php-gettext support
2. your server must support the locale you want to use
3. you must set the $language value to the full locale name you want to
use.

I'm not exactly sure if 2 and 3 apply to all systems, or just some of
them, but they certainly do apply for Debian and Ubuntu systems.

For example, the `locales` package on my Debian server is currently
configured to support the following locales:

lt_LT.UTF-8
de_DE.UTF-8
en_US.UTF-8

and `locale -a` outputs the following list of locales supported:

# locale -a
C
C.UTF-8
de_DE.utf8
en_US.utf8
lt_LT.utf8
POSIX

With this list, if I want Vexim say in German, I have to set $language
to either "de_DE.utf8" or "de_DE.UTF-8". Meanwhile neither "de_DE", nor
"de" will not work in my case. To change the list, you probably have to
run `dpkg-reconfigure -plow locales` and check the checkbox next to the
locale you want.

This is an ugly limitation of gettext (or perhaps php-gettext
specifically), but knowing about it, achieving localized interface
becomes rather easy.

Regards,
Rimas


Rimas Kudelis

unread,
Jun 21, 2016, 1:20:31 AM6/21/16
to ve...@googlegroups.com
Hi again,

I have a small correction to make: I never realized it, but the
php-gettext package is actually NOT the one that ships gettext support
for PHP (it seems that this functionality is shipped by the core
packages). php-gettext actually provides gettext functionality
implemented in PHP and it has to be include()d or require()d from the
PHP app to be used.

Rimas

Harald bieger

unread,
Jun 22, 2016, 7:31:16 AM6/22/16
to vexim
Hello Rimas

Thanks a lot for the hint i searched for
The key is  to need  the exact spelling fo the  locale in  the  file as you told me 
My thought was  i use the  shortcuts  like DE  as the folder s in /locales suggested.
Now  it workks in correct way

Thanks a lot

regards
harry
Reply all
Reply to author
Forward
0 new messages