sysPass 2.1.8 – Text not being translated

After some hours being lost, I discovered why sysPass translation system was not doing anything even if locale was installed.

The issue lies in setLocales (/inc/SP/Core/Language.class.php), it doesn’t set all language variable.

putenv('LANG=' . $lang);

is not enough. The following line needs to be added.

putenv('LANGUAGE=' . $lang);

It works with this but according to ubuntu help page, the value we set for LANGUAGE would not be ideal. See for yourself at https://help.ubuntu.com/community/EnvironmentVariables.

I’m guessing the difference between LANG and LANGUAGE has to do with how the combo Apache/PHP is running. I didn’t see anything that indicated setting both variables might be wrong.

I discovered the fix which works with PHP 7.1.* when I saw the comment from “yuricardenas at gmail dot com” in the PHP manual, http://php.net/manual/en/book.gettext.php.

 

 


Posted

in

, ,

by

Tags: