How to Translate a Mod
This is a basic step by step guide (with images) aimed to help you to start and upload a Translation Mod.
Last updated
This is a basic step by step guide (with images) aimed to help you to start and upload a Translation Mod.
Last updated
Published: 19 Mar 2024 by iwasniko Last documented edit: 25 May 2024 by Vanaukas
This guide will teach you how to add translation files for existing mods.
The following section will focus on Text Translation. This section was created by Vanaukas.
For this guide, you need to install the following requirements:
Any text editor (Visual Studio Code or Notepad++ are recommended)
The mod you want to translate
A
There is no one way to do translations to existing Mods, but I am going to show two ways to do it in this guide:
For the purposes of this guide, I will use my mod as example. The file names and file structure used aren't mandatory, but as general rule avoid using symbols in your file/folder names besides -
and _
.
Internally, supported languages are stored into folders with acronyms related to each supported language. It should like this:
Each acronym corresponds to the following languages:
ar-ar
: Arabic (العربية)
cz-cz
: Czech (čeština)
de-de
: German (Deutsch)
en-us
: English (English)
es-es
: Spanish (Español)
es-mx
: Latin American Spanish (Español latinoamericano)
fr-fr
: French (Français)
hu-hu
: Hungarian (Magyar)
it-it
: Italian (Italiano)
jp-jp
: Japanese (日本語)
kr-kr
: Korean (한국어)
pl-pl
: Polish (Polski)
pt-br
: Brazilian Portuguese (Português do Brasil)
ru-ru
: Russian (Русский)
th-th
: Thai (ไทย)
tr-tr
: Turkish (Türkçe)
ua-ua
: Ukrainian (Українська)
zh-cn
: Simplified Chinese (简体中文)
zh-tw
: Traditional Chinese (繁體中文)
This list will be helpful later to setup the ArchiveXL files to properly add your translation (don't worry, is properly explained too).
Cyberpunk uses some kind of XML
+ json
text formatting. The following are just a few of the most commonly used codes for text formatting:
\n
This is used for line breaks. You can't use Enter
to do line breaks, or your whole text won't be recognized. You can use several \n
for bigger line breaks if you need it. This rule is the same for .json.json
files and .json
files (don't worry, both file extensions are explained later).
<Rich color="TooltipText.cyberwareDescriptionHighlightColor" style="Semi-Bold">YOUR WORD</>
This is used to mark in Orange some words, as it can be seen on the following example:
It's important that you respect the format of the text of the Mod that you are translating, so as not to deviate from the author's original intention of emphasis.
.json.json
resourceInstall all the previously mentioned requirements and download the .json.json
file from the mod page. Create a Wolvenkit project.
.json.json
to your project Open the project, hover over raw
folder in Project Explorer
and click on the yellow icon to open the raw
folder on Windows Explorer:
On Windows Explorer
, move the already downloaded .json.json
file over raw
and make some folder to hold it. For this example I'll call that folder localization
and inside this folder, I'm going to create another folder related to the language I want to use.
For this example, I'll make two folders: es-es
and es-mx
, because they are fairly similar and also my main language and then I'll copy and paste the same .json.json
in both folders. This is how it'll look inside Wolvenkit:
.json.json
file to your projectDo a Right Click
on the .json.json
file and select Convert from JSON
:
Do the same for all files you need to import. After importing, Project Explorer should look like this:
You can choose two ways of translating that .json.json
file:
.json.json
file on a text editor before importingYou can do this when the .json.json
file is already decompiled (this is why it has two .json
extensions, because it was exported from a Wolvenkit compiled .json
). It should look like this:
This method is a little harder to read and prone to errors, but some people may find it comfortable. You need to import the .json.json
file AFTER doing the translation on this case, that way you'll be importing your already translated file.
Is important to remember that you can't use Enter
to do line breaks or your file will break. Use \n
instead.
.json
file in Wolvenkit after importingA file with .json
extension (only one extension) is already compiled and not able to be opened on a text editor, but it can be opened in Wolvenkit. This method is somewhat easier to read because the XML
text formatting won't be decompiled, allowing for better readability.
Let's see how a .json
file looks inside Wolvenkit:
Each numbered entry is one specific LocKey
(Localization Key) and they can hold item names, item descriptions, ability descriptions and anything that can be read on items.
Inside each entry, you'll find the following parameters:
femaleVariant
: This is the default field for any text, for some reason. You can write here names, descriptions, etc.
maleVariant
: Used for some specific cases if a gender based variant exist (clothing, for example).
primaryKey
: This is how the entry is called inside the game. Uses numbers. Is recommended to keep on 0
to avoid unintended collisions with in-game texts or other mods.
secondaryKey
: This is also how an entry can be named internally and is recommended to use this field instead primaryKey
, because it can hold characters and some symbols. Try to use descriptive names related to your mod and where are you going to use the entry inside your mod.
This is how a single entry will look inside Wolvenkit:
Please, keep in mind that you can't use Enter
to do line breaks or your text will break. Use \n
instead.
This is how a heavy text entry looks like:
All that text is one single big line. Always keep in mind this.
After doing the translation with either method, you need to create an ArchiveXL file to merge your .json
files with the rest of the game translations. This process is really quick and easy, thanks to psiberx tools.
Click on New File in Wolvenkit:
Select ArchiveXL
and then ArchiveXL file
. Change the generated name to the same as your mod (not mandatory, just to have both files together after installation), but preserve the extensions .archive.xl
. Following this example, the resulting name will be RaitoLabs-ES.archive.xl
. Click on Create
.
After clicking Create
, your file should open automatically in your main text editor (in my case, VSCode).
The following code structure should be used to fill your ArchiveXL file:
localization
tells the system that you are adding text.
extend
needs to be pointing to the .archive.xl
of the mod you want to translate. ArchiveXL will take the contents and automatically merge them seamlessly, this way you don't have to overwrite any file from the mod you are translating, providing flexibility and maximum compatibility.
onscreens
tells the system the type of text you are adding.
Language_Acronym
is related to how supported languages are called internally. I've provided a list earlier with all the supported languages. On this example, will be es-es
and es-mx
.
File_Path_To_Your_JSON
, as the name implies, should be the file path to your translated .json
file. The easiest way to not make a mistake is using Wolvenkit to get that file path:
Do a Right Click
on your .json
file and select Copy relative path to game file
. Then paste the contents in your ArchiveXL file.
This is how the code should look on this example:
Is important that you keep the indentation as shown in the code examples. It's also extremely important that you use backslash
(\
) instead regular slash
(/
) for the file path if you do it manually.
Wolvenkit will pack your mod with a one click press. You can also install your files for yourself to test them and see if your changes are properly working.
Click on Pack mod
to create a ready to upload zip file and Install mod
to install it in your game files.
And, finally, your translation file is ready to be tested or distributed. This is how the files should look once installed:
Your packed file will have the proper file path ready to be extracted directly on the main game folder (and also compatible with Mod Managers). This packed file will be located in your Project main folder:
.archive
modInstall all the previously mentioned requirements and download the mod you want to translate (if you haven't already). Create a Wolvenkit project.
Open your project, once loaded open the Assets Browser
. Once open, click on Mod Browser
:
When you click on Mod Browser
, your system may get frozen for a few seconds, depending on how many .archive
mods you have in your system. Once loaded, look up for the mod you want to translate:
Open the internal folders until you find the Localization File you want to extract:
Once found, do a Right Click
and select Add selected items to project
:
As the name implies, you now have the .json
Localization file in your project:
To avoid conflicts with the Mod you are translating, let's change the file path to a new one.
Hover over archive
folder and click on the yellow icon to open it on Windows Explorer
:
Inside Windows Explorer
, create some new folder. For this example, I'm going to make one called localization
, and inside that folder I'll create two folders called es-es
and es-mx
, to follow the internal naming convention for supported languages.
Once the folders are created, on Windows Explorer
, I'll copy and paste the .json
file into the es-es
and es-mx
folder. This is how it'll look on Wolvenkit once it's done:
Now you can remove the original extracted folders and extracted .json
file to avoid the conflicts with the Mod you are translating. Hover over base
(on this example), and click on the red icon with the trashcan to Delete this file/folder
:
After deleting the folders, this is how your project will look, ready to be translated:
You can read this part of the tutorial to get more insights on translating a .json file on Wolvenkit.
After finishing your translation, you are ready to do the mandatory final steps to pack it or/and install it in your system. Be sure to include the ArchiveXL file or your translation won't work.
I hope that this guide was helpful. Good luck in your text translations!
Soon I'll include the steps on how to upload it correctly to Nexus, so the Mod you are translating gets a beautiful flag and your mod automatically listed under the Translation segment.
The following section needs to be updated with more info. This section was created by iwasniko
Most mods will be using in-game files for this. You'll run into one of two cases:
You need a Wolvenkit Project with the relevant files from the original mod:
.wem
for audio translations
For how to get there, see Analysing other mods
The mod is only "pointing" at the original game files, and they're loaded from the player's local copy and will be in whatever language they're running.
TODO: Which file(s) defines those? If there is no original mod author and the mod links to in-game files, how can we custompath them?
If you want to translate them anyway, you need to add the audio files from your translated version to your Wolvenkit project and send them to the original mod's author.
Assuming that the original mod author did not rename the files, this makes it easier for you.
Add the file to your Wolvenkit project
Overwrite the original file
When you pack your mod now, it will use the translated files. If it doesn't, make sure to check your load order.
You can listen to audio files by simply selecting them in the Wolvenkit Project Browser and using the built-in audio player. See on the Wolvenkit wiki for a screenshot.
with each file name
You'l have no choice but to find the right file from hand in the sources, which means you have to for the extension .wem
.