Translations

From wiki
Revision as of 06:29, 31 January 2018 by DeamonHunter (Talk | contribs) (Remake the tutorial, to focus on letting people make their own mods.)

Jump to: navigation, search


Staxel has been built to handle having multiple translations. It includes the ability to change all text being displayed with only a couple of exceptions to this rule. The following is a list of features you can change:

  • Dialogue text. (i.e Villager conversations)
  • Menu text. (i.e. All menu's. Item/Block names and descriptions. In world Tags. etc)
  • The font used. Japanese translation uses this to provide a better default font for Japanese characters.
  • Other various instances of text.


With that however, there are a couple things Staxel cannot do. These include;

  • You cannot have two different UI fonts active at once.
  • Can not handle right to left text.
  • Does not support gendering names or items. In most cases you must either assume neutral gendering, such as the for the player, or needed to be written into the preceding text. The latter should be used in cases where an item will not change, such as the Mug'o'sap in the Barkeep's dialogue.


Making a new Translation Mod

Getting set up

To get set up for translating the game, do the following;

  1. Go to the Staxel Files (Defaults are usually /SteamInstall/steamapps/common/Staxel/ for steam or <code>%localappdata%/Staxel.Launcher/gamedata/ for standalone.
  2. Head to /content/staxel/StaxelTranslations/.
  3. Create a new folder named after your Language Code. In the simplest form, the first two letters signify the language. For example, "en" is English, "fr" is French and "ja" is Japanese. The second set of characters refers to the region of which the language resides. For example, "GB" is Great Britain English, which has differences to "US" which is American English. With that knowledge, click on the folder with the language you want.
  4. Create a text file in that same folder. Name it the same as the folder except change the extension to .lang. Open this up.
  5. Add the following to the file;
language.code=[Folder Name Here]
language=[Localised Language Name Here]

Change the text to be appropriate for your language. For example;

language.code=ja-JP
language=日本語
  1. Head back up one folder and run Staxel.Translations.exe.
  2. After that says "Work Completed", close the application. Go back to select the folder you made. Now crtl + x (Or right click → Cut).
  3. Head Back up to the contents folder. Go into the mods and paste the folder there. (Crtl + v or Right-Click → Paste)


You are now set up. Feel free to go into that folder and start editing all the new files that appeared.


Editing Files

At the start of the file, there two lines which are similar to the name of the folder you entered before. This is used by the game to work out which translation this belongs to. In most cases, you will not be changing these lines.

language.code=ja-JP
language=日本語


Below is the first type of translation you may see. These lines are for translations that were done. These should not need to be edited, however a double check cannot hurt as incorrect translations can happen.

//[Reference] 'Achievement unlocked: {0-achievement}!'
achievements.achievementUnlocked=アチーブメントがアンロックされました:{0-achievement}!

The first line is what is known as a "comment" which is signalled by the "//" at the start of the line. Essentially this line does nothing in game, but is there tell you what the English line was.

The second line is the actual translation for the line. The first part, in this case achievements.achievementUnlocked= is the name of the line being translated, and the part after the "=" is the translation. If you edit this, there should be no gap between the "=" and the actual translation.


Below is the second type of translation you may see. This is for all untranslated lines.

//TODO Translate [Reference] 'Why am I not watching over the tavern you ask?'
staxel.village.dialogue.job.BarkeepWorkPlaceMissing.line:10000100=

The first line is a comment. This time it contains "TODO Translate", signifying that this line needs to be done. If you wanted to translate this line, add the translation after the "=" symbol, with no space between the equals and the translation. Once it is done, remove the "TODO Translate" leaving it like //[Reference] 'Why am I not watching over the tavern you ask?'


And finally, below is the third type of translation you may see. This is for when the English line has been changed, but the translation has not been updated to reflect it.

//[Validate] Delete this comment if or when the translation is accurate.
//[Reference] 'It's this way!'
staxel.village.dialogue.Tutorial.line:10003600=Par là !

This line needs to be double checked to see if the translation still lines up with what is being asked for. If you do edit this, or confirm it is correct, remove the entire line containing //Validate.


With that, you should know what each line does. However there is one extra thing that may confuse you. If we go back to the first set of lines;

//[Reference] 'Achievement unlocked: {0-achievement}!'
achievements.achievementUnlocked=アチーブメントがアンロックされました:{0-achievement}!

You'll notice the text {0-achievement}. This is known as a "Variable". This is a value that will add in some other text to the statement, turning the sentence into "Achievement Unlocked: Locked and Loaded!" for example. This variable has two parts. The first part is the number, which contains what we want, and second, including the dash, is the description of the number. These variables should be included, unchanged, in the translation. The location of this variable should make sense grammatically and can be moved to a different section of the sentence. There is no need to worry about changing the variable description, as these passages are often translated elsewhere and therefore will not appear to the user.

With that you should have enough knowledge to edit these files.

To test these files out after changing them, make sure Staxel is closed and then run Content Builder. You can do this by going to /PathToStaxel/gamedata/bin/ and running "ContentBuilder.exe". When it is running, click on "Validate" and let it do its thing. After it is done, you can load Staxel again to see your changes.


Viewing Dialogue Flow

You might have noticed at this point, that Staxel dialogue lines are not in any proper order. This is because these files are automatically generated. This guide will focus on how to view these files.


The first step would be to download a program known as Yarn editor. The download for this is located at: http://infiniteammo.com/Yarn/Yarn-2016-08-15-win.zip

Once the zip is downloaded, extract the files and run Yarn.exe. Then click on File -> Open and then head to /PathToStaxel/gamedata/content/staxel/villager/personality/dialogue/ and open the json file of choice.


Using this application, you can see which line of text will be triggered in which location and therefore be able to tell how the text flows between connections.


Creating A Mod and Uploading to Steam

Creating the mod

Once you have completed your translation, tested it out in Staxel, and are happy with how the translation is, then it's time to create a mod. Follow these steps to create a mod;

  1. Open up your favourite image program, and create a new image. This image is for the Mod thumbnail, which is what will let people know what the mod is about. We recommend to make the image have the size of 636x358, as that seems to work best with Steam layout. Here is an example;

Example Translation Mod Preview Image.png

  1. Once you have finished creating that image, open up Staxel's Modmanager. You can do this by two ways. The first (when using Steam) is to go into Steam, go to the library and find Staxel. Then Right Click Staxel → Mod Manager Tool. The second (when using Standalone Launcher) is to open up the launcher.
  2. With Mod Manager open. Click on Sxl Mods → New... → Create New Mod. You'll get a new window that looks like;

Staxel.ModManager Create new mod.png

  1. Click on the dropdown arrow on the first text box. Select the name of the folder you had created.
  2. Add your Name to Mod Author, and add a short description of the mod.
  3. Click on the browse next to "Preview Image", and find the image you made in step 1.
  4. Select the Translations box in the tags window. And maybe add your own Tags by pressing the Edit button.
  5. Hit OK.

With that you should have a working mod.


Uploading the mod to Steam

This section is fairly straight forward, but can sometimes have issues. Follow the following instructions;

  1. If you haven't already, accept [Steams Workshop Agreement] before continuing.
  2. Open Mod Manager through Steam. (i.e. Go into Steam, go to the library and find Staxel. Then Right Click Staxel → Mod Manager Tool.) This is a must.
  3. Find your mod. Right Click it. Click Upload to Steam.

As long as everything is correct, this should work. However Steam can be fickle at times.


Updating your mod

Updating your mod is fairly easy. Follow these instructions.

  1. Finish updating all the files you wanted first.
  2. Once you have finished creating that image, open up Staxel's Modmanager. You can do this by two ways. The first (when using Steam) is to go into Steam, go to the library and find Staxel. Then Right Click Staxel → Mod Manager Tool. The second (when using Standalone Launcher) is to open up the launcher.
  3. Right Click on your mod, then select Remake mod from install.

That's it. Your mod is now updated with your latest files.


If you need to change the details that show up, or need to add tags then Right Click on your mod, then select Change Details.


If you have uploaded to Steam. Then all you need to do to update to steam is Right Click on your mod, then select Upload To Steam.


Help I Lost the Mod! I can't Update the Workshop Version Anymore.

If this has happened, then you can still recover. To recover, follow these instructions;

  • Find your mod on the Steam Workshop and subscribe to it. Wait for it to download.
  • Open Mod Manager through Steam. (i.e. Go into Steam, go to the library and find Staxel. Then Right Click Staxel → Mod Manager Tool.) This is a must.
  1. You should find your mod in the list. You can then install this mod, if you haven't already.

With that you now have your mod again. You can update and upload using this version of the mod.


Creating your own language file

This section will detail how you will create your own translation files. This is mostly needed in order to make sure your Tiles, Items and other various things will get translations instead of the default choice the game will make.


You first need to create a text file and name it something like "modname.lang" or "modname-en-GB.lang". (Replacing the ".txt" at the end of the filename as well.) Open this file in your favourite text editor and then copy the following lines;

language.code=en-GB
language=English

The first line is which translation this will be a part of. The second line is the localised name of this code. You can look at other files in /PathToStaxel/gamedata/content/staxel/StaxelTranslations/ in order to find out the codes and languages we use.


After that is done, it is time to add lines. This is largely dependent on what you want to translate, but the following is a list of all things that can be translated. One entry is needed per item needed that is to be translated.


Accessories/Achievements/Items/Plants/Recipes/Tiles

All of these items will behave exactly the same in a language file. Add the following to the language file,

[code of the object here].name=Name of Object
[code of the object here].description=This is the long form description of the item that is used in the inventory screens.

The code of the object is signified by the "code" property in the respective files.

Categories

Each Category that is used in Tiles and Items and other pieces can have its own translation. This might not be used in many cases however, mainly in searching for items. In this case, add the following to the language file,

staxel.category.[Category]=Translated name of the category.

With Category being the exact string used in the "categories" property.

Dialogue

Dialogue is the most difficult section to deal with. The first thing to do is fully create your Dialogue file. When you have finished creating your Dialogue, open Content Builder at the path /PathToStaxel/gamedata/bin/ and press the "Tag Dialogue and Generate Language file" button. Select the dialogue file you have just created. (i.e. Open the .dialogue file). This changes the .json file and also creates a .lang file. The translations for this is then good to go.

If you want to make the translations for a different language, either edit the file you have just created or create a copy of the file and change that.

Villagers

Villager names themselves can be translated.

staxel.villager.[Villager Name]=Translated name

With Villager Name being the exact string used in the "name" property.

Other

There are certain other strings that can be specified. For example, Tile#"interactVerb" or Weather#"nightTransitionFlavourLineCodes" are of this type. Both of these specify a translation line as a string in the file. You then add this exactly line to your .lang file and then use that to add a proper description.

For example if your Tile file has;

"interactVerb": "mods.tile.I.Really.Want.A.Different.Verb"

You can then add the following to your lang file;

mods.tile.I.Really.Want.A.Different.Verb=I really want to not have a different verb.

After finishing

When you have finished your language file, open Content Builder at the path /PathToStaxel/gamedata/bin/ and press the "Validate" button. This will compile all the translations and then you can view them in Staxel. At this point, check them out in game and see if they came out right.