23
Jan/093
Jan/093
Problem: PHP Gettext translation other than system language in Ubuntu
This is a note to myself: I was fooled by this problem two or three times and had to search all the times for the solution.
I tried to get NagVis work on Ubuntu with a different language than the system language. Gettext did not translate the strings. They were shown all the time in it’s key strings. There was no error message at all. After searching the problem in the PHP scripts I remembered that I needed some package the last time. So I searched for the language packages in Ubuntu. I tried to use the German translation of that application so I need the package for German language: language-pack-de. Simply installing it solves the problem:
sudo apt-get install language-pack-de








12:00 on February 6th, 2009
Hi,
I have been trying to use Gettext with my PHP pages, but got exactly the same issue: Gettext did not translate the strings. There is no error message displayed. I am using Ubuntu 8.04 and PHP 5.2.4-2.
I have checked the following:
The gettext module for php is enabled,
The language locales are present on my system (fr_FR.UTF8, en_GB.UTF8 and de_DE.UTF8),
The . mo translation files exist and are in the correct directories,
I have also installed the French and German packages using:
sudo apt-get install language-pack-de
sudo apt-get install language-pack-fr
However Gettext is still not translating my strings. It’s really driving me mad now.
Any idea of what could go wrong, or how to fix this issue?
Thanks,
Xavier
17:52 on March 4th, 2009
utiliza:
putenv(“LC_ALL=fr_FR.UTF-8″);
setlocale(LC_ALL, “fr_FR.UTF-8″);
etc.
en tu código php