How to add "server" locales
-
@girish in the Moodle forum every question regarding this issue seemed to be solved, so it doesn’t look like there is a Moodle issue:
https://moodle.org/mod/forum/discuss.php?d=390750
I tried some of the solutions but of course get stuck on the ReadOnly situation in the app.
@imc67 said in How to add "server" locales:
@girish in the Moodle forum every question regarding this issue seemed to be solved, so it doesn’t look like there is a Moodle issue:
Correct me if I am wrong but I think there are two separate issues we are talking about here. One is there being a warning about "Your server does not support the following languages" (also reported in the forum post you linked). This is the issue you initially had and in the latest base image this should be fixed. I tried installing some language package on moodle and I did not see that warning. Are you still seeing this warning?
The second issue is calendar not being translated. I think this is a moodle issue. Atleast that's what https://tracker.moodle.org/browse/MDL-50364 is about. Do you have happen to have a bitnami install where you can check if the calendar is indeed translated. Also, to clarify, for me here only the month names are not translated. Everything else including day of the week is translated to dutch.
-
@girish in the Moodle forum every question regarding this issue seemed to be solved, so it doesn’t look like there is a Moodle issue:
https://moodle.org/mod/forum/discuss.php?d=390750
I tried some of the solutions but of course get stuck on the ReadOnly situation in the app.
@imc67 OK, I found more info here
https://github.com/bitnami/bitnami-docker-moodle/issues/120
https://docs.moodle.org/dev/Translation_FAQ#The_month_names_and_days_are_displayed_in_English._How_can_I_translate_them.3FThose do point to some Cloudron package issue after all. Let me investigate.
-
@imc67 OK, I found more info here
https://github.com/bitnami/bitnami-docker-moodle/issues/120
https://docs.moodle.org/dev/Translation_FAQ#The_month_names_and_days_are_displayed_in_English._How_can_I_translate_them.3FThose do point to some Cloudron package issue after all. Let me investigate.
@girish sorry for only sharing the end result of my search for a solution
but indeed you’ve probably followed my path as well. Hope you can find the solution?
-
@girish sorry for only sharing the end result of my search for a solution
but indeed you’ve probably followed my path as well. Hope you can find the solution?
@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
-
To make matters even more interesting, PHP CLI also works:
# php index.php Thursday in Finnish is torstai, in French jeudi and in German Donnerstag.
So, it's something in mod-php .
-
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.
-
@imc67 Great success! Can you try the new package?
-
@girish this is IT!! Wow you're the best!
BTW: Moodle is really awesome too, we're going to use it for free e-learnings about art, history and culture in our community.
-
@girish this is IT!! Wow you're the best!
BTW: Moodle is really awesome too, we're going to use it for free e-learnings about art, history and culture in our community.
wrote on Feb 11, 2021, 12:33 PM last edited by -
@girish this is IT!! Wow you're the best!
BTW: Moodle is really awesome too, we're going to use it for free e-learnings about art, history and culture in our community.