Thank you all,
My web administrator has now fixed the problem.
Thank you all,
My web administrator has now fixed the problem.
For the record, I had the exact same problem and took some time to fix. The issue is, even after installing locales, if Apache is not restarted, Moodle will keep saying the locales are not there. So an important step is to restart Apache after installing the locales (if you are not using Apache, restart your webserver).
BTW, I followed this guide: https://docs.moodle.org/dev/Table_of_locales
I had the same issue with the German language on a server running Ubuntu
16.04 with nginx.
The following steps on the Linux command line fixed the issue:
Thanks Sven,
Was trying to run PHP Unit on Ubuntu 20.04 and got:
Required locale 'en_AU.UTF-8' is not installed.
so:
sudo apt install language-pack-en
sudo service apache2 reload
worked for me.
Gareth
I was surprised we'd have to actually install the Linux language pack on the server in order to support a language pack in Moodle. That is a few MB each and brings not just the locales but in fact a complete translation of Linux itself. It turns out it isn't necessary. Moodle only needs the locale definition, not the Linux language pack.
On a Ubuntu 20.04 system with nginx rather than Apache, I just do:
locale-gen fr_FR.UTF-8 en_GB.UTF-8
systemctl reload nginx
systemctl reload php7.4-fpm
locale-gen generates the locale information that Moodle needs. It takes a list of locales. Without any parameter, it will generate all locales for all installed Linux language packs. Available locales are listed in /usr/share/i18n/SUPPORTED. For example, the command "grep es_ /usr/share/i18n/SUPPORTED" lists all Spanish locales. There's a catch here: when adding a "parent" language pack in Moodle (e.g. es for international Spanish), one needs to install the main locale in Linux, named with a country code (e.g. "es_ES", from Spain). Likewise, "ar" in Moodle is "ar_SA" in Linux, "fr" is "fr_FR", and so on.
Because I'm using nginx and the PHP-nginx adapter, I need to reload both services.
Thank you Benoit for sharing this useful tip.
Just to clarify, I don't think there was any intention to suggest that installing these packages is mandatory. And if you are aware of a place that claims it, it shall be fixed. It's just one of the ways to get the thing done and for many administrator, the easiest one.
localectl list-locales
dnf install glibc-langpack-ru
systemctl restart nginx systemctl restart php-fpm
Centos is still not documented in this manual, oddly.