CINXE.COM
Manual:Language - MediaWiki
<!DOCTYPE html> <html class="client-nojs vector-feature-language-in-header-disabled vector-feature-language-in-main-page-header-disabled vector-feature-sticky-header-disabled vector-feature-page-tools-pinned-disabled vector-feature-toc-pinned-clientpref-1 vector-feature-main-menu-pinned-disabled vector-feature-limited-width-clientpref-1 vector-feature-limited-width-content-enabled vector-feature-custom-font-size-clientpref--excluded vector-feature-appearance-pinned-clientpref-1 vector-feature-night-mode-disabled skin-theme-clientpref-day vector-toc-available" lang="en" dir="ltr"> <head> <meta charset="UTF-8"> <title>Manual:Language - MediaWiki</title> <script>(function(){var className="client-js vector-feature-language-in-header-disabled vector-feature-language-in-main-page-header-disabled vector-feature-sticky-header-disabled vector-feature-page-tools-pinned-disabled vector-feature-toc-pinned-clientpref-1 vector-feature-main-menu-pinned-disabled vector-feature-limited-width-clientpref-1 vector-feature-limited-width-content-enabled vector-feature-custom-font-size-clientpref--excluded vector-feature-appearance-pinned-clientpref-1 vector-feature-night-mode-disabled skin-theme-clientpref-day vector-toc-available";var cookie=document.cookie.match(/(?:^|; )mediawikiwikimwclientpreferences=([^;]+)/);if(cookie){cookie[1].split('%2C').forEach(function(pref){className=className.replace(new RegExp('(^| )'+pref.replace(/-clientpref-\w+$|[^\w-]+/g,'')+'-clientpref-\\w+( |$)'),'$1'+pref+'$2');});}document.documentElement.className=className;}());RLCONF={"wgBreakFrames":false,"wgSeparatorTransformTable":["",""],"wgDigitTransformTable":["",""], "wgDefaultDateFormat":"dmy","wgMonthNames":["","January","February","March","April","May","June","July","August","September","October","November","December"],"wgRequestId":"48fc2b30-a889-4aab-b955-ffd050483c8f","wgCanonicalNamespace":"Manual","wgCanonicalSpecialPageName":false,"wgNamespaceNumber":100,"wgPageName":"Manual:Language","wgTitle":"Language","wgCurRevisionId":6815012,"wgRevisionId":6815012,"wgArticleId":66137,"wgIsArticle":true,"wgIsRedirect":false,"wgAction":"view","wgUserName":null,"wgUserGroups":["*"],"wgCategories":["Localisation"],"wgPageViewLanguage":"en","wgPageContentLanguage":"en","wgPageContentModel":"wikitext","wgRelevantPageName":"Manual:Language","wgRelevantArticleId":66137,"wgIsProbablyEditable":false,"wgRelevantPageIsProbablyEditable":false,"wgRestrictionEdit":["autoconfirmed"],"wgRestrictionMove":["autoconfirmed"],"wgNoticeProject":"mediawiki","wgCiteReferencePreviewsActive":true,"wgMediaViewerOnClick":true,"wgMediaViewerEnabledByDefault":true,"wgVisualEditor" :{"pageLanguageCode":"en","pageLanguageDir":"ltr","pageVariantFallbacks":"en"},"wgMFDisplayWikibaseDescriptions":{"search":true,"watchlist":true,"tagline":false,"nearby":true},"wgWMESchemaEditAttemptStepOversample":false,"wgWMEPageLength":30000,"wgInternalRedirectTargetUrl":"/wiki/Manual:Language","wgTranslatePageTranslation":"source","wgCentralAuthMobileDomain":false,"wgEditSubmitButtonLabelPublish":true,"wgULSPosition":"personal","wgULSisCompactLinksEnabled":true,"wgVector2022LanguageInHeader":false,"wgULSisLanguageSelectorEmpty":false,"wgWikibaseItemId":"Q22713392","wgCheckUserClientHintsHeadersJsApi":["brands","architecture","bitness","fullVersionList","mobile","model","platform","platformVersion"]};RLSTATE={"ext.globalCssJs.user.styles":"ready","site.styles":"ready","user.styles":"ready","ext.globalCssJs.user":"ready","user":"ready","user.options":"loading","ext.translate.tag.languages":"ready","ext.cite.styles":"ready","ext.pygments":"ready","skins.vector.search.codex.styles": "ready","skins.vector.styles":"ready","skins.vector.icons":"ready","ext.translate.edit.documentation.styles":"ready","ext.translate":"ready","ext.wikimediamessages.styles":"ready","ext.visualEditor.desktopArticleTarget.noscript":"ready","ext.uls.pt":"ready","wikibase.client.init":"ready","ext.wikimediaBadges":"ready"};RLPAGEMODULES=["mediawiki.action.view.redirect","ext.cite.ux-enhancements","ext.pygments.view","mediawiki.page.media","site","mediawiki.page.ready","mediawiki.toc","skins.vector.js","ext.centralNotice.geoIP","ext.centralNotice.startUp","ext.translate.pagetranslation.uls","ext.urlShortener.toolbar","ext.centralauth.centralautologin","mmv.bootstrap","ext.visualEditor.desktopArticleTarget.init","ext.visualEditor.targetLoader","ext.echo.centralauth","ext.eventLogging","ext.wikimediaEvents","ext.navigationTiming","ext.uls.compactlinks","ext.uls.interface","wikibase.client.vector-2022","ext.checkUser.clientHints","wikibase.sidebar.tracking"];</script> <script>(RLQ=window.RLQ||[]).push(function(){mw.loader.impl(function(){return["user.options@12s5i",function($,jQuery,require,module){mw.user.tokens.set({"patrolToken":"+\\","watchToken":"+\\","csrfToken":"+\\"}); }];});});</script> <link rel="stylesheet" href="/w/load.php?lang=en&modules=ext.cite.styles%7Cext.pygments%2Ctranslate%2CwikimediaBadges%7Cext.translate.edit.documentation.styles%7Cext.translate.tag.languages%7Cext.uls.pt%7Cext.visualEditor.desktopArticleTarget.noscript%7Cext.wikimediamessages.styles%7Cskins.vector.icons%2Cstyles%7Cskins.vector.search.codex.styles%7Cwikibase.client.init&only=styles&skin=vector-2022"> <script async="" src="/w/load.php?lang=en&modules=startup&only=scripts&raw=1&skin=vector-2022"></script> <meta name="ResourceLoaderDynamicStyles" content=""> <link rel="stylesheet" href="/w/load.php?lang=en&modules=site.styles&only=styles&skin=vector-2022"> <meta name="generator" content="MediaWiki 1.44.0-wmf.4"> <meta name="referrer" content="origin"> <meta name="referrer" content="origin-when-cross-origin"> <meta name="robots" content="max-image-preview:standard"> <meta name="format-detection" content="telephone=no"> <meta name="viewport" content="width=1120"> <meta property="og:site_name" content="MediaWiki"> <meta property="og:title" content="Manual:Language - MediaWiki"> <meta property="og:type" content="website"> <link rel="preconnect" href="//upload.wikimedia.org"> <link rel="alternate" media="only screen and (max-width: 640px)" href="//m.mediawiki.org/wiki/Manual:Language"> <link rel="apple-touch-icon" href="/static/apple-touch/mediawiki.png"> <link rel="icon" href="/static/favicon/mediawiki.ico"> <link rel="search" type="application/opensearchdescription+xml" href="/w/rest.php/v1/search" title="MediaWiki (en)"> <link rel="EditURI" type="application/rsd+xml" href="//www.mediawiki.org/w/api.php?action=rsd"> <link rel="canonical" href="https://www.mediawiki.org/wiki/Manual:Language"> <link rel="license" href="https://creativecommons.org/licenses/by-sa/4.0/"> <link rel="alternate" type="application/atom+xml" title="MediaWiki Atom feed" href="/w/index.php?title=Special:RecentChanges&feed=atom"> <link rel="dns-prefetch" href="//meta.wikimedia.org" /> <link rel="dns-prefetch" href="//login.wikimedia.org"> </head> <body class="skin--responsive skin-vector skin-vector-search-vue mediawiki ltr sitedir-ltr mw-hide-empty-elt ns-100 ns-subject page-Manual_Language rootpage-Manual_Language skin-vector-2022 action-view"><a class="mw-jump-link" href="#bodyContent">Jump to content</a> <div class="vector-header-container"> <header class="vector-header mw-header"> <div class="vector-header-start"> <nav class="vector-main-menu-landmark" aria-label="Site"> <div id="vector-main-menu-dropdown" class="vector-dropdown vector-main-menu-dropdown vector-button-flush-left vector-button-flush-right" > <input type="checkbox" id="vector-main-menu-dropdown-checkbox" role="button" aria-haspopup="true" data-event-name="ui.dropdown-vector-main-menu-dropdown" class="vector-dropdown-checkbox " aria-label="Main menu" > <label id="vector-main-menu-dropdown-label" for="vector-main-menu-dropdown-checkbox" class="vector-dropdown-label cdx-button cdx-button--fake-button cdx-button--fake-button--enabled cdx-button--weight-quiet cdx-button--icon-only " aria-hidden="true" ><span class="vector-icon mw-ui-icon-menu mw-ui-icon-wikimedia-menu"></span> <span class="vector-dropdown-label-text">Main menu</span> </label> <div class="vector-dropdown-content"> <div id="vector-main-menu-unpinned-container" class="vector-unpinned-container"> <div id="vector-main-menu" class="vector-main-menu vector-pinnable-element"> <div class="vector-pinnable-header vector-main-menu-pinnable-header vector-pinnable-header-unpinned" data-feature-name="main-menu-pinned" data-pinnable-element-id="vector-main-menu" data-pinned-container-id="vector-main-menu-pinned-container" data-unpinned-container-id="vector-main-menu-unpinned-container" > <div class="vector-pinnable-header-label">Main menu</div> <button class="vector-pinnable-header-toggle-button vector-pinnable-header-pin-button" data-event-name="pinnable-header.vector-main-menu.pin">move to sidebar</button> <button class="vector-pinnable-header-toggle-button vector-pinnable-header-unpin-button" data-event-name="pinnable-header.vector-main-menu.unpin">hide</button> </div> <div id="p-navigation" class="vector-menu mw-portlet mw-portlet-navigation" > <div class="vector-menu-heading"> Navigation </div> <div class="vector-menu-content"> <ul class="vector-menu-content-list"> <li id="n-mainpage-description" class="mw-list-item"><a href="/wiki/MediaWiki" title="Visit the main page [z]" accesskey="z"><span>Main page</span></a></li><li id="n-mw-download" class="mw-list-item"><a href="/wiki/Download"><span>Get MediaWiki</span></a></li><li id="n-mw-extensions" class="mw-list-item"><a href="/wiki/Special:MyLanguage/Category:Extensions"><span>Get extensions</span></a></li><li id="n-blog-text" class="mw-list-item"><a href="https://techblog.wikimedia.org/"><span>Tech blog</span></a></li><li id="n-mw-contribute" class="mw-list-item"><a href="/wiki/Special:MyLanguage/How_to_contribute"><span>Contribute</span></a></li> </ul> </div> </div> <div id="p-support" class="vector-menu mw-portlet mw-portlet-support" > <div class="vector-menu-heading"> Support </div> <div class="vector-menu-content"> <ul class="vector-menu-content-list"> <li id="n-help" class="mw-list-item"><a href="/wiki/Special:MyLanguage/Help:Contents" title="The place to find out"><span>User help</span></a></li><li id="n-mw-faq" class="mw-list-item"><a href="/wiki/Special:MyLanguage/Manual:FAQ"><span>FAQ</span></a></li><li id="n-mw-manual" class="mw-list-item"><a href="/wiki/Special:MyLanguage/Manual:Contents"><span>Technical manual</span></a></li><li id="n-mw-supportdesk" class="mw-list-item"><a href="/wiki/Project:Support_desk"><span>Support desk</span></a></li><li id="n-mw-communication" class="mw-list-item"><a href="/wiki/Special:MyLanguage/Communication"><span>Communication</span></a></li> </ul> </div> </div> <div id="p-development" class="vector-menu mw-portlet mw-portlet-development" > <div class="vector-menu-heading"> Development </div> <div class="vector-menu-content"> <ul class="vector-menu-content-list"> <li id="n-mw-developerportal" class="mw-list-item"><a href="https://developer.wikimedia.org/"><span>Developer portal</span></a></li><li id="n-svn-statistics" class="mw-list-item"><a href="/wiki/Development_statistics"><span>Code statistics</span></a></li> </ul> </div> </div> <div id="p-mediawiki.org" class="vector-menu mw-portlet mw-portlet-mediawiki_org" > <div class="vector-menu-heading"> mediawiki.org </div> <div class="vector-menu-content"> <ul class="vector-menu-content-list"> <li id="n-portal" class="mw-list-item"><a href="/wiki/Project:Help" title="About the project, what you can do, where to find things"><span>Community portal</span></a></li><li id="n-recentchanges" class="mw-list-item"><a href="/wiki/Special:RecentChanges" title="A list of recent changes in the wiki [r]" accesskey="r"><span>Recent changes</span></a></li><li id="n-mw-translate" class="mw-list-item"><a href="/wiki/Special:LanguageStats"><span>Translate content</span></a></li><li id="n-randompage" class="mw-list-item"><a href="/wiki/Special:Random" title="Load a random page [x]" accesskey="x"><span>Random page</span></a></li><li id="n-mw-discussion" class="mw-list-item"><a href="/wiki/Project:Village_Pump"><span>Village pump</span></a></li><li id="n-Sandboxlink-portlet-label" class="mw-list-item"><a href="/wiki/Project:Sandbox"><span>Sandbox</span></a></li> </ul> </div> </div> <div id="p-lang" class="vector-menu mw-portlet mw-portlet-lang" > <div class="vector-menu-heading"> In other languages </div> <div class="vector-menu-content"> <ul class="vector-menu-content-list"> </ul> <div class="after-portlet after-portlet-lang"><span class="wb-langlinks-add wb-langlinks-link"><a href="https://www.wikidata.org/wiki/Special:EntityPage/Q22713392#sitelinks-wikipedia" title="Add interlanguage links" class="wbc-editpage">Add links</a></span></div> </div> </div> </div> </div> </div> </div> </nav> <a href="/wiki/MediaWiki" class="mw-logo"> <img class="mw-logo-icon" src="/static/images/icons/mediawikiwiki.svg" alt="" aria-hidden="true" height="50" width="50"> <span class="mw-logo-container skin-invert"> <img class="mw-logo-wordmark" alt="MediaWiki" src="/static/images/mobile/copyright/mediawikiwiki-wordmark.svg" style="width: 7.5em; height: 1.125em;"> </span> </a> </div> <div class="vector-header-end"> <div id="p-search" role="search" class="vector-search-box-vue vector-search-box-collapses vector-search-box-show-thumbnail vector-search-box-auto-expand-width vector-search-box"> <a href="/wiki/Special:Search" class="cdx-button cdx-button--fake-button cdx-button--fake-button--enabled cdx-button--weight-quiet cdx-button--icon-only search-toggle" title="Search MediaWiki [f]" accesskey="f"><span class="vector-icon mw-ui-icon-search mw-ui-icon-wikimedia-search"></span> <span>Search</span> </a> <div class="vector-typeahead-search-container"> <div class="cdx-typeahead-search cdx-typeahead-search--show-thumbnail cdx-typeahead-search--auto-expand-width"> <form action="/w/index.php" id="searchform" class="cdx-search-input cdx-search-input--has-end-button"> <div id="simpleSearch" class="cdx-search-input__input-wrapper" data-search-loc="header-moved"> <div class="cdx-text-input cdx-text-input--has-start-icon"> <input class="cdx-text-input__input" type="search" name="search" placeholder="Search MediaWiki" aria-label="Search MediaWiki" autocapitalize="sentences" title="Search MediaWiki [f]" accesskey="f" id="searchInput" > <span class="cdx-text-input__icon cdx-text-input__start-icon"></span> </div> <input type="hidden" name="title" value="Special:Search"> </div> <button class="cdx-button cdx-search-input__end-button">Search</button> </form> </div> </div> </div> <nav class="vector-user-links vector-user-links-wide" aria-label="Personal tools"> <div class="vector-user-links-main"> <div id="p-vector-user-menu-preferences" class="vector-menu mw-portlet" > <div class="vector-menu-content"> <ul class="vector-menu-content-list"> <li id="ca-uls" class="mw-list-item active user-links-collapsible-item"><a data-mw="interface" href="#" class="uls-trigger cdx-button cdx-button--fake-button cdx-button--fake-button--enabled cdx-button--weight-quiet"><span class="vector-icon mw-ui-icon-wikimedia-language mw-ui-icon-wikimedia-wikimedia-language"></span> <span>English</span></a> </li> </ul> </div> </div> <div id="p-vector-user-menu-userpage" class="vector-menu mw-portlet emptyPortlet" > <div class="vector-menu-content"> <ul class="vector-menu-content-list"> </ul> </div> </div> <nav class="vector-appearance-landmark" aria-label="Appearance"> <div id="vector-appearance-dropdown" class="vector-dropdown " title="Change the appearance of the page's font size, width, and color" > <input type="checkbox" id="vector-appearance-dropdown-checkbox" role="button" aria-haspopup="true" data-event-name="ui.dropdown-vector-appearance-dropdown" class="vector-dropdown-checkbox " aria-label="Appearance" > <label id="vector-appearance-dropdown-label" for="vector-appearance-dropdown-checkbox" class="vector-dropdown-label cdx-button cdx-button--fake-button cdx-button--fake-button--enabled cdx-button--weight-quiet cdx-button--icon-only " aria-hidden="true" ><span class="vector-icon mw-ui-icon-appearance mw-ui-icon-wikimedia-appearance"></span> <span class="vector-dropdown-label-text">Appearance</span> </label> <div class="vector-dropdown-content"> <div id="vector-appearance-unpinned-container" class="vector-unpinned-container"> </div> </div> </div> </nav> <div id="p-vector-user-menu-notifications" class="vector-menu mw-portlet emptyPortlet" > <div class="vector-menu-content"> <ul class="vector-menu-content-list"> </ul> </div> </div> <div id="p-vector-user-menu-overflow" class="vector-menu mw-portlet" > <div class="vector-menu-content"> <ul class="vector-menu-content-list"> <li id="pt-sitesupport-2" class="user-links-collapsible-item mw-list-item user-links-collapsible-item"><a data-mw="interface" href="https://donate.wikimedia.org/?utm_source=donate&utm_medium=sidebar&utm_campaign=spontaneous&uselang=en" class=""><span>Donate</span></a> </li> <li id="pt-createaccount-2" class="user-links-collapsible-item mw-list-item user-links-collapsible-item"><a data-mw="interface" href="/w/index.php?title=Special:CreateAccount&returnto=Manual%3ALanguage" title="You are encouraged to create an account and log in; however, it is not mandatory" class=""><span>Create account</span></a> </li> <li id="pt-login-2" class="user-links-collapsible-item mw-list-item user-links-collapsible-item"><a data-mw="interface" href="/w/index.php?title=Special:UserLogin&returnto=Manual%3ALanguage" title="You are encouraged to log in; however, it is not mandatory [o]" accesskey="o" class=""><span>Log in</span></a> </li> </ul> </div> </div> </div> <div id="vector-user-links-dropdown" class="vector-dropdown vector-user-menu vector-button-flush-right vector-user-menu-logged-out" title="More options" > <input type="checkbox" id="vector-user-links-dropdown-checkbox" role="button" aria-haspopup="true" data-event-name="ui.dropdown-vector-user-links-dropdown" class="vector-dropdown-checkbox " aria-label="Personal tools" > <label id="vector-user-links-dropdown-label" for="vector-user-links-dropdown-checkbox" class="vector-dropdown-label cdx-button cdx-button--fake-button cdx-button--fake-button--enabled cdx-button--weight-quiet cdx-button--icon-only " aria-hidden="true" ><span class="vector-icon mw-ui-icon-ellipsis mw-ui-icon-wikimedia-ellipsis"></span> <span class="vector-dropdown-label-text">Personal tools</span> </label> <div class="vector-dropdown-content"> <div id="p-personal" class="vector-menu mw-portlet mw-portlet-personal user-links-collapsible-item" title="User menu" > <div class="vector-menu-content"> <ul class="vector-menu-content-list"> <li id="pt-sitesupport" class="user-links-collapsible-item mw-list-item"><a href="https://donate.wikimedia.org/?utm_source=donate&utm_medium=sidebar&utm_campaign=spontaneous&uselang=en"><span>Donate</span></a></li><li id="pt-createaccount" class="user-links-collapsible-item mw-list-item"><a href="/w/index.php?title=Special:CreateAccount&returnto=Manual%3ALanguage" title="You are encouraged to create an account and log in; however, it is not mandatory"><span class="vector-icon mw-ui-icon-userAdd mw-ui-icon-wikimedia-userAdd"></span> <span>Create account</span></a></li><li id="pt-login" class="user-links-collapsible-item mw-list-item"><a href="/w/index.php?title=Special:UserLogin&returnto=Manual%3ALanguage" title="You are encouraged to log in; however, it is not mandatory [o]" accesskey="o"><span class="vector-icon mw-ui-icon-logIn mw-ui-icon-wikimedia-logIn"></span> <span>Log in</span></a></li> </ul> </div> </div> <div id="p-user-menu-anon-editor" class="vector-menu mw-portlet mw-portlet-user-menu-anon-editor" > <div class="vector-menu-heading"> Pages for logged out editors <a href="/wiki/Help:Introduction" aria-label="Learn more about editing"><span>learn more</span></a> </div> <div class="vector-menu-content"> <ul class="vector-menu-content-list"> <li id="pt-anoncontribs" class="mw-list-item"><a href="/wiki/Special:MyContributions" title="A list of edits made from this IP address [y]" accesskey="y"><span>Contributions</span></a></li><li id="pt-anontalk" class="mw-list-item"><a href="/wiki/Special:MyTalk" title="Discussion about edits from this IP address [n]" accesskey="n"><span>Talk</span></a></li> </ul> </div> </div> </div> </div> </nav> </div> </header> </div> <div class="mw-page-container"> <div class="mw-page-container-inner"> <div class="vector-sitenotice-container"> <div id="siteNotice"><!-- CentralNotice --></div> </div> <div class="vector-column-start"> <div class="vector-main-menu-container"> <div id="mw-navigation"> <nav id="mw-panel" class="vector-main-menu-landmark" aria-label="Site"> <div id="vector-main-menu-pinned-container" class="vector-pinned-container"> </div> </nav> </div> </div> <div class="vector-sticky-pinned-container"> <nav id="mw-panel-toc" aria-label="Contents" data-event-name="ui.sidebar-toc" class="mw-table-of-contents-container vector-toc-landmark"> <div id="vector-toc-pinned-container" class="vector-pinned-container"> <div id="vector-toc" class="vector-toc vector-pinnable-element"> <div class="vector-pinnable-header vector-toc-pinnable-header vector-pinnable-header-pinned" data-feature-name="toc-pinned" data-pinnable-element-id="vector-toc" > <h2 class="vector-pinnable-header-label">Contents</h2> <button class="vector-pinnable-header-toggle-button vector-pinnable-header-pin-button" data-event-name="pinnable-header.vector-toc.pin">move to sidebar</button> <button class="vector-pinnable-header-toggle-button vector-pinnable-header-unpin-button" data-event-name="pinnable-header.vector-toc.unpin">hide</button> </div> <ul class="vector-toc-contents" id="mw-panel-toc-list"> <li id="toc-mw-content-text" class="vector-toc-list-item vector-toc-level-1"> <a href="#" class="vector-toc-link"> <div class="vector-toc-text">Beginning</div> </a> </li> <li id="toc-Language_code" class="vector-toc-list-item vector-toc-level-1 vector-toc-list-item-expanded"> <a class="vector-toc-link" href="#Language_code"> <div class="vector-toc-text"> <span class="vector-toc-numb">1</span> <span>Language code</span> </div> </a> <ul id="toc-Language_code-sublist" class="vector-toc-list"> </ul> </li> <li id="toc-Names.php" class="vector-toc-list-item vector-toc-level-1 vector-toc-list-item-expanded"> <a class="vector-toc-link" href="#Names.php"> <div class="vector-toc-text"> <span class="vector-toc-numb">2</span> <span>Names.php</span> </div> </a> <ul id="toc-Names.php-sublist" class="vector-toc-list"> </ul> </li> <li id="toc-Fallback_languages" class="vector-toc-list-item vector-toc-level-1 vector-toc-list-item-expanded"> <a class="vector-toc-link" href="#Fallback_languages"> <div class="vector-toc-text"> <span class="vector-toc-numb">3</span> <span>Fallback languages</span> </div> </a> <ul id="toc-Fallback_languages-sublist" class="vector-toc-list"> </ul> </li> <li id="toc-Site_content_language" class="vector-toc-list-item vector-toc-level-1 vector-toc-list-item-expanded"> <a class="vector-toc-link" href="#Site_content_language"> <div class="vector-toc-text"> <span class="vector-toc-numb">4</span> <span>Site content language</span> </div> </a> <ul id="toc-Site_content_language-sublist" class="vector-toc-list"> </ul> </li> <li id="toc-User_interface_language" class="vector-toc-list-item vector-toc-level-1 vector-toc-list-item-expanded"> <a class="vector-toc-link" href="#User_interface_language"> <div class="vector-toc-text"> <span class="vector-toc-numb">5</span> <span>User interface language</span> </div> </a> <ul id="toc-User_interface_language-sublist" class="vector-toc-list"> </ul> </li> <li id="toc-Page_content_language" class="vector-toc-list-item vector-toc-level-1 vector-toc-list-item-expanded"> <a class="vector-toc-link" href="#Page_content_language"> <div class="vector-toc-text"> <span class="vector-toc-numb">6</span> <span>Page content language</span> </div> </a> <ul id="toc-Page_content_language-sublist" class="vector-toc-list"> </ul> </li> <li id="toc-Code_structure" class="vector-toc-list-item vector-toc-level-1 vector-toc-list-item-expanded"> <a class="vector-toc-link" href="#Code_structure"> <div class="vector-toc-text"> <span class="vector-toc-numb">7</span> <span>Code structure</span> </div> </a> <button aria-controls="toc-Code_structure-sublist" class="cdx-button cdx-button--weight-quiet cdx-button--icon-only vector-toc-toggle"> <span class="vector-icon mw-ui-icon-wikimedia-expand"></span> <span>Toggle Code structure subsection</span> </button> <ul id="toc-Code_structure-sublist" class="vector-toc-list"> <li id="toc-Language_objects" class="vector-toc-list-item vector-toc-level-2"> <a class="vector-toc-link" href="#Language_objects"> <div class="vector-toc-text"> <span class="vector-toc-numb">7.1</span> <span>Language objects</span> </div> </a> <ul id="toc-Language_objects-sublist" class="vector-toc-list"> </ul> </li> </ul> </li> <li id="toc-Old_local_translation_system" class="vector-toc-list-item vector-toc-level-1 vector-toc-list-item-expanded"> <a class="vector-toc-link" href="#Old_local_translation_system"> <div class="vector-toc-text"> <span class="vector-toc-numb">8</span> <span>Old local translation system</span> </div> </a> <ul id="toc-Old_local_translation_system-sublist" class="vector-toc-list"> </ul> </li> <li id="toc-Keeping_messages_centralised_and_in_sync" class="vector-toc-list-item vector-toc-level-1 vector-toc-list-item-expanded"> <a class="vector-toc-link" href="#Keeping_messages_centralised_and_in_sync"> <div class="vector-toc-text"> <span class="vector-toc-numb">9</span> <span>Keeping messages centralised and in sync</span> </div> </a> <ul id="toc-Keeping_messages_centralised_and_in_sync-sublist" class="vector-toc-list"> </ul> </li> <li id="toc-What_can_be_localised" class="vector-toc-list-item vector-toc-level-1 vector-toc-list-item-expanded"> <a class="vector-toc-link" href="#What_can_be_localised"> <div class="vector-toc-text"> <span class="vector-toc-numb">10</span> <span>What can be localised</span> </div> </a> <button aria-controls="toc-What_can_be_localised-sublist" class="cdx-button cdx-button--weight-quiet cdx-button--icon-only vector-toc-toggle"> <span class="vector-icon mw-ui-icon-wikimedia-expand"></span> <span>Toggle What can be localised subsection</span> </button> <ul id="toc-What_can_be_localised-sublist" class="vector-toc-list"> <li id="toc-Namespaces" class="vector-toc-list-item vector-toc-level-2"> <a class="vector-toc-link" href="#Namespaces"> <div class="vector-toc-text"> <span class="vector-toc-numb">10.1</span> <span>Namespaces</span> </div> </a> <ul id="toc-Namespaces-sublist" class="vector-toc-list"> </ul> </li> <li id="toc-Special_page_aliases" class="vector-toc-list-item vector-toc-level-2"> <a class="vector-toc-link" href="#Special_page_aliases"> <div class="vector-toc-text"> <span class="vector-toc-numb">10.2</span> <span>Special page aliases</span> </div> </a> <ul id="toc-Special_page_aliases-sublist" class="vector-toc-list"> </ul> </li> <li id="toc-Namespace_name_aliases" class="vector-toc-list-item vector-toc-level-2"> <a class="vector-toc-link" href="#Namespace_name_aliases"> <div class="vector-toc-text"> <span class="vector-toc-numb">10.3</span> <span>Namespace name aliases</span> </div> </a> <ul id="toc-Namespace_name_aliases-sublist" class="vector-toc-list"> </ul> </li> <li id="toc-Regional_settings" class="vector-toc-list-item vector-toc-level-2"> <a class="vector-toc-link" href="#Regional_settings"> <div class="vector-toc-text"> <span class="vector-toc-numb">10.4</span> <span>Regional settings</span> </div> </a> <ul id="toc-Regional_settings-sublist" class="vector-toc-list"> <li id="toc-Time_and_date_formats" class="vector-toc-list-item vector-toc-level-3"> <a class="vector-toc-link" href="#Time_and_date_formats"> <div class="vector-toc-text"> <span class="vector-toc-numb">10.4.1</span> <span>Time and date formats</span> </div> </a> <ul id="toc-Time_and_date_formats-sublist" class="vector-toc-list"> </ul> </li> </ul> </li> </ul> </li> <li id="toc-Notes" class="vector-toc-list-item vector-toc-level-1 vector-toc-list-item-expanded"> <a class="vector-toc-link" href="#Notes"> <div class="vector-toc-text"> <span class="vector-toc-numb">11</span> <span>Notes</span> </div> </a> <ul id="toc-Notes-sublist" class="vector-toc-list"> </ul> </li> <li id="toc-See_also" class="vector-toc-list-item vector-toc-level-1 vector-toc-list-item-expanded"> <a class="vector-toc-link" href="#See_also"> <div class="vector-toc-text"> <span class="vector-toc-numb">12</span> <span>See also</span> </div> </a> <ul id="toc-See_also-sublist" class="vector-toc-list"> </ul> </li> </ul> </div> </div> </nav> </div> </div> <div class="mw-content-container"> <main id="content" class="mw-body"> <header class="mw-body-header vector-page-titlebar"> <nav aria-label="Contents" class="vector-toc-landmark"> <div id="vector-page-titlebar-toc" class="vector-dropdown vector-page-titlebar-toc vector-button-flush-left" > <input type="checkbox" id="vector-page-titlebar-toc-checkbox" role="button" aria-haspopup="true" data-event-name="ui.dropdown-vector-page-titlebar-toc" class="vector-dropdown-checkbox " aria-label="Toggle the table of contents" > <label id="vector-page-titlebar-toc-label" for="vector-page-titlebar-toc-checkbox" class="vector-dropdown-label cdx-button cdx-button--fake-button cdx-button--fake-button--enabled cdx-button--weight-quiet cdx-button--icon-only " aria-hidden="true" ><span class="vector-icon mw-ui-icon-listBullet mw-ui-icon-wikimedia-listBullet"></span> <span class="vector-dropdown-label-text">Toggle the table of contents</span> </label> <div class="vector-dropdown-content"> <div id="vector-page-titlebar-toc-unpinned-container" class="vector-unpinned-container"> </div> </div> </div> </nav> <h1 id="firstHeading" class="firstHeading mw-first-heading"><span class="mw-page-title-namespace">Manual</span><span class="mw-page-title-separator">:</span><span class="mw-page-title-main">Language</span></h1> <div class="mw-indicators"> </div> </header> <div class="vector-page-toolbar"> <div class="vector-page-toolbar-container"> <div id="left-navigation"> <nav aria-label="Namespaces"> <div id="p-associated-pages" class="vector-menu vector-menu-tabs mw-portlet mw-portlet-associated-pages" > <div class="vector-menu-content"> <ul class="vector-menu-content-list"> <li id="ca-nstab-manual" class="selected vector-tab-noicon mw-list-item"><a href="/wiki/Manual:Language" title="View the subject page [c]" accesskey="c"><span>Manual</span></a></li><li id="ca-talk" class="vector-tab-noicon mw-list-item"><a href="/wiki/Manual_talk:Language" rel="discussion" title="Discussion about the content page [t]" accesskey="t"><span>Discussion</span></a></li> </ul> </div> </div> <div id="vector-variants-dropdown" class="vector-dropdown emptyPortlet" > <input type="checkbox" id="vector-variants-dropdown-checkbox" role="button" aria-haspopup="true" data-event-name="ui.dropdown-vector-variants-dropdown" class="vector-dropdown-checkbox " aria-label="Change language variant" > <label id="vector-variants-dropdown-label" for="vector-variants-dropdown-checkbox" class="vector-dropdown-label cdx-button cdx-button--fake-button cdx-button--fake-button--enabled cdx-button--weight-quiet" aria-hidden="true" ><span class="vector-dropdown-label-text">English</span> </label> <div class="vector-dropdown-content"> <div id="p-variants" class="vector-menu mw-portlet mw-portlet-variants emptyPortlet" > <div class="vector-menu-content"> <ul class="vector-menu-content-list"> </ul> </div> </div> </div> </div> </nav> </div> <div id="right-navigation" class="vector-collapsible"> <nav aria-label="Views"> <div id="p-views" class="vector-menu vector-menu-tabs mw-portlet mw-portlet-views" > <div class="vector-menu-content"> <ul class="vector-menu-content-list"> <li id="ca-view" class="selected vector-tab-noicon mw-list-item"><a href="/wiki/Manual:Language"><span>Read</span></a></li><li id="ca-viewsource" class="vector-tab-noicon mw-list-item"><a href="/w/index.php?title=Manual:Language&action=edit" title="This page is protected. You can view its source [e]" accesskey="e"><span>View source</span></a></li><li id="ca-history" class="vector-tab-noicon mw-list-item"><a href="/w/index.php?title=Manual:Language&action=history" title="Past revisions of this page [h]" accesskey="h"><span>View history</span></a></li> </ul> </div> </div> </nav> <nav class="vector-page-tools-landmark" aria-label="Page tools"> <div id="vector-page-tools-dropdown" class="vector-dropdown vector-page-tools-dropdown" > <input type="checkbox" id="vector-page-tools-dropdown-checkbox" role="button" aria-haspopup="true" data-event-name="ui.dropdown-vector-page-tools-dropdown" class="vector-dropdown-checkbox " aria-label="Tools" > <label id="vector-page-tools-dropdown-label" for="vector-page-tools-dropdown-checkbox" class="vector-dropdown-label cdx-button cdx-button--fake-button cdx-button--fake-button--enabled cdx-button--weight-quiet" aria-hidden="true" ><span class="vector-dropdown-label-text">Tools</span> </label> <div class="vector-dropdown-content"> <div id="vector-page-tools-unpinned-container" class="vector-unpinned-container"> <div id="vector-page-tools" class="vector-page-tools vector-pinnable-element"> <div class="vector-pinnable-header vector-page-tools-pinnable-header vector-pinnable-header-unpinned" data-feature-name="page-tools-pinned" data-pinnable-element-id="vector-page-tools" data-pinned-container-id="vector-page-tools-pinned-container" data-unpinned-container-id="vector-page-tools-unpinned-container" > <div class="vector-pinnable-header-label">Tools</div> <button class="vector-pinnable-header-toggle-button vector-pinnable-header-pin-button" data-event-name="pinnable-header.vector-page-tools.pin">move to sidebar</button> <button class="vector-pinnable-header-toggle-button vector-pinnable-header-unpin-button" data-event-name="pinnable-header.vector-page-tools.unpin">hide</button> </div> <div id="p-cactions" class="vector-menu mw-portlet mw-portlet-cactions emptyPortlet vector-has-collapsible-items" title="More options" > <div class="vector-menu-heading"> Actions </div> <div class="vector-menu-content"> <ul class="vector-menu-content-list"> <li id="ca-more-view" class="selected vector-more-collapsible-item mw-list-item"><a href="/wiki/Manual:Language"><span>Read</span></a></li><li id="ca-more-viewsource" class="vector-more-collapsible-item mw-list-item"><a href="/w/index.php?title=Manual:Language&action=edit"><span>View source</span></a></li><li id="ca-more-history" class="vector-more-collapsible-item mw-list-item"><a href="/w/index.php?title=Manual:Language&action=history"><span>View history</span></a></li> </ul> </div> </div> <div id="p-tb" class="vector-menu mw-portlet mw-portlet-tb" > <div class="vector-menu-heading"> General </div> <div class="vector-menu-content"> <ul class="vector-menu-content-list"> <li id="t-whatlinkshere" class="mw-list-item"><a href="/wiki/Special:WhatLinksHere/Manual:Language" title="A list of all wiki pages that link here [j]" accesskey="j"><span>What links here</span></a></li><li id="t-recentchangeslinked" class="mw-list-item"><a href="/wiki/Special:RecentChangesLinked/Manual:Language" rel="nofollow" title="Recent changes in pages linked from this page [k]" accesskey="k"><span>Related changes</span></a></li><li id="t-upload" class="mw-list-item"><a href="//commons.wikimedia.org/wiki/Special:UploadWizard" title="Upload files [u]" accesskey="u"><span>Upload file</span></a></li><li id="t-specialpages" class="mw-list-item"><a href="/wiki/Special:SpecialPages" title="A list of all special pages [q]" accesskey="q"><span>Special pages</span></a></li><li id="t-permalink" class="mw-list-item"><a href="/w/index.php?title=Manual:Language&oldid=6815012" title="Permanent link to this revision of this page"><span>Permanent link</span></a></li><li id="t-info" class="mw-list-item"><a href="/w/index.php?title=Manual:Language&action=info" title="More information about this page"><span>Page information</span></a></li><li id="t-cite" class="mw-list-item"><a href="/w/index.php?title=Special:CiteThisPage&page=Manual%3ALanguage&id=6815012&wpFormIdentifier=titleform" title="Information on how to cite this page"><span>Cite this page</span></a></li><li id="t-urlshortener" class="mw-list-item"><a href="/w/index.php?title=Special:UrlShortener&url=https%3A%2F%2Fwww.mediawiki.org%2Fwiki%2FManual%3ALanguage"><span>Get shortened URL</span></a></li><li id="t-urlshortener-qrcode" class="mw-list-item"><a href="/w/index.php?title=Special:QrCode&url=https%3A%2F%2Fwww.mediawiki.org%2Fwiki%2FManual%3ALanguage"><span>Download QR code</span></a></li> </ul> </div> </div> <div id="p-coll-print_export" class="vector-menu mw-portlet mw-portlet-coll-print_export" > <div class="vector-menu-heading"> Print/export </div> <div class="vector-menu-content"> <ul class="vector-menu-content-list"> <li id="coll-create_a_book" class="mw-list-item"><a href="/w/index.php?title=Special:Book&bookcmd=book_creator&referer=Manual%3ALanguage"><span>Create a book</span></a></li><li id="coll-download-as-rl" class="mw-list-item"><a href="/w/index.php?title=Special:DownloadAsPdf&page=Manual%3ALanguage&action=show-download-screen"><span>Download as PDF</span></a></li><li id="t-print" class="mw-list-item"><a href="/w/index.php?title=Manual:Language&printable=yes" title="Printable version of this page [p]" accesskey="p"><span>Printable version</span></a></li> </ul> </div> </div> <div id="p-wikibase-otherprojects" class="vector-menu mw-portlet mw-portlet-wikibase-otherprojects" > <div class="vector-menu-heading"> In other projects </div> <div class="vector-menu-content"> <ul class="vector-menu-content-list"> <li id="t-wikibase" class="wb-otherproject-link wb-otherproject-wikibase-dataitem mw-list-item"><a href="https://www.wikidata.org/wiki/Special:EntityPage/Q22713392" title="Link to connected data repository item [g]" accesskey="g"><span>Wikidata item</span></a></li> </ul> </div> </div> </div> </div> </div> </div> </nav> </div> </div> </div> <div class="vector-column-end"> <div class="vector-sticky-pinned-container"> <nav class="vector-page-tools-landmark" aria-label="Page tools"> <div id="vector-page-tools-pinned-container" class="vector-pinned-container"> </div> </nav> <nav class="vector-appearance-landmark" aria-label="Appearance"> <div id="vector-appearance-pinned-container" class="vector-pinned-container"> <div id="vector-appearance" class="vector-appearance vector-pinnable-element"> <div class="vector-pinnable-header vector-appearance-pinnable-header vector-pinnable-header-pinned" data-feature-name="appearance-pinned" data-pinnable-element-id="vector-appearance" data-pinned-container-id="vector-appearance-pinned-container" data-unpinned-container-id="vector-appearance-unpinned-container" > <div class="vector-pinnable-header-label">Appearance</div> <button class="vector-pinnable-header-toggle-button vector-pinnable-header-pin-button" data-event-name="pinnable-header.vector-appearance.pin">move to sidebar</button> <button class="vector-pinnable-header-toggle-button vector-pinnable-header-unpin-button" data-event-name="pinnable-header.vector-appearance.unpin">hide</button> </div> </div> </div> </nav> </div> </div> <div id="bodyContent" class="vector-body" aria-labelledby="firstHeading" data-mw-ve-target-container> <div class="vector-body-before-content"> <div id="siteSub" class="noprint">From mediawiki.org</div> </div> <div id="contentSub"><div id="mw-content-subtitle"></div></div> <div id="mw-content-text" class="mw-body-content"><div class="mw-pt-translate-header noprint nomobile" dir="ltr" lang="en"><a href="/w/index.php?title=Special:Translate&group=page-Manual%3ALanguage&action=page&filter=&action_source=translate_page" title="Special:Translate">Translate this page</a></div><div class="mw-content-ltr mw-parser-output" lang="en" dir="ltr"><div class="mw-pt-languages noprint navigation-not-searchable" lang="en" dir="ltr"><div class="mw-pt-languages-label">Languages:</div><ul class="mw-pt-languages-list"><li><a href="/wiki/Manual:Language/id" class="mw-pt-progress mw-pt-progress--low" title="Manual:Bahasa (5% translated)" lang="id" dir="ltr">Bahasa Indonesia</a></li> <li><a href="/wiki/Manual:Language/de" class="mw-pt-progress mw-pt-progress--low" title="Handbuch:Sprache (14% translated)" lang="de" dir="ltr">Deutsch</a></li> <li><span class="mw-pt-languages-ui mw-pt-languages-selected mw-pt-progress mw-pt-progress--complete" lang="en" dir="ltr">English</span></li> <li><a href="/wiki/Manual:Language/nl" class="mw-pt-progress mw-pt-progress--complete" title="Handleiding:Language (100% translated)" lang="nl" dir="ltr">Nederlands</a></li> <li><a href="/wiki/Manual:Language/ca" class="mw-pt-progress mw-pt-progress--low" title="Manual:Language (4% translated)" lang="ca" dir="ltr">català</a></li> <li><a href="/wiki/Manual:Language/da" class="mw-pt-progress mw-pt-progress--low" title="Manual:Language/da (2% translated)" lang="da" dir="ltr">dansk</a></li> <li><a href="/wiki/Manual:Language/es" class="mw-pt-progress mw-pt-progress--low" title="Manual:Idioma (8% translated)" lang="es" dir="ltr">español</a></li> <li><a href="/wiki/Manual:Language/fr" class="mw-pt-progress mw-pt-progress--complete" title="Manuel:Langue (100% translated)" lang="fr" dir="ltr">français</a></li> <li><a href="/wiki/Manual:Language/hu" class="mw-pt-progress mw-pt-progress--med" title="Kézikönyv:Nyelv (15% translated)" lang="hu" dir="ltr">magyar</a></li> <li><a href="/wiki/Manual:Language/pl" class="mw-pt-progress mw-pt-progress--low" title="Podręcznik:Język (7% translated)" lang="pl" dir="ltr">polski</a></li> <li><a href="/wiki/Manual:Language/pt" class="mw-pt-progress mw-pt-progress--med" title="Manual:Idioma (26% translated)" lang="pt" dir="ltr">português</a></li> <li><a href="/wiki/Manual:Language/pt-br" class="mw-pt-progress mw-pt-progress--low" title="Manual:Idiomas (12% translated)" lang="pt-BR" dir="ltr">português do Brasil</a></li> <li><a href="/wiki/Manual:Language/fi" class="mw-pt-progress mw-pt-progress--low" title="Manual:Language/fi (1% translated)" lang="fi" dir="ltr">suomi</a></li> <li><a href="/wiki/Manual:Language/sv" class="mw-pt-progress mw-pt-progress--low" title="Manual:Språk (7% translated)" lang="sv" dir="ltr">svenska</a></li> <li><a href="/wiki/Manual:Language/cs" class="mw-pt-progress mw-pt-progress--complete" title="Příručka:Jazyk (100% translated)" lang="cs" dir="ltr">čeština</a></li> <li><a href="/wiki/Manual:Language/be" class="mw-pt-progress mw-pt-progress--low" title="Інструкцыя:Мова (4% translated)" lang="be" dir="ltr">беларуская</a></li> <li><a href="/wiki/Manual:Language/be-tarask" class="mw-pt-progress mw-pt-progress--low" title="Інструкцыя:Мова (4% translated)" lang="be-tarask" dir="ltr">беларуская (тарашкевіца)</a></li> <li><a href="/wiki/Manual:Language/ru" class="mw-pt-progress mw-pt-progress--med" title="Руководство:Язык (17% translated)" lang="ru" dir="ltr">русский</a></li> <li><a href="/wiki/Manual:Language/uk" class="mw-pt-progress mw-pt-progress--low" title="Мова (7% translated)" lang="uk" dir="ltr">українська</a></li> <li><a href="/wiki/Manual:Language/azb" class="mw-pt-progress mw-pt-progress--low" title="کؤمک:دیل (2% translated)" lang="azb" dir="rtl">تۆرکجه</a></li> <li><a href="/wiki/Manual:Language/fa" class="mw-pt-progress mw-pt-progress--low" title="Manual:زبان (3% translated)" lang="fa" dir="rtl">فارسی</a></li> <li><a href="/wiki/Manual:Language/ps" class="mw-pt-progress mw-pt-progress--low" title="Manual:ژبه (4% translated)" lang="ps" dir="rtl">پښتو</a></li> <li><a href="/wiki/Manual:Language/gu" class="mw-pt-progress mw-pt-progress--low" title="Manual:Language/gu (1% translated)" lang="gu" dir="ltr">ગુજરાતી</a></li> <li><a href="/wiki/Manual:Language/th" class="mw-pt-progress mw-pt-progress--med" title="คู่มือ:ภาษา (38% translated)" lang="th" dir="ltr">ไทย</a></li> <li><a href="/wiki/Manual:Language/zh" class="mw-pt-progress mw-pt-progress--high" title="Manual: (93% translated)" lang="zh" dir="ltr">中文</a></li> <li><a href="/wiki/Manual:Language/ja" class="mw-pt-progress mw-pt-progress--med" title="Manual:言語 (52% translated)" lang="ja" dir="ltr">日本語</a></li> <li><a href="/wiki/Manual:Language/ko" class="mw-pt-progress mw-pt-progress--low" title="매뉴얼:언어 (5% translated)" lang="ko" dir="ltr">한국어</a></li></ul></div> <style data-mw-deduplicate="TemplateStyles:r6651103">.mw-parser-output .nmbox{background:#f8f9fa;border:1px solid #AAA;box-sizing:border-box;margin:2px 0;padding:0}.mw-parser-output .nmbox *{box-sizing:border-box}.mw-parser-output .nmbox-header{background:#eaecf0;padding:4px 0.5em;font-weight:bold;text-align:center;white-space:nowrap}.mw-parser-output .nmbox .mbox-image{display:inline-block;padding-right:1em}.mw-parser-output .nmbox-text{border-top:1px solid #AAA;width:100%;padding:4px 0.5em}@media screen and (min-width:768px){.mw-parser-output .nmbox-header{display:table-cell;border-right:1px solid #AAA;width:1%}.mw-parser-output .nmbox-text{border-top:none;display:table-cell}}@media screen{html.skin-theme-clientpref-night .mw-parser-output .nmbox-header,html.skin-theme-clientpref-night .mw-parser-output .nmbox{background:transparent;color:inherit}}@media screen and (prefers-color-scheme:dark){html.skin-theme-clientpref-os .mw-parser-output .nmbox-header,html.skin-theme-clientpref-os .mw-parser-output .nmbox{background:transparent;color:inherit}}</style> <div class="nmbox noprint mw-content-ltr"><div class="nmbox-header">i18n docs </div> <div class="nmbox-text mbox-text"><style data-mw-deduplicate="TemplateStyles:r6387430">.mw-parser-output .hlist dl,.mw-parser-output .hlist ol,.mw-parser-output .hlist ul{margin:0;padding:0}.mw-parser-output .hlist dd,.mw-parser-output .hlist dt,.mw-parser-output .hlist li{margin:0;display:inline}.mw-parser-output .hlist dl dl,.mw-parser-output .hlist dl ol,.mw-parser-output .hlist dl ul,.mw-parser-output .hlist ol dl,.mw-parser-output .hlist ol ol,.mw-parser-output .hlist ol ul,.mw-parser-output .hlist ul dl,.mw-parser-output .hlist ul ol,.mw-parser-output .hlist ul ul{display:inline}.mw-parser-output .hlist .mw-empty-li,.mw-parser-output .hlist .mw-empty-elt{display:none}.mw-parser-output .hlist dt:after{content:": "}.mw-parser-output .hlist dd:after,.mw-parser-output .hlist li:after{content:" · ";font-weight:bold}.mw-parser-output .hlist dd:last-child:after,.mw-parser-output .hlist dt:last-child:after,.mw-parser-output .hlist li:last-child:after{content:none}.mw-parser-output .hlist dd dd:first-child:before,.mw-parser-output .hlist dd dt:first-child:before,.mw-parser-output .hlist dd li:first-child:before,.mw-parser-output .hlist dt dd:first-child:before,.mw-parser-output .hlist dt dt:first-child:before,.mw-parser-output .hlist dt li:first-child:before,.mw-parser-output .hlist li dd:first-child:before,.mw-parser-output .hlist li dt:first-child:before,.mw-parser-output .hlist li li:first-child:before{content:" (";font-weight:normal}.mw-parser-output .hlist dd dd:last-child:after,.mw-parser-output .hlist dd dt:last-child:after,.mw-parser-output .hlist dd li:last-child:after,.mw-parser-output .hlist dt dd:last-child:after,.mw-parser-output .hlist dt dt:last-child:after,.mw-parser-output .hlist dt li:last-child:after,.mw-parser-output .hlist li dd:last-child:after,.mw-parser-output .hlist li dt:last-child:after,.mw-parser-output .hlist li li:last-child:after{content:")";font-weight:normal}.mw-parser-output .hlist ol{counter-reset:listitem}.mw-parser-output .hlist ol>li{counter-increment:listitem}.mw-parser-output .hlist ol>li:before{content:" "counter(listitem)"\a0 "}.mw-parser-output .hlist dd ol>li:first-child:before,.mw-parser-output .hlist dt ol>li:first-child:before,.mw-parser-output .hlist li ol>li:first-child:before{content:" ("counter(listitem)"\a0 "}</style><div class="hlist"> <ul><li><a href="/wiki/Special:MyLanguage/Localisation" title="Special:MyLanguage/Localisation">Localisation</a><span style="display:none"><a href="/wiki/Localisation" title="Localisation"> </a></span></li> <li><a href="/wiki/Special:MyLanguage/Help:System_message" title="Special:MyLanguage/Help:System message">System message</a><span style="display:none"><a href="/wiki/Help:System_message" title="Help:System message"> </a></span></li> <li><a href="/wiki/Special:MyLanguage/Manual:Messages_API" title="Special:MyLanguage/Manual:Messages API">Messages API</a><span style="display:none"><a href="/wiki/Manual:Messages_API" title="Manual:Messages API"> </a></span></li> <li><b><a href="/wiki/Special:MyLanguage/Manual:Language" title="Special:MyLanguage/Manual:Language">Language</a></b><span style="display:none"><a class="mw-selflink selflink"> </a></span></li> <li><a href="/wiki/Special:MyLanguage/translatewiki.net" title="Special:MyLanguage/translatewiki.net">translatewiki.net</a><span style="display:none"><a href="/wiki/Translatewiki.net" title="Translatewiki.net"> </a></span></li> <li><a href="/wiki/Special:MyLanguage/Writing_systems" title="Special:MyLanguage/Writing systems">Writing systems</a><span style="display:none"><a href="/wiki/Writing_systems" title="Writing systems"> </a></span></li> <li><a href="/wiki/Special:MyLanguage/Directionality_support" title="Special:MyLanguage/Directionality support">Directionality</a><span style="display:none"><a href="/wiki/Directionality_support" title="Directionality support"> </a></span></li></ul> </div></div> </div> <div style="clear: right; margin-bottom: .5em; float: right; margin-left:2em; width: auto;"><meta property="mw:PageProp/toc" /></div> <dl><dd><i>See also <a href="/wiki/Special:MyLanguage/Manual:MediaWiki_architecture#Languages" title="Special:MyLanguage/Manual:MediaWiki architecture">Manual:MediaWiki architecture#Languages</a> (should be merged here?)</i></dd></dl> <p>In MediaWiki, there are various kinds of languages: </p> <ul><li>The <b>site content language</b> (<code>ContentLanguage</code> service in <code>MediaWiki\MediaWikiServices::getContentLanguage</code>, based on <code><a href="/wiki/Special:MyLanguage/Manual:$wgLanguageCode" title="Special:MyLanguage/Manual:$wgLanguageCode">$wgLanguageCode</a><span style="display:none"><a href="/wiki/Manual:$wgLanguageCode" title="Manual:$wgLanguageCode"> </a></span></code>), which should generally stay the same as long as the wiki exists. <ul><li>The <b>site content language variant</b> (<a href="/wiki/Special:MyLanguage/Manual:$wgDefaultLanguageVariant" title="Special:MyLanguage/Manual:$wgDefaultLanguageVariant">$wgDefaultLanguageVariant</a><span style="display:none"><a href="/wiki/Manual:$wgDefaultLanguageVariant" title="Manual:$wgDefaultLanguageVariant"> </a></span>) is the default variant when <a href="/wiki/Special:MyLanguage/LanguageConverter" title="Special:MyLanguage/LanguageConverter">LanguageConverter</a><span style="display:none"><a href="/wiki/LanguageConverter" class="mw-redirect" title="LanguageConverter"> </a></span> is implemented for that language.</li></ul></li> <li>The <b>user interface language</b> (<a href="/wiki/Special:MyLanguage/Manual:RequestContext" title="Special:MyLanguage/Manual:RequestContext">$contextSource->getLanguage()</a> formerly <code><a href="/wiki/Special:MyLanguage/Manual:$wgLang" title="Special:MyLanguage/Manual:$wgLang">$wgLang</a><span style="display:none"><a href="/wiki/Manual:$wgLang" title="Manual:$wgLang"> </a></span></code>), which can be changed in your preferences or with <code>&uselang=xyz</code> in the URL, but also generally remains the same while using the wiki.</li> <li>The <b>page content language</b>. This can be different for each page, even if the site and user language is the same. It is defined in getPageLanguage() in <a href="/wiki/Special:MyLanguage/Manual:Title.php" title="Special:MyLanguage/Manual:Title.php">Title</a>, representing what language the page content (e.g., wikitext) source is written in. <ul><li>The <b>page view language</b> aka <b>user language variant</b> which is a language variant of page content language, as preferred by the user. It can also be set through <code>&variant</code> (or <code><a href="/wiki/Special:MyLanguage/Manual:$wgVariantArticlePath" title="Special:MyLanguage/Manual:$wgVariantArticlePath">$wgVariantArticlePath</a><span style="display:none"><a href="/wiki/Manual:$wgVariantArticlePath" title="Manual:$wgVariantArticlePath"> </a></span></code>) in the URL (e.g. by selecting one of the tabs) <b>if</b> it is a variant of the content language of the page being viewed. It's defined in getPageViewLanguage() in <a href="/wiki/Special:MyLanguage/Manual:Title.php" title="Special:MyLanguage/Manual:Title.php">Title</a>, representing what language the rendered HTML content is written in.</li></ul></li></ul> <p>All three of them are <a href="/wiki/Special:MyLanguage/language_object" title="Special:MyLanguage/language object">language objects</a>. </p> <div class="mw-heading mw-heading2"><h2 id="Language_code">Language code</h2></div> <dl><dd><i>Not to be confused with <a href="https://meta.wikimedia.org/wiki/Special:MyLanguage/Special_language_codes" class="extiw" title="m:Special:MyLanguage/Special language codes">Wikimedia project code</a>; see also <a href="https://meta.wikimedia.org/wiki/Special:MyLanguage/Language_codes" class="extiw" title="m:Special:MyLanguage/Language codes">Language codes</a> on Meta.</i></dd></dl> <p>A language code is a valid standard abbreviation for a language supported by MediaWiki,<sup id="cite_ref-1" class="reference"><a href="#cite_note-1"><span class="cite-bracket">[</span>1<span class="cite-bracket">]</span></a></sup> which uses such codes as standard identifiers for languages (mostly in accordance with <a href="https://en.wikipedia.org/wiki/ISO_639" class="extiw" title="w:ISO 639">ISO 639-3</a>, except two-letter codes from ISO 639-1 for "established" locales) and exposes or requires them in many points of the interface and code.<sup id="cite_ref-2" class="reference"><a href="#cite_note-2"><span class="cite-bracket">[</span>2<span class="cite-bracket">]</span></a></sup> </p><p>In the example below, <code>MediaWiki:Message/ar</code>, <code>ar</code> is the language code for Arabic. </p><p>Uniformity with Unicode standard is needed to provide a good language support, in particular in cooperation with <a href="https://translatewiki.net/wiki/CLDR" class="extiw" title="translatewiki:CLDR">CLDR</a>; having an ISO 639-3 code is one <a href="https://translatewiki.net/wiki/Translatewiki.net_languages#Policy_on_enabling_translation_into_a_language" class="extiw" title="translatewiki:Translatewiki.net languages">requirement for a language to be added to MediaWiki locales</a>. </p><p>There are some special language codes for internal or development use: <code>qqq</code> (for message documentation, does not work with <code>uselang</code> etc.), <code>qqx</code> (shows message names for debugging), <code>en-x-rtl</code> (English, but pretends it is a right-to-left language), <code>en-x-piglatin</code> (when <code><a href="/wiki/Special:MyLanguage/Manual:$wgUsePigLatinVariant" title="Special:MyLanguage/Manual:$wgUsePigLatinVariant">$wgUsePigLatinVariant</a><span style="display:none"><a href="/wiki/Manual:$wgUsePigLatinVariant" title="Manual:$wgUsePigLatinVariant"> </a></span></code> is enabled, for <a href="/wiki/LanguageConverter" class="mw-redirect" title="LanguageConverter">LanguageConverter</a> testing), <code>x-xss</code> (when <code><a href="/wiki/Special:MyLanguage/Manual:$wgUseXssLanguage" title="Special:MyLanguage/Manual:$wgUseXssLanguage">$wgUseXssLanguage</a><span style="display:none"><a href="/wiki/Manual:$wgUseXssLanguage" title="Manual:$wgUseXssLanguage"> </a></span></code> is enabled, tests XSS vulnerabilities in messages). </p> <div class="mw-heading mw-heading2"><h2 id="Names.php">Names.php</h2></div> <p><a href="https://gerrit.wikimedia.org/g/mediawiki/core/%2B/HEAD/includes/languages/data/Names.php" class="extiw" title="git:mediawiki/core/+/HEAD/includes/languages/data/Names.php">Names.php</a> is the master registry of languages supported by MediaWiki. This is not the same as languages of which MediaWiki will show l10n (<a href="/wiki/Special:MyLanguage/Help:System_message#Localisation_file_format" title="Special:MyLanguage/Help:System message">JSON files</a>) nor languages of which MediaWiki knows the names (via <a href="/wiki/Special:MyLanguage/Extension:CLDR" title="Special:MyLanguage/Extension:CLDR">CLDR</a><span style="display:none"><a href="/wiki/Extension:CLDR" title="Extension:CLDR"> </a></span>), mind you! </p> <div class="mw-heading mw-heading2"><h2 id="Fallback_languages">Fallback languages</h2></div> <style data-mw-deduplicate="TemplateStyles:r6353907">.mw-parser-output .hatnote{font-style:italic;padding-bottom:0.4em;margin-bottom:0.4em;border-bottom:1px solid #ccc}.mw-parser-output .hatnote.no-border{border-bottom:none}</style><div role="note" class="hatnote mw-tpl-seealso">See also: <a href="/wiki/Special:MyLanguage/Help:System_message" title="Special:MyLanguage/Help:System message">Help:System message</a><span style="display:none"><a href="/wiki/Help:System_message" title="Help:System message"> </a></span></div> <figure class="mw-default-size" typeof="mw:File/Thumb"><a href="/wiki/File:MediaWiki_fallback_chains.svg" class="mw-file-description"><img src="//upload.wikimedia.org/wikipedia/commons/thumb/2/26/MediaWiki_fallback_chains.svg/220px-MediaWiki_fallback_chains.svg.png" decoding="async" width="220" height="251" class="mw-file-element" srcset="//upload.wikimedia.org/wikipedia/commons/thumb/2/26/MediaWiki_fallback_chains.svg/330px-MediaWiki_fallback_chains.svg.png 1.5x, //upload.wikimedia.org/wikipedia/commons/thumb/2/26/MediaWiki_fallback_chains.svg/440px-MediaWiki_fallback_chains.svg.png 2x" data-file-width="512" data-file-height="585" /></a><figcaption>Fallback chains (Some of the lines shown are inaccurate due to double languages in the fallback. Check if the connection actually exists in the <a href="https://phabricator.wikimedia.org/T258492#6490574" class="extiw" title="phab:T258492">text version</a>)</figcaption></figure> <p>Some languages in MediaWiki have what is known as a "fallback sequence". This is where MediaWiki will fall back on a different language if it cannot find what it needs. An example of this is the language code <code>frc</code> (Cajun French), which falls back on the language code <code>fr</code> (French). The reason for this is that sometimes languages don't have all messages defined in them. </p><p>The fallback for a language can be found in its associated <code>languages/messages/MessagesXX.php</code> file. For instance <a href="https://gerrit.wikimedia.org/g/mediawiki/core/%2B/HEAD/languages/messages/MessagesFrc.php" class="extiw" title="git:mediawiki/core/+/HEAD/languages/messages/MessagesFrc.php">MessagesFrc.php</a>. You can <a rel="nofollow" class="external text" href="https://codesearch.wmcloud.org/search/?q=%5C%24fallback%20%3D&i=nope&files=languages%2Fmessages&excludeFiles=&repos=MediaWiki%20core">search the code for all uses</a>. There is also a plain list from September 2020 in <a href="https://phabricator.wikimedia.org/T258492#9028038" class="extiw" title="phab:T258492">this Phabricator comment</a>. </p> <div class="mw-heading mw-heading2"><h2 id="Site_content_language">Site content language</h2></div> <p>Viewing/getting the site content language </p><p><a href="/wiki/Special:MyLanguage/Manual:Interface/JavaScript" title="Special:MyLanguage/Manual:Interface/JavaScript">JavaScript</a><span style="display:none"><a href="/wiki/Manual:Interface/JavaScript" title="Manual:Interface/JavaScript"> </a></span>: </p> <div class="mw-highlight mw-highlight-lang-javascript mw-content-ltr" dir="ltr"><pre><span></span><span class="nx">mw</span><span class="p">.</span><span class="nx">config</span><span class="p">.</span><span class="nx">get</span><span class="p">(</span><span class="w"> </span><span class="s1">'wgContentLanguage'</span><span class="w"> </span><span class="p">);</span> </pre></div> <div class="mw-heading mw-heading2"><h2 id="User_interface_language">User interface language</h2></div> <style data-mw-deduplicate="TemplateStyles:r4199130">.mw-parser-output .mw-version{border:1px solid #72777d;font-size:80%;line-height:1.2;border-collapse:collapse}.mw-parser-output .mw-version-ltr{float:right;margin:0 0 .5em .5em;text-align:right}.mw-parser-output .mw-version-rtl{float:left;margin:0 .5em .5em 0;text-align:left}.mw-parser-output .mw-version td{padding:.1em .3em}.mw-parser-output .mw-version-versionbox{border:5px solid #00af89;text-align:center}.mw-parser-output .mw-version-versionnumber{font-weight:bold;font-size:180%}.mw-parser-output .mw-version-version .mw-version-versionbox{border-color:#c8ccd1}.mw-parser-output .mw-version.mw-version-version2 .mw-version-versionbox{border-top-color:#c8ccd1;border-right-color:#c8ccd1;border-left-color:#c8ccd1}.mw-parser-output .mw-version-version-unsupported .mw-version-versionbox{border-color:#d33}.mw-parser-output .mw-version.mw-version-version2-unsupported .mw-version-versionbox{border-top-color:#d33;border-right-color:#d33;border-left-color:#d33}.mw-parser-output .mw-version-version-legacy .mw-version-versionbox{border-color:#f93}.mw-parser-output .mw-version.mw-version-version2-legacy .mw-version-versionbox{border-top-color:#f93;border-right-color:#f93;border-left-color:#f93}.mw-parser-output .mw-version-version-stable .mw-version-versionbox,.mw-parser-output .mw-version.mw-version.mw-version-and-later .mw-version-versionbox{border-color:#00af89}.mw-parser-output .mw-version.mw-version-version2-stable .mw-version-versionbox{border-top-color:#00af89;border-right-color:#00af89;border-left-color:#00af89}.mw-parser-output .mw-version-version-future .mw-version-versionbox{border-color:#8080c0}.mw-parser-output .mw-version.mw-version-version2-future .mw-version-versionbox{border-top-color:#8080c0;border-right-color:#8080c0;border-left-color:#8080c0}.mw-parser-output .mw-version-version-alpha .mw-version-versionbox{border-style:dotted}</style> <table class="mw-version mw-version-ltr mw-version-version mw-version-version-unsupported mw-version-and-later"><tbody><tr> <td>MediaWiki version:</td> <td class="mw-version-versionbox" title="The latest stable version is 1.42"><div class="mw-version-versionnumber"><small>≥</small> 1.18</div></td> </tr></tbody></table> <dl><dt>Default value</dt> <dd> <ul><li><a href="/wiki/Special:MyLanguage/Manual:RequestContext" title="Special:MyLanguage/Manual:RequestContext">$contextSource->getLanguage()</a></li></ul></dd></dl> <dl><dt>Set via</dt></dl> <dl><dd><ul><li>Special:Preferences</li> <li><code>&uselang=zxx</code> in the URL (see <a href="/wiki/Special:MyLanguage/uselang" title="Special:MyLanguage/uselang">uselang</a>)</li> <li><code>&variant=xy</code> (or <code><a href="/wiki/Special:MyLanguage/Manual:$wgVariantArticlePath" title="Special:MyLanguage/Manual:$wgVariantArticlePath">$wgVariantArticlePath</a><span style="display:none"><a href="/wiki/Manual:$wgVariantArticlePath" title="Manual:$wgVariantArticlePath"> </a></span></code>) in the URL <b>if</b> it is a variant of your user language</li></ul></dd></dl> <dl><dt>Problems</dt> <dd>Since interface messages can come from fallback languages but the language is not returned, the actual language of each message is not known.</dd></dl> <div class="mw-heading mw-heading2"><h2 id="Page_content_language">Page content language</h2></div> <link rel="mw-deduplicated-inline-style" href="mw-data:TemplateStyles:r4199130"> <table class="mw-version mw-version-ltr mw-version-version mw-version-version-unsupported mw-version-and-later"><tbody><tr> <td>MediaWiki version:</td> <td class="mw-version-versionbox" title="The latest stable version is 1.42"><div class="mw-version-versionnumber"><small>≥</small> 1.18</div></td> </tr></tbody></table> <dl><dt>Default value</dt></dl> <dl><dd><ul><li>$wgLang on special pages.</li> <li>English for CSS and JS pages.</li> <li>For MediaWiki namespace pages, the language depends on the subpage. For example, MediaWiki:Message/ar will be set to Arabic (ar), and MediaWiki:Message will be <code>ContentLanguage</code>.</li> <li>All other pages are <code>ContentLanguage</code> by default.</li></ul></dd></dl> <dl><dt>Configuration</dt> <dd>Extensions can change all other pages through the <a href="/wiki/Special:MyLanguage/Manual:Hooks/PageContentLanguage" title="Special:MyLanguage/Manual:Hooks/PageContentLanguage">PageContentLanguage</a><span style="display:none"><a href="/wiki/Manual:Hooks/PageContentLanguage" title="Manual:Hooks/PageContentLanguage"> </a></span> hook. The value for special pages, CSS, JS, and MediaWiki namespace pages cannot be overridden.</dd></dl> <dl><dt>Examples</dt> <dd>The <a href="/wiki/Special:MyLanguage/Extension:Translate" title="Special:MyLanguage/Extension:Translate">Translate extension</a> uses it for the page translation feature. See <a href="https://translatewiki.net/wiki/Project:About/ar" class="extiw" title="translatewiki:Project:About/ar">translatewiki:Project:About/ar</a> as a translation of <a href="https://translatewiki.net/wiki/Project:About" class="extiw" title="translatewiki:Project:About">translatewiki:Project:About</a>. The directionality of the page is thus correctly set to right-to-left for Arabic.</dd></dl> <link rel="mw-deduplicated-inline-style" href="mw-data:TemplateStyles:r4199130"> <table class="mw-version mw-version-ltr mw-version-version mw-version-version-unsupported mw-version-and-later"><tbody><tr> <td>MediaWiki version:</td> <td class="mw-version-versionbox" title="The latest stable version is 1.42"><div class="mw-version-versionnumber"><small>≥</small> 1.24</div></td> </tr></tbody></table> <dl><dt>Manually changing page language</dt> <dd>Page language selection is now achievable with help of Special:PageLanguage since MediaWiki 1.24.</dd> <dd>Users can change content language of a page which is by default the default Wiki language (<code>ContentLanguage</code>). Language of pages in the MediaWiki namespace can't be changed.</dd> <dd>The feature needs to be enabled with <code class="mw-highlight"><a href="/wiki/Special:MyLanguage/Manual:$wgPageLanguageUseDB" title="Special:MyLanguage/Manual:$wgPageLanguageUseDB">$wgPageLanguageUseDB</a><span style="display:none"><a href="/wiki/Manual:$wgPageLanguageUseDB" title="Manual:$wgPageLanguageUseDB"> </a></span> = <span class="k">true</span></code> and the <code>pagelang</code> permission must be granted to a wiki user rights group (who can then perform page language changes).</dd> <dd>Changing page language causes the source translation page and its units to be moved to the correct target language. In case the target language translation page already exists, the language change isn't allowed.</dd> <dd>Matching API can be found on <a href="/wiki/Special:MyLanguage/API:SetPageLanguage" title="Special:MyLanguage/API:SetPageLanguage">API:SetPageLanguage</a><span style="display:none"><a href="/wiki/API:SetPageLanguage" title="API:SetPageLanguage"> </a></span>.</dd></dl> <dl><dt>What does it define?</dt></dl> <dl><dd><ul><li>In SkinTemplate, it adds a <code class="mw-highlight mw-highlight-lang-html mw-content-ltr" dir="ltr"><span class="p"><</span><span class="nt">div</span> <span class="na">lang</span><span class="o">=</span><span class="s">"xyz"</span> <span class="na">dir</span><span class="o">=</span><span class="s">"ltr/rtl"</span> <span class="na">class</span><span class="o">=</span><span class="s">"mw-content-ltr/rtl"</span><span class="p">></</span><span class="nt">div</span><span class="p">></span></code> around the page text. The dir attribute sets the correct <b><a href="/wiki/Special:MyLanguage/Directionality_support" title="Special:MyLanguage/Directionality support">writing direction</a></b>. The lang attribute will always be the root code, e.g. "de" even when "de-formal" is given. <dl><dd>For file pages, it is set in ImagePage.php, because there is a lot of HTML that is in the user language.</dd></dl></li> <li>In Parser.php, it sets the table of contents (TOC) numberings, and stuff like grammar, although not really relevant mostly. To do that only, use parserOptions->setTargetLanguage().</li> <li>The direction of the diff text (DifferenceEngine) is set to the page content language. In some cases this is not identical, in which case $diffEngineObject->setTextLanguage( $code ) can be used.</li> <li>Since <span class="plainlinks"><a class="external text" href="https://static-codereview.wikimedia.org/MediaWiki/94680.html">1.19</a></span>, it also sets the time and number-formatting <b><a href="/wiki/Special:MyLanguage/Help:magic_words" title="Special:MyLanguage/Help:magic words">magic words</a></b>, including DIRECTIONMARK, but not NAMESPACE(E), as that really depends on the site language. Note that including a template marked as language A onto a page with language B, will be parsed with language B on that page.</li></ul></dd></dl> <dl><dt>Multiple languages on a single page</dt> <dd>Multiple languages on a single page are in theory not supported, but simple <code class="mw-highlight mw-highlight-lang-html mw-content-ltr" dir="ltr"><span class="p"><</span><span class="nt">div</span> <span class="na">lang</span><span class="o">=</span><span class="s">"xyz"</span> <span class="na">dir</span><span class="o">=</span><span class="s">"ltr/rtl"</span> <span class="na">class</span><span class="o">=</span><span class="s">"mw-content-ltr/rtl"</span><span class="p">></span></code> tags can be used to mark text as being written in a different language. If the CSS class is used, the ul/ol lists and editsection will display nicely when the dir tag is opposite to the value of that of the page content language. Things defined in the parser, like TOC and magic words, however, will not change.</dd></dl> <dl><dt>Viewing/getting the page language</dt></dl> <ul><li><a href="/wiki/Special:MyLanguage/Manual:Interface/JavaScript" title="Special:MyLanguage/Manual:Interface/JavaScript">JavaScript</a>: <code>mw.config.get( 'wgPageContentLanguage' )</code> - note that, when e.g. viewing the page history, it will return the page language of the page it is the history of, whereas the history page doesn't have an mw-content-ltr/rtl class. I.e. both "/wiki/Page" and "/w/index.php?title=Page&action=history" will return the language of "Page". <span style="display: inline-block; border: 1px solid var( --border-color-notice, #54595d ); background-color: var( --background-color-interactive, #eaecf0 ); color: var( --color-base, #202122 ); padding: 1px 4px; margin: 0 4px; white-space:nowrap;">1.19+</span></li> <li>The page content language is mentioned on the page info view (<code>action=info</code>, linked in the toolbox) <span style="display: inline-block; border: 1px solid var( --border-color-notice, #54595d ); background-color: var( --background-color-interactive, #eaecf0 ); color: var( --color-base, #202122 ); padding: 1px 4px; margin: 0 4px; white-space:nowrap;"><a href="https://gerrit.wikimedia.org/r/30099" class="extiw" title="gerrit:30099">1.21+</a></span></li> <li>The page content language can be retrieved in the <a href="/wiki/Special:MyLanguage/API" title="Special:MyLanguage/API">API</a> via <a href="/wiki/Special:MyLanguage/API:Properties" title="Special:MyLanguage/API:Properties">api.php?action=query&prop=info</a> <span style="display: inline-block; border: 1px solid var( --border-color-notice, #54595d ); background-color: var( --background-color-interactive, #eaecf0 ); color: var( --color-base, #202122 ); padding: 1px 4px; margin: 0 4px; white-space:nowrap;"><a href="https://gerrit.wikimedia.org/r/64512" class="extiw" title="gerrit:64512">1.22+</a></span></li></ul> <div class="mw-heading mw-heading2"><h2 id="Code_structure">Code structure</h2></div> <p>First, you have a Language object in <a href="/wiki/Special:MyLanguage/Manual:Code#Language.php" title="Special:MyLanguage/Manual:Code">Language.php</a><span style="display:none"><a href="/wiki/Manual:Code#Language.php" title="Manual:Code"> </a></span>. This object contains all the localisable <a href="/wiki/Special:MyLanguage/Help:System_message" title="Special:MyLanguage/Help:System message">message strings</a>, as well as other important language-specific settings and custom behavior (uppercasing, lowercasing, printing dates, formatting numbers, <a href="/wiki/Special:MyLanguage/Directionality_support" title="Special:MyLanguage/Directionality support">direction</a>, <a href="/wiki/Special:MyLanguage/Manual:Messages_API#…on_use_context_inside_sentences_via_GRAMMAR" title="Special:MyLanguage/Manual:Messages API">custom grammar rules</a> <i>etc.</i>). </p><p>The object is constructed from two sources: sub-classed versions of itself (classes) and Message files (messages). </p><p>There's also the MessageCache class, which handles input of text via the MediaWiki namespace. Most internationalisation is nowadays done via <a href="/wiki/Special:MyLanguage/Manual:Messages_API" title="Special:MyLanguage/Manual:Messages API">Manual:Messages API</a><span style="display:none"><a href="/wiki/Manual:Messages_API" title="Manual:Messages API"> </a></span> objects and by using the <code>wfMessage()</code> shortcut function, which is defined in <code>includes/GlobalFunctions.php</code>. Legacy code might still be using the old <code>wfMsg*()</code> functions, which are now considered deprecated in favor of the above-mentioned Message objects. </p><p>See also <a href="/wiki/Special:MyLanguage/Manual:Messages_API" title="Special:MyLanguage/Manual:Messages API">Manual:Messages API</a><span style="display:none"><a href="/wiki/Manual:Messages_API" title="Manual:Messages API"> </a></span>. </p> <div class="mw-heading mw-heading3"><h3 id="Language_objects">Language objects</h3></div> <p>There are two ways to get a language object. You can use the globals <a href="/wiki/Special:MyLanguage/Manual:$wgLang" title="Special:MyLanguage/Manual:$wgLang">$wgLang</a><span style="display:none"><a href="/wiki/Manual:$wgLang" title="Manual:$wgLang"> </a></span> and <code>ContentLanguage</code> service (<code>MediaWiki\MediaWikiServices::getContentLanguage</code>) for user interface and content language respectively. For an arbitrary language you can construct an object by using <code class="mw-highlight mw-highlight-lang-php mw-content-ltr" style="" dir="ltr"><span class="nv">$languageFactory</span><span class="o">-></span><span class="na">getLanguage</span><span class="p">(</span> <span class="s1">'en'</span> <span class="p">)</span></code> by replacing <code>en</code> with the code of the language. You can get <code class="mw-highlight mw-highlight-lang-php mw-content-ltr" style="" dir="ltr"><span class="nv">$languageFactory</span></code>, an object of the <code class="mw-highlight mw-highlight-lang-php mw-content-ltr" style="" dir="ltr"><span class="nx">MediaWiki\Languages\LanguageFactory</span></code> class, using <a href="/wiki/Special:MyLanguage/Dependency_Injection" title="Special:MyLanguage/Dependency Injection">Dependency Injection</a><span style="display:none"><a href="/wiki/Dependency_Injection" title="Dependency Injection"> </a></span>. You can also use <code class="mw-highlight mw-highlight-lang-php mw-content-ltr" dir="ltr"><span class="nx">wfGetLangObj</span><span class="p">(</span> <span class="nv">$code</span> <span class="p">);</span></code> if <code class="mw-highlight mw-highlight-lang-php mw-content-ltr" dir="ltr"><span class="nv">$code</span></code> could already be a language object. The list of codes is in <code>includes/languages/data/Names.php</code>. </p><p>Language objects are needed for doing language-specific functions, most often to do number, time and date formatting, but also to construct lists and other things. There are multiple layers of caching and merging with <a href="#Fallback_languages">#Fallback languages</a>, but the details are irrelevant in normal use. </p> <div class="mw-heading mw-heading2"><h2 id="Old_local_translation_system">Old local translation system</h2></div> <p>With MediaWiki 1.3.0, a new system was set up for localising MediaWiki. Instead of editing the language file and asking developers to apply the change, users could edit the interface strings directly from their wikis. This is the system in use as of August 2005. People can find the message they want to translate in <a href="/wiki/Special:AllMessages" title="Special:AllMessages">Special:AllMessages</a> and then edit the relevant string in the <code>MediaWiki:</code> namespace. Once edited, these changes are live. There was no more need to request an update, and wait for developers to check and update the file. </p><p>The system is great for Wikipedia projects; however a side effect is that the MediaWiki language files shipped with the software are no longer quite up-to-date, and it is harder for developers to keep the files on meta in sync with the real language files. </p><p>As the default language files do not provide enough translated material, we face two problems: </p> <ol><li>New Wikimedia projects created in a language which has not been updated for a long time, need a total re-translation of the interface.</li> <li>Other users of MediaWiki (including Wikimedia projects in the same language) are left with untranslated interfaces. This is especially unfortunate for the smaller languages which don't have many translators.</li></ol> <p>This is not such a big issue anymore, because translatewiki.net is advertised prominently and used by almost all translations. Local translations still do happen sometimes but they're strongly discouraged. Local messages mostly have to be deleted, moving the relevant translations to translatewiki.net and leaving on the wiki only the site-specific customisation; there's a huge backlog especially in older projects, <a rel="nofollow" class="external text" href="//toolserver.org/~robin/?tool=cleanuplocalmsgs">this tool</a> helps with cleanup. </p> <div class="mw-heading mw-heading2"><h2 id="Keeping_messages_centralised_and_in_sync">Keeping messages centralised and in sync</h2></div> <p>English messages are very rarely out of sync with the code. Experience has shown that it's convenient to have all the English messages in the same place. Revising the English text can be done without reference to the code, just like translation can. Programmers sometimes make very poor choices for the default text. </p><p><span class="anchor" id="what-can-be-localized"></span> </p> <div class="mw-heading mw-heading2"><h2 id="What_can_be_localised">What can be localised</h2></div> <p>So many things are localisable on MediaWiki that not all of them are directly available on <a href="/wiki/Special:MyLanguage/translatewiki.net" title="Special:MyLanguage/translatewiki.net">translatewiki.net</a><span style="display:none"><a href="/wiki/Translatewiki.net" title="Translatewiki.net"> </a></span>: see <a href="https://translatewiki.net/wiki/Translating:MediaWiki" class="extiw" title="translatewiki:Translating:MediaWiki">translatewiki:Translating:MediaWiki</a>. If something requires a <a href="/wiki/Special:MyLanguage/Developers" title="Special:MyLanguage/Developers">developer</a> intervention on the code, you can <a href="/wiki/Special:MyLanguage/How_to_report_a_bug" title="Special:MyLanguage/How to report a bug">request it on Phabricator</a>, or ask at <a href="https://translatewiki.net/wiki/Support" class="extiw" title="translatewiki:Support">translatewiki:Support</a> if you don't know what to do exactly. </p> <ul><li><a href="#Namespaces">Namespaces</a> - both core and extensions, plus <a href="/wiki/Special:MyLanguage/Manual:Messages_API#Users_have_grammatical_genders" title="Special:MyLanguage/Manual:Messages API">gender</a>-dependent user namespaces</li> <li>Weekdays (and abbreviations)</li> <li>Months (and abbreviations)</li> <li>Bookstores for <a href="/wiki/Special:BookSources" title="Special:BookSources">Special:BookSources</a></li> <li>Skin names</li> <li>Math names</li> <li><a href="/wiki/Special:MyLanguage/Manual:Date_formatting" title="Special:MyLanguage/Manual:Date formatting">Date preferences</a><span style="display:none"><a href="/wiki/Manual:Date_formatting" title="Manual:Date formatting"> </a></span> - <code>$datePreferences</code></li> <li><a href="/wiki/Special:MyLanguage/Manual:Date_formatting" title="Special:MyLanguage/Manual:Date formatting">Date formats</a><span style="display:none"><a href="/wiki/Manual:Date_formatting" title="Manual:Date formatting"> </a></span> - <code>$dateFormats</code></li> <li><a href="/wiki/Special:MyLanguage/Manual:Date_formatting" title="Special:MyLanguage/Manual:Date formatting">Default date format</a><span style="display:none"><a href="/wiki/Manual:Date_formatting" title="Manual:Date formatting"> </a></span> - <code>$defaultDateFormat</code></li> <li><a href="/wiki/Special:MyLanguage/Manual:Date_formatting" title="Special:MyLanguage/Manual:Date formatting">Date preference migration map</a><span style="display:none"><a href="/wiki/Manual:Date_formatting" title="Manual:Date formatting"> </a></span> - for compatibility with old MediaWiki databases</li> <li>Default user option overrides</li> <li>Language names</li> <li>Country names (via <a href="/wiki/Special:MyLanguage/Extension:CLDR" title="Special:MyLanguage/Extension:CLDR">Extension:CLDR</a><span style="display:none"><a href="/wiki/Extension:CLDR" title="Extension:CLDR"> </a></span>)</li> <li>Currency names (via <a href="/wiki/Special:MyLanguage/Extension:CLDR" title="Special:MyLanguage/Extension:CLDR">Extension:CLDR</a><span style="display:none"><a href="/wiki/Extension:CLDR" title="Extension:CLDR"> </a></span>)</li> <li>Timezones</li> <li>Character encoding conversion via <a href="https://en.wikipedia.org/wiki/en:Iconv" class="extiw" title="w:en:Iconv"><code>iconv</code></a></li> <li>UpperLowerCase first (needs casemaps for some)<sup class="noprint Inline-Template" style="white-space:nowrap;">[<i><a href="https://en.wikipedia.org/wiki/Wikipedia:Please_clarify" class="extiw" title="wikipedia:Wikipedia:Please clarify"><span title="The text in the vicinity of this tag needs clarification or removal of jargon">clarification needed</span></a></i>]</sup></li> <li>UpperLowerCase<sup class="noprint Inline-Template" style="white-space:nowrap;">[<i><a href="https://en.wikipedia.org/wiki/Wikipedia:Please_clarify" class="extiw" title="wikipedia:Wikipedia:Please clarify"><span title="The text in the vicinity of this tag needs clarification or removal of jargon">clarification needed</span></a></i>]</sup></li> <li>Uppercase words</li> <li>Uppercase word breaks<sup class="noprint Inline-Template" style="white-space:nowrap;">[<i><a href="https://en.wikipedia.org/wiki/Wikipedia:Please_clarify" class="extiw" title="wikipedia:Wikipedia:Please clarify"><span title="The text in the vicinity of this tag needs clarification or removal of jargon">clarification needed</span></a></i>]</sup></li> <li>Case folding<sup class="noprint Inline-Template" style="white-space:nowrap;">[<i><a href="https://en.wikipedia.org/wiki/Wikipedia:Please_clarify" class="extiw" title="wikipedia:Wikipedia:Please clarify"><span title="The text in the vicinity of this tag needs clarification or removal of jargon">clarification needed</span></a></i>]</sup></li> <li>Strip punctuation for MySQL search (search optimisation)</li> <li>Get first character</li> <li>Alternate encoding</li> <li>Recoding for edit (and then recode input)<sup class="noprint Inline-Template" style="white-space:nowrap;">[<i><a href="https://en.wikipedia.org/wiki/Wikipedia:Please_clarify" class="extiw" title="wikipedia:Wikipedia:Please clarify"><span title="The text in the vicinity of this tag needs clarification or removal of jargon">clarification needed</span></a></i>]</sup></li></ul> <figure class="mw-default-size" typeof="mw:File/Thumb"><a href="/wiki/File:MediaWiki_fallback_chains.svg" class="mw-file-description"><img src="//upload.wikimedia.org/wikipedia/commons/thumb/2/26/MediaWiki_fallback_chains.svg/220px-MediaWiki_fallback_chains.svg.png" decoding="async" width="220" height="251" class="mw-file-element" srcset="//upload.wikimedia.org/wikipedia/commons/thumb/2/26/MediaWiki_fallback_chains.svg/330px-MediaWiki_fallback_chains.svg.png 1.5x, //upload.wikimedia.org/wikipedia/commons/thumb/2/26/MediaWiki_fallback_chains.svg/440px-MediaWiki_fallback_chains.svg.png 2x" data-file-width="512" data-file-height="585" /></a><figcaption>Graph of language fallback</figcaption></figure> <ul><li><a href="/wiki/Special:MyLanguage/Manual:Language" title="Special:MyLanguage/Manual:Language">Fallback languages</a> (that is, other more closely related language(s) to use when a translation is not available, instead of the default fallback, which is English)</li> <li>Directionality (left to right or right to left, RTL)</li> <li>Direction mark character depending on RTL</li> <li>Arrow depending on RTL</li> <li>Languages where italics cannot be used</li> <li>Number formatting (comma-ify, <i>i.e.</i> adding or not digits separators; transform digits; transform separators)<sup id="cite_ref-3" class="reference"><a href="#cite_note-3"><span class="cite-bracket">[</span>3<span class="cite-bracket">]</span></a></sup></li> <li>Truncate (multibyte)</li> <li><a href="/wiki/Special:MyLanguage/Manual:Messages_API#…on_use_context_inside_sentences_via_GRAMMAR" title="Special:MyLanguage/Manual:Messages API">Grammar conversions for inflected languages</a><span style="display:none"><a href="/wiki/Manual:Messages_API#…on_use_context_inside_sentences_via_GRAMMAR" title="Manual:Messages API"> </a></span></li> <li><a href="/wiki/Special:MyLanguage/Manual:Messages_API#Be_aware_of_PLURAL_use_on_all_numbers" title="Special:MyLanguage/Manual:Messages API">Plural transformations</a><span style="display:none"><a href="/wiki/Manual:Messages_API#Be_aware_of_PLURAL_use_on_all_numbers" title="Manual:Messages API"> </a></span></li> <li>Formatting expiry times<sup class="noprint Inline-Template" style="white-space:nowrap;">[<i><a href="https://en.wikipedia.org/wiki/Wikipedia:Please_clarify" class="extiw" title="wikipedia:Wikipedia:Please clarify"><span title="The text in the vicinity of this tag needs clarification or removal of jargon">clarification needed</span></a></i>]</sup></li> <li>Segmenting for diffs (Chinese)</li> <li>Convert to variants of language (between different orthographies, or scripts)</li> <li>Language specific user preference options</li> <li><a href="/wiki/Special:MyLanguage/Help:Links#linktrail" title="Special:MyLanguage/Help:Links">Link trails</a> and link prefix - <code>$linkTrail</code>. These are letters that can be glued after/before the closing/opening brackets of a wiki link, but appear rendered on the screen as if part of the link (that is, clickable and in the same colour), <i>e.g.</i>: <code>[[foo]]bar</code>. By default the link trail is "a-z"; you may want to add the accentuated or non-Latin letters used by your language to the list.</li> <li>Language code (preferably used according to the latest RFC in standard BCP 47, currently <a href="//tools.ietf.org/html/rfc5646" class="extiw" title="rfc:5646">RFC<style data-mw-deduplicate="TemplateStyles:r4673781">'"`UNIQ--templatestyles-00000019-QINU`"'</style><span class="nowrap"> </span>5646</a>, with its associated IANA database. Avoid deprecated, grandfathered and private-use codes: look at what they mean in standard ISO 639, and avoid codes assigned to collections/families of languages in ISO 639-5, and ISO 639 codes which were not imported in the IANA database for BCP 47)</li> <li>Type of emphasising</li> <li>The <a href="/wiki/Special:MyLanguage/Extension:Cite" title="Special:MyLanguage/Extension:Cite">Cite</a><span style="display:none"><a href="/wiki/Extension:Cite" title="Extension:Cite"> </a></span> extension has a special page file per language, <code>cite_text-<i>zyx</i></code> for language code <code>zyx</code>.</li></ul> <p>Neat functionality: </p> <ul><li>I18N <code>sprintfDate</code></li> <li>Roman numeral formatting</li></ul> <div class="mw-heading mw-heading3"><h3 id="Namespaces">Namespaces</h3></div> <dl><dd></dd></dl> <p>Currently making namespace name translations is disabled on translatewiki.net, so you need to do this yourself in Gerrit, or file a <a href="/wiki/Special:MyLanguage/Phabricator" title="Special:MyLanguage/Phabricator">Phabricator</a><span style="display:none"><a href="/wiki/Phabricator" title="Phabricator"> </a></span> task asking for someone else to do it.<sup id="cite_ref-4" class="reference"><a href="#cite_note-4"><span class="cite-bracket">[</span>4<span class="cite-bracket">]</span></a></sup> </p><p>To allow custom namespaces introduced by your extension to be translated, create a <code><i>MyExtension</i>.i18n.namespaces.php</code> file that looks like this: </p> <div class="mw-highlight mw-highlight-lang-php mw-content-ltr" dir="ltr"><pre><span></span><span class="cp"><?php</span> <span class="sd">/**</span> <span class="sd"> * Translations of the namespaces introduced by MyExtension.</span> <span class="sd"> *</span> <span class="sd"> * @file</span> <span class="sd"> */</span> <span class="nv">$namespaceNames</span> <span class="o">=</span> <span class="p">[];</span> <span class="c1">// For wikis where the MyExtension extension is not installed.</span> <span class="k">if</span><span class="p">(</span> <span class="o">!</span><span class="nb">defined</span><span class="p">(</span> <span class="s1">'NS_MYEXTENSION'</span> <span class="p">)</span> <span class="p">)</span> <span class="p">{</span> <span class="nb">define</span><span class="p">(</span> <span class="s1">'NS_MYEXTENSION'</span><span class="p">,</span> <span class="mi">2510</span> <span class="p">);</span> <span class="p">}</span> <span class="k">if</span><span class="p">(</span> <span class="o">!</span><span class="nb">defined</span><span class="p">(</span> <span class="s1">'NS_MYEXTENSION_TALK'</span> <span class="p">)</span> <span class="p">)</span> <span class="p">{</span> <span class="nb">define</span><span class="p">(</span> <span class="s1">'NS_MYEXTENSION_TALK'</span><span class="p">,</span> <span class="mi">2511</span> <span class="p">);</span> <span class="p">}</span> <span class="sd">/** English */</span> <span class="nv">$namespaceNames</span><span class="p">[</span><span class="s1">'en'</span><span class="p">]</span> <span class="o">=</span> <span class="p">[</span> <span class="nx">NS_MYEXTENSION</span> <span class="o">=></span> <span class="s1">'MyNamespace'</span><span class="p">,</span> <span class="nx">NS_MYEXTENSION_TALK</span> <span class="o">=></span> <span class="s1">'MyNamespace_talk'</span><span class="p">,</span> <span class="p">];</span> <span class="sd">/** Finnish (Suomi) */</span> <span class="nv">$namespaceNames</span><span class="p">[</span><span class="s1">'fi'</span><span class="p">]</span> <span class="o">=</span> <span class="p">[</span> <span class="nx">NS_MYEXTENSION</span> <span class="o">=></span> <span class="s1">'Nimiavaruuteni'</span><span class="p">,</span> <span class="nx">NS_MYEXTENSION_TALK</span> <span class="o">=></span> <span class="s1">'Keskustelu_nimiavaruudestani'</span><span class="p">,</span> <span class="p">];</span> </pre></div> <p>Then load it from the <code>extension.json</code> file using ExtensionMessagesFiles like this: </p> <div class="mw-highlight mw-highlight-lang-json mw-content-ltr" dir="ltr"><pre><span></span><span class="p">{</span> <span class="w"> </span><span class="nt">"name"</span><span class="p">:</span><span class="w"> </span><span class="s2">"MyExtension"</span><span class="p">,</span> <span class="w"> </span><span class="nt">"version"</span><span class="p">:</span><span class="w"> </span><span class="s2">"0.0.1"</span><span class="p">,</span> <span class="w"> </span><span class="nt">"descriptionmsg"</span><span class="p">:</span><span class="w"> </span><span class="s2">"myextension-desc"</span><span class="p">,</span> <span class="w"> </span><span class="nt">"ExtensionMessagesFiles"</span><span class="p">:</span><span class="w"> </span><span class="p">{</span> <span class="w"> </span><span class="nt">"MyExtensionNamespaces"</span><span class="p">:</span><span class="w"> </span><span class="s2">"MyExtension.i18n.namespaces.php"</span> <span class="w"> </span><span class="p">}</span> <span class="p">}</span> </pre></div> <p>Now, when a user installs MyExtension on their Finnish (fi) wiki, the custom namespace will be translated into Finnish magically, and the user doesn't need to do a thing! </p><p>Also remember to register your extension's namespace(s) on the <a href="/wiki/Special:MyLanguage/extension_default_namespaces" title="Special:MyLanguage/extension default namespaces">Extension default namespaces</a><span style="display:none"><a href="/wiki/Extension_default_namespaces" title="Extension default namespaces"> </a></span> page. </p> <div class="mw-heading mw-heading3"><h3 id="Special_page_aliases">Special page aliases</h3></div> <p>See <a href="/wiki/Manual:Special_pages#The_aliases_file" title="Manual:Special pages">the manual page for Special pages</a> for up-to-date information. The following does not appear to be valid. </p><p><br /> Create a new file for the special page aliases in this format: </p> <div class="mw-highlight mw-highlight-lang-php mw-content-ltr" dir="ltr"><pre><span></span><span class="cp"><?php</span> <span class="sd">/**</span> <span class="sd"> * Aliases for the MyExtension extension.</span> <span class="sd"> *</span> <span class="sd"> * @file</span> <span class="sd"> * @ingroup Extensions</span> <span class="sd"> */</span> <span class="nv">$aliases</span> <span class="o">=</span> <span class="p">[];</span> <span class="sd">/** English */</span> <span class="nv">$aliases</span><span class="p">[</span><span class="s1">'en'</span><span class="p">]</span> <span class="o">=</span> <span class="p">[</span> <span class="s1">'MyExtension'</span> <span class="o">=></span> <span class="p">[</span> <span class="s1">'MyExtension'</span> <span class="p">]</span> <span class="p">];</span> <span class="sd">/** Finnish (Suomi) */</span> <span class="nv">$aliases</span><span class="p">[</span><span class="s1">'fi'</span><span class="p">]</span> <span class="o">=</span> <span class="p">[</span> <span class="s1">'MyExtension'</span> <span class="o">=></span> <span class="p">[</span> <span class="s1">'Lisäosani'</span> <span class="p">]</span> <span class="p">];</span> </pre></div> <p>Then load it from the <code>extension.json</code> file using ExtensionMessagesFiles like this: </p> <div class="mw-highlight mw-highlight-lang-json mw-content-ltr" dir="ltr"><pre><span></span><span class="p">{</span> <span class="w"> </span><span class="nt">"name"</span><span class="p">:</span><span class="w"> </span><span class="s2">"MyExtension"</span><span class="p">,</span> <span class="w"> </span><span class="nt">"version"</span><span class="p">:</span><span class="w"> </span><span class="s2">"0.0.1"</span><span class="p">,</span> <span class="w"> </span><span class="nt">"descriptionmsg"</span><span class="p">:</span><span class="w"> </span><span class="s2">"myextension-desc"</span><span class="p">,</span> <span class="w"> </span><span class="nt">"ExtensionMessagesFiles"</span><span class="p">:</span><span class="w"> </span><span class="p">{</span> <span class="w"> </span><span class="nt">"MyExtensionAlias"</span><span class="p">:</span><span class="w"> </span><span class="s2">"MyExtension.i18n.alias.php"</span> <span class="w"> </span><span class="p">}</span> <span class="p">}</span> </pre></div> <p>When your special page code uses either <code class="mw-highlight mw-highlight-lang-php mw-content-ltr" style="" dir="ltr"><span class="nx">SpecialPage</span><span class="o">::</span><span class="na">getTitleFor</span><span class="p">(</span> <span class="s1">'MyExtension'</span> <span class="p">)</span></code> or <code class="mw-highlight mw-highlight-lang-php mw-content-ltr" style="" dir="ltr"><span class="nv">$this</span><span class="o">-></span><span class="na">getTitle</span><span class="p">()</span></code> (in the class that provides Special:MyExtension), the localised alias will be used, if it's available. </p> <div class="mw-heading mw-heading3"><h3 id="Namespace_name_aliases">Namespace name aliases</h3></div> <p>Namespace name aliases are additional names which can be used to address existing namespaces. They are rarely needed, but not having them when they are, usually creates havoc in existing wikis. </p><p>You need namespace name aliases: </p> <ol><li>When a language has variants, and these variants spell some namespaces differently, and you want editors to be able to use the variant spellings. Variants are selectable in the user preferences. Users always see their selected variant, except in wikitext, but when editing or searching, an arbitrary variant can be used.</li> <li>When an existing wiki's language, fall back language(s), or localisation is changed, with it are changed some namespace names. So as not to break the links already present in the wiki, that are using the old namespace names, you need to add each of the altered previous namespace names to its namespace name aliases, when, or before, the change is made.</li></ol> <p>The generic English namespace names are always present as namespace name aliases in all localisations, so you need not, and should not, add those. </p><p>Aliases can't be translated on <a href="/wiki/Special:MyLanguage/translatewiki.net" title="Special:MyLanguage/translatewiki.net">Translatewiki.net</a><span style="display:none"><a href="/wiki/Translatewiki.net" title="Translatewiki.net"> </a></span>, but can be requested there or on <a href="/wiki/Special:MyLanguage/bugzilla" title="Special:MyLanguage/bugzilla">Bugzilla</a><span style="display:none"><a href="/wiki/Bugzilla" title="Bugzilla"> </a></span>: see <a href="https://translatewiki.net/wiki/Translating:MediaWiki#Namespace_name_aliases" class="extiw" title="translatewiki:Translating:MediaWiki">translatewiki:Translating:MediaWiki#Namespace name aliases</a>. </p> <div class="mw-heading mw-heading3"><h3 id="Regional_settings">Regional settings</h3></div> <p>Some linguistic settings vary across geographies; MediaWiki doesn't have a concept of region, it only has languages and language variants. </p><p>These settings need to be set once as a language's default, then individual wikis can change them as they wish in their configuration. </p> <div class="mw-heading mw-heading5"><h5 id="Time_and_date_formats">Time and date formats</h5></div> <p>Time and dates are shown on special pages and alike. The default time and date format is used for signatures, so it should be the most used and most widely understood format for users of that language. Also anonymous users see the default format. Registered users can choose other formats in their preferences. </p><p>If you are familiar with PHP's time() format, you can try to construct formats yourself. MediaWiki uses a similar format string, with some extra features. If you don't understand the previous sentence, that's OK. You can provide a list of examples for <a href="/wiki/Special:MyLanguage/Developers" title="Special:MyLanguage/Developers">Developers</a><span style="display:none"><a href="/wiki/Developers" title="Developers"> </a></span>. </p><p>See <a href="/wiki/Special:MyLanguage/Help:System_message#Message_sources" title="Special:MyLanguage/Help:System message">Help:System message#Message sources</a>. </p> <div class="mw-heading mw-heading2"><h2 id="Notes">Notes</h2></div> <div class="mw-references-wrap"><ol class="references"> <li id="cite_note-1"><span class="mw-cite-backlink"><a href="#cite_ref-1">↑</a></span> <span class="reference-text">See <a href="https://phabricator.wikimedia.org/diffusion/MW/browse/master/includes/languages/data/Names.php" class="extiw" title="phab:diffusion/MW/browse/master/includes/languages/data/Names.php">includes/languages/data/Names.php</a>.</span> </li> <li id="cite_note-2"><span class="mw-cite-backlink"><a href="#cite_ref-2">↑</a></span> <span class="reference-text">Despite this, as of 2012 language codes validation is not yet a solved problem. See Niklas Laxström, <i><a rel="nofollow" class="external text" href="http://laxstrom.name/blag/2012/08/28/language-validation-in-mediawiki/">Language validation in MediaWiki</a></i>, August 28th, 2012.</span> </li> <li id="cite_note-3"><span class="mw-cite-backlink"><a href="#cite_ref-3">↑</a></span> <span class="reference-text"> These are configured by language in the respective <code>language/classes/LanguageXx.php</code> or <code>language/messages/MessagesXx.php</code> files.</span> </li> <li id="cite_note-4"><span class="mw-cite-backlink"><a href="#cite_ref-4">↑</a></span> <span class="reference-text"> <a href="https://gerrit.wikimedia.org/r/211677" class="extiw" title="gerrit:211677">https://gerrit.wikimedia.org/r/211677</a></span> </li> </ol></div> <div class="mw-heading mw-heading2"><h2 id="See_also">See also</h2></div> <ul><li><a href="/wiki/Special:MyLanguage/Multilingual_MediaWiki" title="Special:MyLanguage/Multilingual MediaWiki">Multilingual MediaWiki</a></li> <li>Obtaining language names from codes is possible using the core function {{#language:<code>}} documented in <a href="/wiki/Special:MyLanguage/Help:magic_words" title="Special:MyLanguage/Help:magic words">magic words</a></li></ul> <!-- NewPP limit report Parsed by mw‐web.codfw.main‐7d89b5d4c4‐m9bjp Cached time: 20241120181840 Cache expiry: 2592000 Reduced expiry: false Complications: [show‐toc] CPU time usage: 0.644 seconds Real time usage: 0.991 seconds Preprocessor visited node count: 4899/1000000 Post‐expand include size: 30766/2097152 bytes Template argument size: 13154/2097152 bytes Highest expansion depth: 20/100 Expensive parser function count: 53/500 Unstrip recursion depth: 0/20 Unstrip post‐expand size: 25091/5000000 bytes Lua time usage: 0.101/10.000 seconds Lua memory usage: 1765914/52428800 bytes Number of Wikibase entities loaded: 0/400 --> <!-- Transclusion expansion time report (%,ms,calls,template) 100.00% 507.795 1 -total 47.86% 243.041 40 Template:Ll 27.23% 138.254 1 Template:I18n_navigation 26.18% 132.956 1 Template:Nmbox 22.05% 111.954 1 Template:Flatlist 21.65% 109.916 82 Template:Translatable 18.91% 96.016 42 Template:Pagelang 10.78% 54.760 2 Template:MW_1.18 10.31% 52.341 3 Template:MW_version/en 9.32% 47.338 3 Template:MW_version/layout --> <!-- Saved in parser cache with key mediawikiwiki:pcache:idhash:66137-0!canonical and timestamp 20241120181840 and revision id 6815012. Rendering was triggered because: page-view --> </div><!--esi <esi:include src="/esitest-fa8a495983347898/content" /> --><noscript><img src="https://login.wikimedia.org/wiki/Special:CentralAutoLogin/start?type=1x1" alt="" width="1" height="1" style="border: none; position: absolute;"></noscript> <div class="printfooter" data-nosnippet="">Retrieved from "<a dir="ltr" href="https://www.mediawiki.org/w/index.php?title=Manual:Language&oldid=6815012">https://www.mediawiki.org/w/index.php?title=Manual:Language&oldid=6815012</a>"</div></div> <div id="catlinks" class="catlinks" data-mw="interface"><div id="mw-normal-catlinks" class="mw-normal-catlinks"><a href="/wiki/Special:Categories" title="Special:Categories">Category</a>: <ul><li><a href="/wiki/Category:Localisation" title="Category:Localisation">Localisation</a></li></ul></div></div> </div> </main> </div> <div class="mw-footer-container"> <footer id="footer" class="mw-footer" > <ul id="footer-info"> <li id="footer-info-lastmod"> This page was last edited on 27 October 2024, at 19:56.</li> <li id="footer-info-copyright">Text is available under the <a rel="nofollow" class="external text" href="https://creativecommons.org/licenses/by-sa/4.0/deed.en">Creative Commons Attribution-ShareAlike License</a>; additional terms may apply. Text in <a class="external text" href="https://www.mediawiki.org/wiki/Special:MyLanguage/Help:Contents">the Help: namespace</a> is available under the <a rel="nofollow" class="external text" href="https://creativecommons.org/publicdomain/zero/1.0/">Creative Commons CC0 License</a>. By using this site, you agree to the <a class="external text" href="https://foundation.wikimedia.org/wiki/Special:MyLanguage/Policy:Terms_of_Use">Terms of Use</a> and <a class="external text" href="https://foundation.wikimedia.org/wiki/Special:MyLanguage/Policy:Privacy_policy">Privacy Policy</a>.</li> </ul> <ul id="footer-places"> <li id="footer-places-privacy"><a href="https://foundation.wikimedia.org/wiki/Special:MyLanguage/Policy:Privacy_policy">Privacy policy</a></li> <li id="footer-places-about"><a href="/wiki/Project:About">About mediawiki.org</a></li> <li id="footer-places-disclaimers"><a href="/wiki/Project:General_disclaimer">Disclaimers</a></li> <li id="footer-places-wm-codeofconduct"><a href="https://www.mediawiki.org/wiki/Special:MyLanguage/Code_of_Conduct">Code of Conduct</a></li> <li id="footer-places-developers"><a href="https://developer.wikimedia.org">Developers</a></li> <li id="footer-places-statslink"><a href="https://stats.wikimedia.org/#/www.mediawiki.org">Statistics</a></li> <li id="footer-places-cookiestatement"><a href="https://foundation.wikimedia.org/wiki/Special:MyLanguage/Policy:Cookie_statement">Cookie statement</a></li> <li id="footer-places-mobileview"><a href="//m.mediawiki.org/w/index.php?title=Manual:Language&mobileaction=toggle_view_mobile" class="noprint stopMobileRedirectToggle">Mobile view</a></li> </ul> <ul id="footer-icons" class="noprint"> <li id="footer-copyrightico"><a href="https://wikimediafoundation.org/" class="cdx-button cdx-button--fake-button cdx-button--size-large cdx-button--fake-button--enabled"><img src="/static/images/footer/wikimedia-button.svg" width="84" height="29" alt="Wikimedia Foundation" loading="lazy"></a></li> <li id="footer-poweredbyico"><a href="https://www.mediawiki.org/" class="cdx-button cdx-button--fake-button cdx-button--size-large cdx-button--fake-button--enabled"><img src="/w/resources/assets/poweredby_mediawiki.svg" alt="Powered by MediaWiki" width="88" height="31" loading="lazy"></a></li> </ul> </footer> </div> </div> </div> <div class="vector-settings" id="p-dock-bottom"> <ul></ul> </div><script>(RLQ=window.RLQ||[]).push(function(){mw.config.set({"wgHostname":"mw-web.codfw.main-f69cdc8f6-w24zn","wgBackendResponseTime":116,"wgPageParseReport":{"limitreport":{"cputime":"0.644","walltime":"0.991","ppvisitednodes":{"value":4899,"limit":1000000},"postexpandincludesize":{"value":30766,"limit":2097152},"templateargumentsize":{"value":13154,"limit":2097152},"expansiondepth":{"value":20,"limit":100},"expensivefunctioncount":{"value":53,"limit":500},"unstrip-depth":{"value":0,"limit":20},"unstrip-size":{"value":25091,"limit":5000000},"entityaccesscount":{"value":0,"limit":400},"timingprofile":["100.00% 507.795 1 -total"," 47.86% 243.041 40 Template:Ll"," 27.23% 138.254 1 Template:I18n_navigation"," 26.18% 132.956 1 Template:Nmbox"," 22.05% 111.954 1 Template:Flatlist"," 21.65% 109.916 82 Template:Translatable"," 18.91% 96.016 42 Template:Pagelang"," 10.78% 54.760 2 Template:MW_1.18"," 10.31% 52.341 3 Template:MW_version/en"," 9.32% 47.338 3 Template:MW_version/layout"]},"scribunto":{"limitreport-timeusage":{"value":"0.101","limit":"10.000"},"limitreport-memusage":{"value":1765914,"limit":52428800}},"cachereport":{"origin":"mw-web.codfw.main-7d89b5d4c4-m9bjp","timestamp":"20241120181840","ttl":2592000,"transientcontent":false}}});});</script> </body> </html>