v50 Steam/Premium information for editors
  • v50 information can now be added to pages in the main namespace. v0.47 information can still be found in the DF2014 namespace. See here for more details on the new versioning policy.
  • Use this page to report any issues related to the migration.
This notice may be cached—the current version can be found here.

Editing Template:Msg/doc

Jump to navigation Jump to search

Warning: You are not logged in.
Your IP address will be recorded in this page's edit history.


The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then save the changes below to finish undoing the edit.

Latest revision Your text
Line 1: Line 1:
'''Messages''' are part of a system which uses ''templates'' to store translations. This is a middle ground between using &lt;translate>, which is difficult to use with template markup, and using {{<nowiki/>int:}} for translations, which requires admin rights to edit messages.
+
Alternative to using {{<nowiki/>int:}} for translations (which requires admin rights to edit messages).
  
==Creating a new message==
+
==Usage==
First, keep in mind that messages are meant to be used for markup-heavy pages, like templates.
+
Messages should go in a subpage of [[Template:Msg]]:
* If you want to translate a content page, use the Translate tool on that page &mdash; it's easier to use, update translations with, and is designed specifically for content.
+
  Template:Msg/''message name''/''language code''
* If you want to edit '''system messages''', such as the "edit" tabs above a page or the text on [[Special:RecentChanges]], you will need to edit [[wikipedia:mw:Help:System message|system messages]], which require admin rights.
+
For example:
===Naming conventions===
 
* If the message you are creating is for a single template, create it in the following location:
 
  Template:{{tc|#f0f|'''Template name'''}}/msg/''message name''
 
* If the message you are creating is likely to be used in many templates, you have multiple choices:
 
** If it is used in a single template most often, and in other templates occasionally (such as auxiliary templates), place it under the template that uses it most (see above)
 
** If it is used by a wide range of templates that all have a common role (e.g. creature-related templates), use a descriptive template name (this does not have to exist &mdash; messages can be placed at <code>Template:Creature/msg/messagename</code> without Template:creature existing, for example).
 
** If it is a generic message which isn't necessarily part of a given template, but will be used ''in templates'', place it at:
 
Template:Msg/''message name''
 
===Enabling translation===
 
'''Before you save''' (ideally), you will need to wrap the contents in the message in &lt;translate> tags and mark the page for translation, just like a normal page. (This makes pages appear at the standard language subpages, which can be easily transcluded from the {{<nowiki/>msg}} template).
 
 
 
== Details ==
 
This template relies ''heavily'' on [[Mediawiki:Language-code]] - if this is not defined for a certain language, all messages for that language will fall back to English.
 
These messages should appear in {{#language:{{INTERFACELANGUAGE}}}}, which is your current interface language setting. The following links can be used to change your language ''temporarily'':
 
 
 
[{{fullurl:Template:Msg|uselang=en}} English] {{dot}} [{{fullurl:Template:Msg|uselang=es}} Spanish] {{dot}} [{{fullurl:Template:Msg|uselang=fr}} French] {{dot}} [{{fullurl:Template:Msg|uselang=de}} German] {{dot}} [{{fullurl:Template:Msg|uselang=da}} Danish]
 
 
 
For reference, the following languages are defined. If you attempt to use a language not defined here, ''all'' messages will fall back to English, even if translations exist for them in the appropriate /msg subpage. If you need to enable a language not listed here, post on the talk page.
 
{{Special:PrefixIndex/Mediawiki:language-code}}
 
 
 
==Examples==
 
 
<pre>{{msg|example}}</pre>
 
<pre>{{msg|example}}</pre>
 
gives: {{msg|example}}
 
gives: {{msg|example}}
  
<pre>{{msg|t=av|old}}</pre>
+
The message above should appear in {{#language:{{INTERFACELANGUAGE}}}}, which is your current interface language setting. The following links can be used to change your language temporarily:
gives: {{msg|t=av|old}}
+
* [{{fullurl:Template:Msg|uselang=en}} English], located at {{tl|msg/example/en}}
 
+
* [{{fullurl:Template:Msg|uselang=es}} Spanish], located at {{tl|msg/example/es}}
=== Generic examples ===
+
* [{{fullurl:Template:Msg|uselang=da}} Danish], located at {{tl|msg/example/da}} (this will fall back to English unless [[Mediawiki:Language-code/da]] exists)
These pages should not exist, but take note of the path names:
+
Note that this template relies ''heavily'' on [[Mediawiki:Language-code]] - if this is not defined for a certain language, all messages for that language will fall back to English.
<pre>{{msg|message that does not exist}}</pre>
 
gives: <code>{{msg|message that does not exist}}</code>
 
 
 
<pre>{{msg|t=template|message}}</pre>
 
gives: <code>{{msg|t=template|message}}</code>
 

Please note that all contributions to Dwarf Fortress Wiki are considered to be released under the GFDL & MIT (see Dwarf Fortress Wiki:Copyrights for details). If you do not want your writing to be edited mercilessly and redistributed at will, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource. Do not submit copyrighted work without permission!

To protect the wiki against automated edit spam, we kindly ask you to solve the following CAPTCHA:

Cancel Editing help (opens in new window)