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.

Template:Msg/doc

From Dwarf Fortress Wiki
Jump to navigation Jump to search

Messages are part of a system which uses templates to store translations. This is a middle ground between using <translate>, which is difficult to use with template markup, and using {{int:}} for translations, which requires admin rights to edit messages.

Creating a new message[edit]

First, keep in mind that messages are meant to be used for markup-heavy pages, like templates.

  • If you want to translate a content page, use the Translate tool on that page — it's easier to use, update translations with, and is designed specifically for content.
  • 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 system messages, which require admin rights.

Naming conventions[edit]

  • If the message you are creating is for a single template, create it in the following location:
Template: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 — messages can be placed at Template:Creature/msg/messagename 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[edit]

Before you save (ideally), you will need to wrap the contents in the message in <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 {{msg}} template).

Details[edit]

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 English, which is your current interface language setting. The following links can be used to change your language temporarily:

English  · Spanish  · French  · German  · 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.

Examples[edit]

{{msg|example}}

gives: This is an example message.

{{msg|t=av|old}}

gives: Template:Av/msg/old/en

Generic examples[edit]

These pages should not exist, but take note of the path names:

{{msg|message that does not exist}}

gives: Template:Msg/message that does not exist/en

{{msg|t=template|message}}

gives: Template:Template/msg/message/en