Skip to content

Creating a Translation

oddlama edited this page Jun 17, 2021 · 3 revisions

This is a step-by-step guide which will help you to create your own translation of vane. We value all efforts going into translation of this plugin into more languages, and would highly appreciate a pull request if you like to share your work!

1. Creating a Translation

To prevent having to compile the plugin each time a change is made, we will develop the new translation by creating it in the configuration folder on server running vane. It might be convenient if the server is a local test server that doesn't has resource pack distribution configured. This makes the testing procedure easier.

  1. Have a server ready with all vane plugins, so you can generate a resource pack to when you want to test your translation. The server should have been started at least once, so all the configuration files were created. Each module saves it's language files under plugins/vane-<something>/.
  2. In each of these folders, you need to copy lang-en.yml to lang-xx.yml, where xx should be the language code of your desired language. This code is never used semantically, so if you are writing e.g. a french-canadian translation, you may choose lang-fr-ca.yml to not clash with the default french version.
  3. Replace the country code en_us at the top of the file with the corresponding locale code from here (e.g. fr_fr for french). This is important, as it decides which language of Minecraft it corresponds to, and this is the language the user has to select in Minecraft to use your translation.
  4. Translate all messages in the file, and be sure to inform yourself about the language file structure before.

Depending on the target language, DeepL can really help in doing most of the heavy lifting. You then mostly have to fix the grammar or some weird word choices if you did use it.

Disclaimer

As I've just noticed, there currently is an inconsistency that makes the generated resource pack only contain the translations that were present in the original project (so -en and -de), but ignore all new custom language files. I'm working to fix this, but will probably release it with the update to 1.17.

Until then, the easiest way to develop is to just change the translations in the english language file. Basically don't override the language code at the top and just change all message strings. When you are absolutely sure you are finished, you can then rename the file, change the language code to fr_fr and submit that one to the repository instead. You can always come back to me if anything is unclear.

2. Testing

To test the new translation do the following:

  1. Start the server
  2. Run /vane generate_resource_pack
  3. Copy the resource pack directly into your client's resource pack folder and activate it, and don't let the server distribute it.
  4. Join the server and see if everything works as expected.

3. Submitting the language files to upstream

  1. Fork this repository
  2. Each vane module vane-<something> contains a folder vane-<something>/src/main/resources/ (except for vane-waterfall which has no localization). This folder contains the default english language file lang-en.yml, as well as any additional languages.
  3. In each of these folders, you need to place your corresponding lang-xx.yml file.
  4. Commit to your fork and submit a pull request, I will then verify that everything is correct, give feedback, and if everything is alright I might merge your pull request.