Grab the latest translation file difference report here!

How to create a new translation for SimpleMenu

As of V47, SimpleMenu provides a new way to create translations, that does not require overwriting the main "labels" file.
In the mod base directory, you should see a "translation" folder:



Within this, there are two folders, "meta" and "labels"


To create a new translation, first create a new json file in the "meta" folder (contents should look something like this):

As a base, create a copy of "default-en-meta.json" and rename it. Do not modify the default file.
Your filename MUST start with "language-" but otherwise there are no restrictions (though, do please try to follow the format of "language-code-meta.json")

As an example, let's say we're creating a Greek translation. I would create a file called "language-el-meta.json"
The structure of the metafile is as follows:

{
"code": "el",
"name": "Greek - Ελληνικά",
"info": "Μητρική μετάφραση"
}

  • "code": this is the language code for the language you are creating. You can put anything you like here, but it MUST match the filename of the labels file you create later. It also must be in English characters. In this example, I have chosen el to represent Greek.
  • "name": This is the name that will be displayed in the dropdown language selection: Please follow the format "English Name - Native Language Name" in order to allow something to be displayed if there are code page issues.
  • "info": This is an additional piece of information that is displayed alongside the name, in parentheses. Generally, this should be used to indicate whether it is a native translation, or a machine translation, in the target language. In this example, the above Greek phrase translates to "Native Translation."

Once this is done, navigate back to the "translation" folder, and into the "labels" folder.


Here, make a copy of "en.json" and name it "<code>.json" (in this example, we would call it "el.json"). This must exactly match the code you provided in the metafile above. It is a large file, but you don't need to worry about the structure of it, you will see a bunch of "pairs" that look like this (this is a small snippet of the file)

Curly braces ( { } ) encapsulate "sections" and must not be changed.
The text to the left of the colons ( : ) are the keys and must also not be changed. 
\n is a special sequence that introduces a line break. It is up to you whether to preserve or change these, whatever makes most sense in your language would be ideal.
Do not use double quotes ( " ) within your text; if you have a need to use quotes, use single quotes ( ' ).
If you wish to use a backslash ( \ ), you must use it twice ( \\ ), as a single backslash denotes a special sequence. It will only appear once in the text.

Occasionally, within a section, you'll find a pair that looks like this:

In this instance, you want to translate everything in the square brackets ( [ ] ) but once again, do not modify the key on the left of the colon.
Once you're done translating these labels, that's it! There's nothing else to do; fire up the game, and you should see your new translation listed in the dropdown menu:

(Greek isn't actually supported by the font I'm using, but this shows why there should be a fallback English name)
Select your language, browse through the various tabs/menus/dropdowns/etc, make sure it all looks right, and then go ahead and release it!

Notes
  • If you are creating a translation of one of the built-in machine translations, feel free to simply modify the existing metafile and labels file, in order to replace the machine translation for users of your translation. Otherwise, if you do not wish to do that, simply create a new translation with a different code, and follow the steps above.

Article information

Added on

Edited on

Written by

capncoolio2

0 comments