Skip to content

Info for Translators

Gaelmare edited this page May 15, 2023 · 1 revision

Translation Process

If you wish to translate TerraFirmaCraft into your language, there are multiple parts:

  1. The translation of the mod itself (Blocks, Items, Tooltips, etc.)
  2. The translation of the in-game and online Field Guide.

In both cases, the translation is done by creating/editing files which map keys to newly translated values. For example, if your language code was ab_cd, you would copy en_us.json, and rename it to ab_cd.json, and edit your newly created file. The three files in question are:

In order to submit your changes, you have a couple options. One, is to contact @AlcatrazEscapee (Hello!), via the TerraFirmaCraft discord, with your newly added files. The other is to submit a Pull Request to this repository, and/or the Field Guide repository. This is a way to submit your changes to our source code.


Testing the Field Guide

If you wish to test your translation of the Field Guide, you will need to generate the field guide data, which will require setting up, at least part of, the mod development environment. The instructions here are copied from /resources/generate_book.py:

First, you will need to have a Python environment with the required dependencies installed (see /resources/requirements.txt).

Then, in order to use, all you need to do is run

> python resources book --translate <lang>

Where <lang> is your language, i.e. en_us. This will do several things

  • If a <lang>.json file does not already exist, create one
  • If a <lang>.json file already exists, it will read it and use it to translate text in the book
  • Finally, the <lang>.json will be updated with all text actually used by the book, and missing entries will be filled in.

If you then wish to view the book in-game, you will need an external Minecraft instance, setup with TFC to test the book in:

  1. Run python resources book --local <.minecraft directory> --translate <lang> with the parameter --local set to the .minecraft/ directory of a local minecraft instance. It should say "copying into local instance at "
  2. Launch Minecraft in this instance with TFC installed.
  3. There will now be two books (These can be found in the creative "Miscellaneous" tab):
    • /give @p patchouli:guide_book{"patchouli:book":"tfc:field_guide"} // This is the TFC book, used by the inventory screen
    • /give @p patchouli:guide_book{"patchouli:book":"patchouli:field_guide"} // This it the Patchouli namespaced book, which is hot reloadable. It is loaded from /.minecraft/patchouli_books/
  4. The latter book can be hot reloaded at any time:
    1. Run the above command again.
    2. While in creative, go to the book main landing page, and shift-right-click the little pen/pencil icon.
Clone this wiki locally