Hello everyone. We are two developers: WarFollowsMe and Curiouspers
We very like Stardew Valley, but real excitement comes only when you play the game comfortably with your native language. This is what pushed us forward to make Stardew Valley Localization to our native language - Russian. As we dig deeper and deeper into code, we realized that we can make this tool multilingual, and capable to handle other language packages. All of this became possible, when we decided to not to change original texts in game resources, but create a mechanism to replace texts right before rendering stage. So the game thinks that it working with original texts, but our tool acts like a little build-up on top of the game, participating only at texts rendering stage, and don't change the logic of the game.
Here's what result looks like in the game:
Well, it took us three month and now we want to share the results of our work with you, the great community of Stardew Valley!
WARNING! This is not the end release, but pretty stable version. Bugs can occur here and there. The main goal right now is to figure out is there any interest to this project.
Here is the source code: https://github.com/WarFollowsMe/TranslationMod
The tool itself consist of two parts:
LanguagePatcher.exe - a little console program, that makes a series of injections to the game with help of Mono.Cecil library.
MultiLanguage.dll - library, that contains methods to process intercepted texts and replacing them with localized texts from custom made dictionary.
All language packages are placed in folder "languages", that consist of:
-[languages]
Config.json // required
description.json // required
[EN] // required folder
[RU] // optional folder
... // maybe your language folder here
Config.json - simple configuration file. Contains only two properties:
description.json - configuration file in format "ShortLanguageName":"FullLanguageName" Must always contain "EN":"English"! Other pairs are optional.
Subfolders are language packages. Name of subfolders must always match the ShortLanguageName field in description.json Subfolder EN must always be there.
Language package must always contain 2 subfolders: "content" and "dictionaries"
Folder "content" keeps all .xnb files with textures, that may be redrawn to other languages. Folder structure replicates the in game Content folder.
Folder "dictionaries" keeps all dictionaries in JSON format. That's where you want to place the translations of original texts. Use the following format: "original text":"translated text". We split texts to different files on purpose. That way it's easier to orient in all of these texts. Dictionaries contains special lines, started with "__comment", that serves the same purpose, to make it clearer from what part of the game the following texts are.
Also it's very important to understand that, dictionaries with filename started with underscore sign ("_") are contains texts that was hardcoded into "Stardew Valley.exe". Since in the game a lot of attention is paid to random generated dialogues and quests, we added complicated system of variables, that's very easy to use. Now it's only 5 variables:
It is possible that we may put new variables some day.
To activate a new language package, you need to change "LanguageName" value in Config.json, or you may start a game and at the options page there will be new "Language" dropdown, you may also select your language there.
IMPORTANT! Changes will take place only after game restart.
You can test any mod tool at your own risk. Just keep in mind that at the time we do not prioritize this task.