File type: Locale

File type: Locale

Overview

A locale gives a translation of the user interface of the program.

Package format

A locale is described in a package with the .mse-locale file extension. Such a package contains a data file called locale that has the following properties. There are usually no other files in the package.

Properties

Property Type Default Description
Common to all packages
mse version version required Version of MSE this locale is made for.
short name string file name A short name of this locale, for the options dialog.
full name string file name A longer name of this locale.
icon filename none Filename of an icon / preview for this locale, currently not used.
version version 0.0.0 Version number of this package.
Specific to locales
menu map of strings Translations of menu items.
Menu items can contain shortcut keys (like Ctrl+C for copy) by using a single TAB between the text and the shortcut key.
Keys to use with Alt+Something (displayed underlined) can be specified &
For example
new set: &New...	Ctrl+N
help map of strings Translations of help texts for the status bar.
tool map of strings Translations of toolbar item texts.
tooltip map of strings Translations of tooltips for toolbar items.
label map of strings Labels of controls in the GUI.
button map of strings Labels of buttons in the GUI.
title map of strings Titles of windows.
action map of strings Names of actions for undo/redo, things like "typing" and "add card".
error map of strings Error messages.
type map of strings Types of objects for error messages.
game map of map of strings Translations for specific games.
Field names and field descriptions are looked up in the locale, if they are found the translation is used, otherwise the value from the game file.
Extra keys not present in the English locale can be added here.
stylesheet map of map of strings Translations for specific stylesheets.
symbol font map of map of strings Translations for specific symbol fonts, in particular the "insert symbol" menu.

Some of the items can contain placeholders for other values, for example:

 undo: &Undo%s	Ctrl+Z

The %s is replaced by the name of the action to undo. This %s should be used in exactly those entries that also contain it in the English locale.

Examples

Look at the "en.mse-locale" file in the standard MSE distribution for an example.

Translating MSE

To translate the MSE user interface:

  • Create a copy of the "en.mse-locale" directory, name it "**.mse-locale", where "**" is a two or three letter ISO language code.
  • Open the "locale" file with Notepad (or another program that supports UTF-8), and translate the strings.
  • Add new keys for game, stylesheet or symbol font specific keys as described above.
  • Save the file, select the new locale from Edit->Preferences.
  • Restart MSE, and make sure everything looks right.
  • Submit the new locale to the [[http://magicseteditor.sourceforge.net/forum/7|MSE forum].
  • Maintain the locale when new versions of MSE come out. A new version may have new user interface items and therefore new keys.