Note: You are currently viewing documentation for Moodle 3.9. Up-to-date documentation for the latest stable version of Moodle may be available here: Language settings.

Language settings

From MoodleDocs
Revision as of 20:02, 5 December 2014 by Randy Thornton (talk | contribs)


Language selection priority

This figure shows Moodle priority when selecting languages:

Moodle language selection priority

User profile settings

A user can set their preferred language for the site in Administration > My profile settings > Edit profile.

Course administration settings

A teacher can force the language of their course in Administration > Course administration > Edit settings.

The capability moodle/site:forcelanguage may be allowed by the admin for users who need to override this language (for example, when testing problems in a course in a language they do not know.)

Site administration settings

There are a number of language settings for administrators in Administration > Site administration > Language > Language settings.

Language autodetect

By default, Moodle detects a user's language from their browser setting. However, language auto-detection may be disabled so that the default site language is used instead.

Default language

This sets the default language for the site. This setting can be overridden by users using the language menu or the setting in their user profile.

Note: If a preferred language is set in your browser then this will override the default site language (unless language auto-detection is disabled).

You can enable localised error messages for database connection problems by add the following line to your config.php file:

$CFG->lang="yourlangcode";

Display language menu

This sets whether the language menu is displayed on the login page and the home page. If this is turned off, the only places where a user can change the language setting is in their user profile or in the course settings if they are a teacher.

Languages on the language menu

If you want to limit the number of languages students and teachers can select from, enter a reduced list here. This should be in the form of the language codes separated by commas, for instance, en_us,es_mx,fr,fr_ca.


Cache language menu

The cache is automatically refreshed when you install or delete a language pack via the in-built language packs management tool. If you install a new language pack manually, you have to use Purge all caches feature to refresh the cached list.

Cache all language strings

Caches all the language strings into compiled files in the data directory.

If you are translating Moodle or changing strings in the Moodle source code then you may want to switch this off. Otherwise always leave this enabled for normal, production sites. Turning it off will force the server to go to disk to read all the language strings for each user session, which will impact performance.

Sitewide locale

Choose a sitewide locale - this will override the format and language of dates for all language packs (though names of days in calendar are not affected). You need to have this locale data installed on your operating system (eg for linux en_US.UTF-8 or es_ES.UTF-8). See for Linux locale info or for Windows server locale info.

In most cases this field should be left blank as Moodle will use the locale of the server.

Excel encoding

Leave as default (Unicode) unless you have a particular reason for wanting Latin encoding.

See also