How to add "server" locales
-
@imc67 I have narrowed down the problem atleast. Something is making the whole locale system to not work in the image.
<?php setlocale(LC_TIME, "C"); echo strftime("%A"); setlocale(LC_TIME, "fi_FI"); echo strftime(" in Finnish is %A,"); setlocale(LC_TIME, "fr_FR"); echo strftime(" in French %A and"); setlocale(LC_TIME, "de_DE"); echo strftime(" in German %A.\n"); ?>
The above code simply doesn't translate anything and everything is in english. The code works let's say in https://www.codephponline.com/ correctly.
I have to debug tomorrow as to why php is not detecting locale data properly.
-
In the base image, the locale date is clearly there.. So, it's something PHP related.
root@bc1f77223f4e:/# date Mi 10. Feb 08:53:44 UTC 2021 root@bc1f77223f4e:/# export LC_ALL=fi_FI root@bc1f77223f4e:/# date ke 10.2.2021 08.54.01 +0000 root@bc1f77223f4e:/# export LC_ALL=fr_FR root@bc1f77223f4e:/# date mer. 10 f�vr. 2021 08:54:10 UTC
-
I found the answer deep deep deep deep in the internet! Wow, I cannot remember the last time I ventured into search result page 7 and actually found it useful
https://bugs.mageia.org/show_bug.cgi?id=25411 is the issue which is reported against some rpm based distro. But effectively if modperl is installed, setlocale() in PHP does not work. Crazy! Uninstalling modperl module, does make it work.