Removing the dialect and ISO codes from Moodle LMS language menu

You may already know that it is possible to create multilanguage Moodle sites. In fact, Moodle supports over 100 languages out of the box, and it is even possible to create new languages for Moodle. But did you know that, with most Boost-based themes starting with Moodle 3.7 and later, you can optionally customize the language name, remove the country/dialect name and the ISO code that appears after the language name to clean up the Moodle language menu?

For demonstration purposes, I installed the English (United States) (en_us) and Français (Canada) (fr_ca) language packs by going to Site Administration > Language > Language packs. Moodle was happy to comply but also installed English (en) and Français (fr). This is normal as a base language pack is required anytime you install a dialect language pack. Unfortunately, the resulting language menu ends up looking like this:

Dropdown language menu containing English (en), English (United States) (en_us) and Français (Canada) (fr_ca) and Français (fr) options.

If this happened on your Moodle site, you might be thinking “What a confusing mess!”. Who wants all the extra languages, the country names and the language codes that are likely meaningless to my student learners. Fortunately, a little-known quick fix can be made in Moodle settings.

As a Moodle Administrator, navigate to Site Administration > Language > Language Settings. Then, in the Languages on language menu field, specify a comma-separated list of the ISO language code|language names, including just the languages that should appear in the menu.

Example:

en_us|English,fr_ca|Français

Once the new setting is saved, Moodle’s language menu will now look like this:

Dropdown language menu containing English and Français options.

The result is not only cleaner looking and more user-friendly but also improves compliance with accessibility standards like WCAG 2.1. For example, users of screen readers will no longer need to listen to the country or dialect name or the ISO language code when listening to the options in the language menu.

This Moodle setting also affects the list of languages available in the user’s Preferences > User account > Preferred language page.

What multilanguage-related issues have you experienced? Share your questions, challenges and tips in the comments below.

Hope you found this information helpful.

Michael Milette

Follow me

Michael Milette

Michael Milette is the owner and an independent consultant with TNG Consulting Inc. in Canada. He works with government, non-profit organizations, businesses and educational institutions on Moodle-related projects. Michael writes about implementing Moodle LMS, developing in Moodle, Moodle administration, using the FilterCodes plugin (his own project), creating multi-language Moodle implementations and courses, and WCAG 2.1 accessibility.

One thought on “Removing the dialect and ISO codes from Moodle LMS language menu

Add a reply or comment...

%d bloggers like this: