Can´t get Language settings to work on NGINX

Hello, We are a school in Madrid (Spain) I am inatalling Gibbon for the first time to evaluate the software and hopefully use it for our school.
The problem that I have is that no matter what language I select from system Admin/Language Settings, the software stays in English.

I have checked the locale in our server and it seems to be OK.
I have also checked the database and I can see that the default language is spanish.

Reading thru this forum, I have seen that there might be an issue with nginx. Our VPS runs with nginx, so, that might be the problem but I cannot find any discussion regarding fixing the language problem with nginx.

I would appreciate any help you can provide.

Regards,

FYI: This is my setting:

root@XXXXXXXXXX:~# locale -a
C
C.UTF-8
en_US.utf8
es_ES.utf8
POSIX
root@h2672649:~# locale
LANG=es_ES.utf8
LANGUAGE=es_ES.utf8
LC_CTYPE=“es_ES.utf8”
LC_NUMERIC=“es_ES.utf8”
LC_TIME=“es_ES.utf8”
LC_COLLATE=“es_ES.utf8”
LC_MONETARY=“es_ES.utf8”
LC_MESSAGES=“es_ES.utf8”
LC_PAPER=“es_ES.utf8”
LC_NAME=“es_ES.utf8”
LC_ADDRESS=“es_ES.utf8”
LC_TELEPHONE=“es_ES.utf8”
LC_MEASUREMENT=“es_ES.utf8”
LC_IDENTIFICATION=“es_ES.utf8”
LC_ALL=es_ES.utf8
root@XXXXXX:~#

root@h2672649:~# lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 14.04.5 LTS
Release: 14.04
Codename: trusty
root@h2672649:~#

It is not a NGINX issue. The same thing occurs for me under Apache. Language settings do not seem to take effect.

Maybe this thread might be of help: https://ask.gibbonedu.org/discussion/946/spanish-translation#latest

Sadly I’ve no experience with NGINX, but I know that @UrkoM does, and he might be able to contribute.

@fvlasie it definitely can be achieved in Apache, and in brief requires that a) relevant locales are set up (this script is useful here) and b) the gettext extension in PHP is enabled. Let me know if you need further help.

Ross

Maybe this thread might be of help: https://ask.gibbonedu.org/discussion/946/spanish-translation#latest

@fvlasie I have seen that thread but unfortunatelly It has noy been resolved there.

¿Any ideas, anyone?

@UrkoM ?

Any ideas, anyone? I want to get this SW working in spanish but unable. Please help.

I’m not familiar with nginx, but I wonder if the issue on your server is specific to Gibbon, or to any software using the same approach to translation (i.e. gettext). An example of such software would be WordPress: https://codex.wordpress.org/I18n_for_WordPress_Developers.

If you could test WordPress on your server it would shed some light as to the scope of the issue.

Thanks,

Ross

I'm not familiar with nginx, but I wonder if the issue on your server is specific to Gibbon, or to any software using the same approach to translation (i.e. gettext). An example of such software would be WordPress: https://codex.wordpress.org/I18n_for_WordPress_Developers.

If you could test WordPress on your server it would shed some light as to the scope of the issue.

Thanks,

Ross

Hello Ross,

I have several sites on the same server. Some are Wordpress, some are Joomla and a couple of prestashops and neither of them have this problem, I am able to switch languages on all of them. Gibbon in the only app that I cant get the language setup right.

More info on this:

Since I installed Gobbon on a PVS I was able to try without NGNX using plain apache as web server and the problem persisted, no spanish…

Hi amazonica,

I wonder if it’s related to a variation in locale codes and env values between different systems. It looks like the setlocale() function in PHP can be expanded to account for multiple possible formats. Perhaps look for the following lines 65-66 in src/Gibbon/Locale.php`

`putenv('LC_ALL='.$this->i18ncode);
setlocale(LC_ALL, $this->i18ncode);`
```


and replace those two lines with these ones, which includes more variations:

`putenv('LC_ALL='.$this->i18ncode.'.utf8');
putenv('LANG='.$this->i18ncode.'.utf8');
putenv('LANGUAGE='.$this->i18ncode.'.utf8');
$localeSet = setlocale(LC_ALL, $this->i18ncode.'.utf8', $this->i18ncode.'.UTF8', $this->i18ncode.'.utf-8', $this->i18ncode.'.UTF-8', $this->i18ncode);`
```


Hope this helps!

Sandra, it worked like a charm !!!..I finally got it to work in spanish !!

Thank you very much.

Glad to hear it worked! I’ve added this change to the v16 dev branch so it’ll be included in the next version.