I have added some contents to the mediawiki sidebar(Mediawiki:Sidebar). When I changed the language from English to Malayalam using the UniversalLanguageSelector, everything in the sidebar except the newly added contents got translated. My question:
What do I do to get all the sidebar contents to be translated to Malayalam?
Can I add those contents along with the translations to some file in the extension's folder so that it also will get translated?
The easiest way to localize the sidebar, is to use system message as variables. E.g., rather than adding the link
*mw-mainpage-url|My mainpage
in English,*mw-mainpage-url|Min huvudsida
in Swedish, etc, just do*mw-mainpage-url|mainpage-description
inMediaWiki:Sidebar
, and then usemainpage-description/en
,mainpage-description/sv
, etc to change the translation of that part of the sidebar. This way you only need to change the sidebar layout in one place, and you can make use of the many translations already available, as well as create your own, custom system messages, by adding pages to the MediaWiki namespace.Note that sidebar contents is aggressively cached. You might need to purge your pages.
Also note that
$wgUseDatabaseMessages
must be true (default).