ThisCalculator

Everyday

Change MediaWiki Interface Language: Step-by-Step

Updated · Standard formula, shown below

Change MediaWiki Interface Language: Step-by-Step

This guide shows you how to change the interface language in MediaWiki—the language of menus, buttons, and system messages—for individual users or for the entire wiki. You’ll need administrator access to change the site-wide default; for personal changes, a logged-in account is sufficient.

What You’ll Need

  • Access to your MediaWiki installation’s files (via FTP or file manager) if you need to change the site-wide default.
  • Administrator (sysop) rights on the wiki if you want to change settings via LocalSettings.php.
  • A list of supported language codes (e.g., en, fr, de, es, ja). You can find them in the languages folder of your MediaWiki installation or online.

Step-by-Step

For Individual Users (Logged-In)

  1. Log in to your MediaWiki account.
  2. Click on Preferences in the top-right corner (next to your username).
  3. In the User profile tab, find the Language section.
  4. Select your preferred language from the dropdown menu. The list shows language names in their own language (e.g., “Deutsch� for German).
  5. Click Save at the bottom of the page. The interface will now display in your chosen language.

For Anonymous Visitors (Not Logged In)

  1. Anonymous users can change the interface language temporarily by adding ?uselang=xx to the URL, where xx is the language code (e.g., ?uselang=fr).
  2. This change lasts only for the current session; closing the browser reverts to the default.

Site-Wide Default (Requires File Access)

  1. Open the LocalSettings.php file in the root directory of your MediaWiki installation using a text editor.
  2. Add or modify the line: $wgLanguageCode = "fr"; (replace fr with your desired language code).
  3. Save the file and upload it back to the server if you edited locally.
  4. Clear any server-side caches (e.g., opcache, Memcached) if you use them.
  5. Refresh your wiki’s main page. The interface should now appear in the new language for all visitors.

Using the Language Selector Extension (Optional)

  1. If you want a visible language selector on every page, install the UniversalLanguageSelector extension.
  2. Download the extension from the MediaWiki extension repository and place it in the extensions folder.
  3. Add wfLoadExtension( 'UniversalLanguageSelector' ); to LocalSettings.php.
  4. Save and reload. A language icon will appear in the personal tools area, allowing users to switch languages quickly.

Common Mistakes

  • Using the wrong language code: Codes are case-sensitive and follow ISO 639. For example, en for English, de for German, zh for Chinese. Using eng or ger will not work.
  • Editing the wrong file: Some users accidentally edit LocalSettings.php in a backup folder or the default MediaWiki directory instead of the active installation.
  • Forgetting to clear caches: Browser or server caches can keep showing the old language for a while.
  • Changing the language but not the content: The interface language is separate from page content. Changing the interface does not translate articles.

Tips

  • Test the change on a staging site first if you’re altering the site-wide default.
  • Use the ?uselang= parameter to preview a language before committing to it site-wide.
  • If you’re running a multilingual wiki, consider installing the Translate extension to manage content translation alongside the interface.
  • Keep a backup of LocalSettings.php before making changes.

Troubleshooting

  • Interface still in English after changing $wgLanguageCode: Check that you edited the correct LocalSettings.php. Verify the line is not commented out (no # at the start). Clear the server cache and your browser cache.
  • Language dropdown in Preferences is missing: This can happen if the UniversalLanguageSelector extension is not installed, but the default preferences should still show a language field. If it’s missing, check that your MediaWiki version is up to date.
  • Error “Language code not supportedâ€�: Ensure the language code is valid. Check the languages folder for available files (e.g., MessagesFr.php for French).
  • Some interface messages remain in English: Not all messages are translated in every language. This is normal; you can contribute translations on translatewiki.net.
  • After changing the language, the wiki breaks: This usually indicates a syntax error in LocalSettings.php. Revert to the backup and re-apply changes carefully.

Frequently Asked Questions

Can I set different languages for different users?

Yes, each logged-in user can set their own language in their preferences, overriding the site default.

Will changing the interface language translate the content of my pages?

No. The interface language only affects system messages, menus, and buttons. Page content remains as written. To translate content, you need the Translate extension or manual translation.

How do I find the language code for my language?

Language codes are ISO 639-1 two-letter codes (e.g., en, fr, de). For less common languages, check the languages folder in your MediaWiki installation for the corresponding Messages*.php file.

What if my language is not listed in the Preferences dropdown?

This usually means the language is not installed. You can download the language file from the MediaWiki repository and place it in the languages folder, then re-run the installer or update the configuration.

Can I change the language without editing files?

Yes, for individual users, you can use the Preferences page. For site-wide changes, you need file access or the use of the ?uselang= parameter for temporary changes.

Does the language change affect the URL structure?

No, the interface language does not change the URLs. If you want language-specific URLs, you need to set up a multilingual wiki with separate namespaces or subdomains.

Related

Method: the standard formula for this calculation, rounded as each result states. See how the calculators work or report an error.