Hello,
The following message is displayed on my Language packs page. Is it bad? What should I tell the manager of my server?
Hello,
The following message is displayed on my Language packs page. Is it bad? What should I tell the manager of my server?
@Mary, @Séverin, @Germán
Thank you for your replies. I do not have the answers to your questions, but at least now, I know the issue is not trivial and I am better prepared to report it to the site administrator.
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.
Just to add to the many good messages in this thread - I had reason to update the locales on Ubuntu 18 for a server in Singapore. Three languages are running in Moodle - English (GB), Tagalog and Filipino (both get installed if you choose one of those in Moodle). The Language Customisation page was telling me that the required info was not on the server and Moodle was defaulting to AU...
To fix:
1 - log into your server with the command line, and depending on your flavour of Linux, and your permission levels (you may not need the 'sudo' bit), run:
sudo dpkg-reconfigure locales
2 - A pink screen will open asking you to select the locales that you want. Scroll through using the arrow keys, and select using the space bar all that you need... or select 'ALL' at the top of the list.
3 - hit the return key and follow the prompts (it'll ask you which you want as your default) until you are back at the command line. The system will tell you it is generating the locales:
4 - type: sudo apache2ctl restart
(again, depending on your level of privilege - you may not need to type 'sudo'... but I do)
The system will restart apache and in doing that will restart PHP too. If you then refresh the page in your Moodle you should see the error message about languages has gone.
Took me a moment or two to remember to use the 'Space' bar for making the selection on the pink page... not enough caffeine, clearly.