Translations
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;
- Can not set a font for only a specific set of characters.
- 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.
Contents
Editing the Official Staxel Translations
The Staxel team has chosen to have all translations publicly available for review and editing over at https://github.com/bartwe/StaxelTranslations. Even if you have knowledge with Git and/or Github, you may still want to see the short tutorials, #How to Check Translations Ingame and #Viewing Dialogue Flow.
Editing Files on Github
First of all, head over to https://github.com/bartwe/StaxelTranslations. You will be greeted by a page that looks like;
Don't be alarmed by the large amount of information located on this page. The majority of it is not needed for beginner users. The main thing is getting to the language you want to edit. You will see a bunch of lines that start with an icon which looks like a folder. After each of these icons, is a four character name with a dash in the middle. This is known as a 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. (If your language is not listed here, then you will need to create it. This will not be handled in this tutorial.)
You will be greeted with another page. This page contains also contains a whole bunch of files, each of which represent a section of text you could change. Most files are used to replace NPC dialogue, though there are some files at the bottom of the page which are used to replace other sections of text, such as item descriptions. Click on the file you want to change. Once you have selected the file you to edit, there will be a edit button (Highlighted by red in the image below.) that you will need to press.
Doing so will move you to a page that will look like;
You can safely ignore the message that appears up at the top. This is saying that Github has made a copy of the files for you to edit without affecting the original.
The middle of the page is now a text editor. From this point forward, you can edit the translations though there may be a bit of confusion on what to edit. If you want more information about the files then head to #Editing Language Files.
Once you have finished editing the file, scroll down to the bottom of the page. There will be a section that looks like;
In the first box, you should put something like "Updated [Filename]'s [Language Name] Translation" such as "Updated Tiles.lang English Translation". This names what you have changed, which is known as a "commit". The second box is where you add more details but this isn't necessary.
Once you have edited the first box, click "Propose file change". You'll be brought to a page similar to below;
This page essentially shows you what you have changed, and you can look over it if you want to make sure what you have done. From this point you have two decision;
- Finish now and submit everything.
- Or Continue on with another file.
Continuing editing
You'll need to head back to your version of the files first. The quickest way I found to get back would be to;
- Click on the 6 letter text, to the very right of your username on the page. it should be the 7 letter and number gibberish. [Media:Getting To User Fork 1.png Located here.]
- Click on the "StaxelTranslations" at the top of the page next to your username. [Media:User Fork Github.png Located here.]
At this point you are on your local files. But you aren't on your changes just yet. Click the dropdown that says master, and go click "Patch 1". Now you are on your own changes.
From this point you can navigate to the file you want to change again, and use the knowledge above to edit it.
Submit your changes
Your changes haven't been submitted to us just yet, you will need to make what is known as a "Pull Request" to get this changes made. Firstly head to https://github.com/bartwe/StaxelTranslations/compare. After you have done that follow these steps;
- Click on "compare across forks." Two more boxes should appear.
- Click on the third box from the left and select the second option. This should be "YouGitHubUsername/StaxelTranslations".
- Click on the fourth box from the left and select "Patch 1".
- Click on "Create Pull Request". This will create a new set of boxes where you clicked. This will take the name of the commit you did earlier, and also it's description. If you are happy with these just click on "Create pull request" once again.
You will then go to a page that looks similar to;
At this point you are almost done. Once you see this page, please wait about 1 to 2 minutes and refresh the page. At this point a bot should have messaged that you need to sign a waver in order for your changes to be accept. Follow through with it's instructions.
When you have signed the waver, you are done. However in order to speed along the translations acceptance, it would be recommended to head to our Discord at https://discordapp.com/invite/Staxel and drop a message in #translations in order to say that you have done this.
How to Check Translations Ingame
Checking your translations Ingame can be fairly easy to do.
The first thing you need to do, is to head to /PathToStaxel/gamedata/content/staxel/StaxelTranslations/
. This will lead you to the similar place as the https://github.com/bartwe/StaxelTranslations.
That is all, just edit the files here are you are ready to go. After changing files, 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.
Making a new Translation Mod
Getting set up
To get set up for translating the game, do the following;
- Go to the Staxel Files (Defaults are usually
/SteamInstall/steamapps/common/Staxel/ for steam or <code>%localappdata%/Staxel.Launcher/gamedata/
for standalone. - Head to
/content/staxel/StaxelTranslations/
. - 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.
- Create a text file in that same folder. Name it the same as the folder except change the extension to
.lang
. Open this up. - 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=日本語
- Head back up one folder and run Staxel.Translations.exe.
- After that says "Work Completed", close the application. Go back to select the folder you made. Now crtl + x (Or right click → Cut).
- 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. If you want more information about the files then head to #Editing Language Files.
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;
- 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;
- 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.
- With Mod Manager open. Click on Sxl Mods → New... → Create New Mod. You'll get a new window that looks like;
- Click on the dropdown arrow on the first text box. Select the name of the folder you had created.
- Add your Name to Mod Author, and add a short description of the mod.
- Click on the browse next to "Preview Image", and find the image you made in step 1.
- Select the Translations box in the tags window. And maybe add your own Tags by pressing the Edit button.
- 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;
- If you haven't already, accept [Steams Workshop Agreement] before continuing.
- 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.
- 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.
- Finish updating all the files you wanted first.
- 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.
- 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.
- 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.
Editing Language 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 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.