1. =================================================
  2. == I want to create a translation for this mod ==
  3. =================================================
  4. If you are willing to participate and make this mod support a new language, you can do it easily by following these steps:
  5. =================================================
  6. 1- Download and install WolvenKit (https://wiki.redmodding.org/wolvenkit/getting-started/download)
  7. =================================================
  8. Follow the instructions on this page to install and configure WolvenKit properly before creating your mod.
  9. Especially the last paragraph for setting game path: https://wiki.redmodding.org/wolvenkit/getting-started/download#first-launch-tl-dr
  10. =================================================
  11. 2- Create a new mod project
  12. =================================================
  13. Open WolvenKit and create a new project. I recommend you to use the name you will want to use when publishing your mod on Nexusmods. Set version to 1 as you will have to update your mod if this mod evolves and add new labels for example.
  14. =================================================
  15. 3- Create a unique folder for your assets
  16. =================================================
  17. Once in the editor, look at the project explorer on the left and see the "archive" folder. This folder represents the internal file system of the game. All the elements under the archive folder will end into a "*.archive" file to deploy into the game (Cyberpunk 2077\archive\pc\mod). This means that if you create a file named "test.json" under archive, and another mod author creates the same file in the same place then both of your mods will collide with each other.
  18. This is why you must create a folder with a unique name that is very unlikely to conflict with another mod. I recommend you to create a folder containing your username and a random alphanumeric string. For example: "mynickname_z12z5s8s98f9"
  19. To do this right-click on the archive folder and create a new folder.
  20. =================================================
  21. 4- Copy the original language file content from my mod
  22. =================================================
  23. You want to create a translation mod for an existing mod right ? Then you need to copy the localized data from the original mod and duplicate it into your own mod. Then you will modify its content.
  24. For this step to work you must have configured WolvenKit correctly so it knows where your game path is.
  25. Then click on the Asset Browser tab. This is the window that allows you to browse into the game files. Enable the "Mod Browser" toggle so it will display only the mods you have currently installed into your game.
  26. Find the mod you want to translate and open it. Here we will use the example of EVS mod. Under EVS mod go down into the folders until you find some language file named "en-us.json". This is the file you want to copy into your own mod in order to modify it.
  27. Right-click on this file and click on "Add selected item to project" with the yellow arrow.
  28. Then move the file by drag-and-dropping it into your unique folder. Your file is now secured and won't collide with any other mod.
  29. Don't forget to remove the folder hierarchy that has been created automatically.
  30. Before editing the file's content, give it a name that represents what it should contain.
  31. For example if you are creating a Italian translation mod, you can name it "italian_lang.json" or "it-it.json".
  32. You should now have a project structure like this:
  33. .archive
  34. ...|
  35. ...> mynickname_z12z5s8s98f9
  36. .......|
  37. .......> italian_lang.json
  38. .raw
  39. .resources
  40. =================================================
  41. 5- Create a XL file to configure the translation settings
  42. =================================================
  43. The JSON file you have created will contain all the language data of the mod.
  44. But this file is not known by the game, so you need to add a XL file into your project in order to tell the game what language you are implementing and what file will contain this data.
  45. Use the menu : File > New File
  46. Click on "ArchiveXL" and then choose the XL file type.
  47. Give your file the name of your mod. For example: "Italian translation for EVS mod.archive.xl"
  48. This file will be placed into "Cyberpunk 2077\archive\pc\mod" next to your '*.archive' file so it is better that both files use the same name.
  49. Once the file is created use a text editor like Notepad, Sublime Text, or Visual Studio Code to edit its content.
  50. Set this as the content of the XL file (replace all the DOTS with spaces !):
  51. ..localization:
  52. ....extend: Enhanced Vehicle System.archive.xl
  53. ....onscreens:
  54. ......it-it: mynickname_z12z5s8s98f9\italian_lang.json
  55. You must replace "it-it" by whatever language you are implementing. To get the complete list of supported languages go into the Asset Browser, uncheck the "Mod Browser" toggle, and look into "base\localization" folder then you will have a list of files and folders. Folders will have a lang code like en-us, fr-fr, cz-cz...
  56. You must use one of these codes that correspond to your mod language.
  57. If you are unsure, check on Google for these codes as they are standard.
  58. Then you must use the exact internal file path to your JSON file. To do this go into the Project Explorer and right-click on your JSON file then click on "Copy relative path to game file" and paste this value in the text above.
  59. Finally next to "extend: " you must use the name of the file from the original mod. Here this is for EVS mod.
  60. =================================================
  61. 6- Implement the language data
  62. =================================================
  63. Now you have set everything, you can finally edit the JSON files content to implement your new language.
  64. Under the archive folder, the files are not stored as clear data. This means that you cannot directly edit your JSON file as is.
  65. The format used under "archive" is called CR2W and is a binary format used by the game.
  66. In order to edit your file you must first convert it into text.
  67. To do this right-click on your JSON file, click on "Convert to JSON".
  68. This will create a new "clear-copy" of the file under: raw -> mynickname_z12z5s8s98f9 > italian_lang.json.json
  69. This "json.json" file is the clear text file you need to edit with a text editor of your choice like Notepad, Sublime Text, Visual Studio Code...
  70. When you have finished to edit the file, you must convert it back into CR2W.
  71. Click on the "json.json" file and click on "Convert from JSON". This will update the CR2W copy under the archive folder.
  72. You can then click on "Install Mod" in the menu bar and launch the game to test your modificaitons.
  73. You must know that in order for your language to be used in game, your game must use the language you have implemented. This means that if you are implementing Italian language, you must configure your game to run as a Italian copy. You must do this in Steam, GOG or any other launcher of the game.
  74. =================================================
  75. 7- How does the translation data work ?
  76. =================================================
  77. In the "json.json" file you will see a long list of entries. This is one entry:
  78. ..{
  79. ...."$type": "localizationPersistenceOnScreenEntry",
  80. ...."femaleVariant": "Auto-start engine during combat", <------------------- This is the value you need to update
  81. ...."maleVariant": "",
  82. ...."primaryKey": "0",
  83. ...."secondaryKey": "hgyi56-EVS-settings-power_state-autostart_combat"
  84. ..}
  85. Each entry corresponds to a text label of the game. The "femaleVariant" will contain the localized text you need to modify.
  86. Do this for all entries and you will be done.
  87. Do not forget to convert your "json.json" file back into CR2W or nothing will happen in game !