Translate the mod
If you want to contribute towards DragonMine Z, you can do so by translating the Mod's lang.json file. This file contains all the text that the mod uses, such as item names, descriptions, commands output, GUI text and more.
To translate the mod, you need to follow these steps:
I. Check the current available translations
Before starting a new translation, check if the language you want to translate is already available.
The mod by itself comes with the English language, Spanish (Latin América) and Spanish (Spain) translations.
If you want to translate to a different language, you can check the
mod Source Code on GitHub or Crowdin to see if the language you want to translate is already available.
II. Instructions for creating a new translation
If the language you want to translate is not available, you can create a new translation:
1. Copy the en_us.json
file from the lang
folder in the mod's source code repository/crowdin project.
2. Rename the file to the language code you want to translate to. Acording to the Locale Code used by Mojang, for example: fr_fr.json
.
3. Make sure to keep the same structure and format of the original file.
4. The .json file must be saved using a text editor that supports UTF-8 encoding. We recommend using Notepad++.
If your language uses a character set which needs to be handled with Unicode characters, you can type them directly into the file. There is no longer a need to use Unicode hexadecimal Numeric Character Reference (NCR) codes (like \u0202).
Example:
Incorrect: Correct:III. How to translate a .json file
-
Open the .json file with a text editor that supports UTF-8 encoding, such as Notepad++. You'll see a structure like this:
-
Translate the text on the right side of the colon
Incorrect: Correct::
. Do not translate the text on the left side of the colon:
.
Example: -
Many strings contain one or more placeholders. For example,
%d
is a placeholder that will be replaced by a number when the string is displayed; and%s
is a placeholder that will be replaced by a string. Also, some strings contain color codes,\u00A7
is referred to as the section sign,§
, the color code formatting character in Minecraft. You can see the color codes here, to make this work, you have to follow the color code by a letter or number, for example,\u00A7b
will make the text blue, while\u00A7r
will reset the color to white.
You must keep these placeholders in the translated text, but you have the freedom to reorder these parameters if it is required by the grammar rules of your language. For Example:
When the above phare is displayed ingame, the placeholders will be replaced by actual ingame values, like this:
"You have set the ezShokkoh's points to 1750."
Remember: - Do not add line breaks or HTML to any of the strings. - Do not translate or remove the special characters combinations used by Minecraft to change colors. (\u00A7b = §b)
IV. Testing the translation
- Use a zip program like WinRAR or 7-Zip to open your DragonMineZ.jar file.
- Navigate to the
assets/dragonminez/lang
folder and put your translated file there. - Close the zip program and launch the game, then select the language you translated to in the game's language settings and check if the translation is working correctly.
- Please test the translation as best as you can, specially to see if the placeholders are being replaced correctly and if the text fits in the GUI.
- If you find any issues, you can fix them and test again.
V. Submitting the translation
- Once you have finished translating and testing the file, you can submit it to the mod's GitHub repository or Crowdin project.
- If you are submitting to the GitHub repository, you can create a Pull Request with your changes.
- If you are submitting to the Crowdin project, you can upload the file directly to the project.
- Alternatively, you can contact us by opening a Ticket on the DragonMine Z Discord and send us the file.
Also, you can check the Contributing Guidelines on the DragonMine Z GitHub for more information.