Replace language en with en_us (and pt with pt_br)

Re: Replace language en with en_us (and pt with pt_br)

by Michael Milette -
Number of replies: 0
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers Picture of Translators
Hi Michael,

If all your pages are using {mlang en}, and you are using the Multi-Language Content (v2), then just upgrade to Moodle. Moodle 3.7 will correctly filter {mlang en} for any en_xx language. Unfortunately it no longer supports variations such as {mlang en_us} and {mlang en-us}. I just went through this with French (French fr vs french canadian fr_ca) when upgrading from Moodle 3.6 to 3.7. It was a new site so I just had a few tags that needed to be re-coded.

If you have a mix of {mlang en} and {mlang en_us} on your site, Moodle 3.6 is your friend for now. Even if your user language is set to en_us, it will correctly filter using {mlang en}, {mlang en_us} and {mlang en-us}.

With that said, you might be able to use the Moodle database search and replace tool to convert all of your {mlang en_us} into {mlang en} tags. Make sure you have a good backup of your site, or even better, try it on a local copy first.

If you prefer to just use the {mlang en_us} syntax, then the Multi-lingual Content second filter might be what you need. It works differently and may still support the {mlang en_us} syntax.

As for getting rid of the en language, that is not possible. The en_us language file is not a complete file but overlays the en language, effectively replacing certain strings. However, you can limit the language availability by specifying which languages users can switch to in the Moodle settings.

Hope you find something useful in all of this.

Best regards,

Michael
Average of ratings: Useful (3)