MediaWiki localization: Difference between revisions

From Meta, a Wikimedia project coordination wiki
Content deleted Content added
Mulukhiyya (talk | contribs)
m rv/v; with no improvement
 
(3 intermediate revisions by 2 users not shown)
Line 1: Line 1:
#REDIRECT [[MediaWiki localisation]]
== DO '''NOT''' EDIT THIS PAGE ==
This is a Help Page on the WikiMedia Internet Site, not on your local machine. It is designed to assist you in customising your own site, and should not be used as a testbed for your design.

If your DefaultSettings.php file shows the following line it means that you use Mediawiki Namespace:

<pre>
$wgUseDatabaseMessages = true;
</pre>
* true -> Mediawiki Namespace
* false -> LanguageXx.php

Since the Language.php file is in English, the LanguageEn.php file just refers to Language.php.

== Updating messages/changing language ==
At install time, the interface messages are imported to the database so you can customize them. (See [[MediaWiki namespace]]). If you then change the language by setting something like $wgLanguageCode = "de"; in LocalSettings.php or want to get a fresh copy of the default messages, you can do one of two things:

* Set <code>$wgUseDatabaseMessages = false;</code> in [[LocalSettings.php]] to disable the support for the MediaWiki namespace. (The line is in [[DefaultSettings.php]] as of 1.4x, but copy it to [[LocalSettings.php]].) This means you'll have to customize things by hand in LanguageXx.php, will lose your changes at the next upgrade if you don't carefully merge, and can't use template messages for other purposes.
OR
* Run maintenance/rebuildMessages.php to re-import the messages. This needs to run from the command line, and you must set up an AdminSettings.php (see AdminSettings.sample; it's easy). If you don't have command-line access, you may need to hack up the scripts; the maintenance scripts are not designed to run from the web since it's not safe to leave them exposed that way.
** <tt>cd maintenance</tt>
** <tt>php rebuildMessages.php --rebuild</tt>
** NOTE: To get maintenance/rebuildMessages.php to run, you need make sure that "register_argc_argv" is "On" in php.ini .

===Changing [[Help:Configuration_settings_index|parameters]] contained in the Language.php file===

The [[Language.php]] file contains other parameters besides messages. For instance, in this file you can modify whether or not the "Community portal" link appears, and you can get the help link to point to the meta.wikimedia site instead of the empty set of help pages on your local installation (set the 'helppage' parameter to 'http://meta.wikimedia.org/wiki/Help:Contents'). If you make changes to the Language.php file, they will not take effect unless either you run rebuildMessages.php afterwards or you have previously set $wgUseDatabaseMessages to false.

== Example message: toolbox ==

=== With Mediawiki namespace ===
'''Visit''' &nbsp; <nowiki>
http://your.wiki.tld/wiki/index.php/Mediawiki:toolbox</nowiki> &nbsp; or &nbsp;
<nowiki>http://your.wiki.tld/index.php/Mediawiki:toolbox</nowiki> &nbsp;
(the latter with [[Rewrite Rules]]) or even &nbsp; <nowiki>http://your.wiki.tld/wiki/index.php?title=Mediawiki:toolbox</nowiki>&nbsp; and edit just as any other wikipage. A full list of all messages is available at <nowiki>http://your.wiki.tld/Special:Allmessages</nowiki> (older versions of Mediawiki: <nowiki>http://your.wiki.tld/Mediawiki:All_messages</nowiki>, you will need sysop status).



----
Sometheing

--[[User:212.238.156.25|212.238.156.25]] 08:53, 13 October 2005 (UTC)

noh iryd

[[Media:Example.ogg]]

[[Image:Example.jpg]]


== [Headline text] ==

[http://www.example.com link title]

[[Link title]]

[[

=== LanguageXx.php version ===
Change the toolbox line in ''languages/LanguageXx.php'' (Xx corresponding to the ISO code of the language you have chosen) to :
<pre>
"toolbox" => "my toolbox text",
</pre>

<Next page: [[Interwiki links| Configuring Interwiki links]] >

== Documentation for translators (iii) ==
This section is meant as guidance for some general aspects of translating the Language.php file to another language (LanguageXx.php) and to some messages that are not straightforward to translate.

=== Basic coding ===
There are some basic coding rules that are helpful to know to understand the code:
* Quoting: All strings (name of the message, content of the message) must be contained in quotes. "Double quotes" means everything within the quotes will be checked by PHP for variables and such stuff ($1, $2, $3, etc. and \n for example), while with single quotes PHP can work a little bit faster because it will not check for such things. This should indicate that all messages with such variables would have to be contained in "double quotes", but this does not seem to be the case with LanguageXx.php anymore. <!-- To be continued -->

=== General considerations ===
* If you are making a [[w:UTF-8|UTF-8]] localization, this line will have to be placed somewhere in the beginning (or end) of the LanguageXx.php file:
require_once( "LanguageUtf8.php" );
* "-" means "don't show this". Can be used to disable displaying 'disclaimers', 'currentevents', and 'portal', for example (see [http://article.gmane.org/gmane.science.linguistics.wikipedia.technical/13574 Wikitech posting]). This does not currently work to prevent Special pages from showing up in the list of special pages though.

=== Message documentation ===
* 'categoryarticlecount1': See 'subcategorycount1'.
* 'subcategorycount1': This is the same as 'subcategorycount', but in singular form. This way of indicating singular form is used elsewhere too danomabn.
* 'sitesubtitle': This message is now hidden by default, but can be made visible by editing the site's <code>monobook.css</code>.

== See also ==
* [[Localization statistics]]

[[Category:MediaWiki User's Guide]]
[[Category:MediaWiki Development]]

Latest revision as of 15:16, 27 April 2007