Change the language

Hi everybody,

This days I’m trying to install a FreePBX, the system it’s fine but when I’m trying to change the language, the language don’t change.

I’m trying, in debian etch version have a gettext extension and I see the source and see the cookie[‘lang’] and is correctly(es_ES). I’m installing Trixbox and the language changen correctly, any solution?

Thanks to everybody.


I have the same problem on each FreePBX (either upgraded from 2.4 or fresh install)


I have found the problem regarding to the gettext function. It does need the character encoding to be able to work.

After I have changed in:



Then it is workaing now.

Another solution is to change the FREEPBX_ROOT/admin/header.php

function set_language() {
        if (extension_loaded('gettext')) {
                if (isset($_COOKIE['lang'])) {
                        setlocale(LC_ALL,  $_COOKIE['lang']);
                } else {


function set_language() {
        if (extension_loaded('gettext')) {
                if (isset($_COOKIE['lang'])) {
                        setlocale(LC_ALL,  $_COOKIE['lang'].".UTF-8");
                } else {

It took some time to find out…

Csaba Lack

The above “fix” is not the proper way to do it. Please check your systems locale so that all languages are installed.

Try this

locale -a

You should get a lot of languages listed. If not do

locale-gen hu_HU

If that does not fix is then install additional languages

apt-get install language-*-base

Thanks for everybody, my FreePBX is in Spansih!

It seems to me that on fresh install hu_HU.utf8 is the only codepage which have been installed defaultly.

#locale -a C en_US.utf8 hu_HU.utf8 POSIX

but after running

#locale-gen hu_HU Generating locales... hu_HU.ISO-8859-2... done Generation complete.

# locale -a

But hu_HU without .utf8 means iso-8859-2. The hungarian translation of Freepbx is in utf8…

I see that you have reported the issue on Ubuntu bugtracker:

That is a good starting point.

This is a comment from one of the developers that tested out different languages on his Ubuntu:

Does anyone know what should be the command that does the same thing as locale-gen but in CentOS 5.5? locale works just fine but locale-gen returns:
"-bash: locale-gen: command not found"