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
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.