Modding:How to create translations

From Cosmoteer Wiki
Jump to: navigation, search

Modding Main Page

Cosmoteer currently only comes with one officially-supported language (English). However, it's possible to create translations for Cosmoteer into other languages. I encourage you to do so, and to post your translations on the forum for others to download!

Step 1: Create a mod for your translation:

It is possible to use "mod packages" to create and distribute self-contained translations.

First, follow these instructions to create a new "mod" that will contain your translation. I recommend that you start your new mod by copying the example_translation mod that comes pre-installed with Cosmoteer.

In Cosmoteer's Data\Strings folder (if you've installed Cosmoteer in the default location, that would be C:\Program Files\Cosmoteer\Data\Strings) you should see an en.txt file. This is the file that contains the English text for the game, and will always be the most-up-to-date.

Copy this en.txt file into your own mod's Strings folder, replacing the en in its filename with the two-letter 639-1 language code for your language. (For example, Russian would be ru.txt and German would be de.txt.) If you are making a translation for a particular regional language, use the full xx-xx code for the region. (For example, British English would be en-gb.txt and Brazilian Portuguese would be pt-br.txt.)

If you created your mod by copying the example_translation mod, you should also delete the devlish.txt file that comes with the example mod. ("Devlish" is a fake language created for the purposes of showing how translations work.)

Step 2: Translate the text:

Open up this new file that you copied from en.txt. The first line should read

__Name = "English"

Change the "English" to your language's name for your language. For example, if you are making a Russian translation, change it to:

__Name = "Русский"

The rest of the file is full of categorized key/text assignments, such as

NewGame = "New Game"

The NewGame key on the left is what the game code searches for and should not be changed. The text in quotes on the right should be translated into your language. For example, translating the above into Russian might look like

NewGame = "Новая игра"

Step 3: Testing your translation:

In order to test your translation, follow these instructions to switch to your language file. (Make sure to turn on your mod first! Otherwise, the new language won't show up in the Settings.)

Step 4: Sharing your translation:

When you're ready to share your translation with other players, follow these instructions to package your mod, and then post it in the translations sub-forum.

Updating Translations

Because Cosmoteer is still in active development, new English text is added to the game very frequently, meaning that your translation may soon having missing text keys. This will normally not break the game (though of course you should update your translation). If Cosmoteer doesn't find the text key in your language file, it will fall back to using the English version of the text.