How to prepare a WeiDU mod for translation

Crowdsourcing mods translations.
Post Reply
User avatar
Magus
Site Admin
Posts: 474
Joined: Mon Nov 21, 2016 9:13 am
Contact:

How to prepare a WeiDU mod for translation

Post by Magus »

If you want to translate your mod at BGforge, it will require some preparation.

You will need to use a version controlled hosting for the mod. Github, Bitbucket, any other git (or even mercurial, subversion) hosting should do. Easiest to use is Github.

Once you have that, you can start preparing the mod. That basically boils down to having proper file and directory names and correct encodings. Because Weblate cannot guess those things, you should follow the convention to provide this info.
If you're having problems with these instructions, refer to Ascension repo for live example. If still not clear, ask on the forum.

1. Dedicate a separate directory to translations. It could be "tra", or "language", or anything else. Just don't store other stuff in that directory.
Example:

Code: Select all

ascension/lang/english
ascension/lang/french       
2. Name language directories per WeiDU infer_charsets convention, using the english version. Not "american", but "english". Not "italiano", but "italian". Example:

Code: Select all

ascension/lang/spanish
ascension/lang/polish       
3. Move all WeiDU setup strings (components names, etc - everything printed to console during installation) into a separate file. It must be called either "setup.tra" or "install.tra".

4. Ensure that all EE-only strings are stored in files ending with "_ee.tra" or named "ee.tra" AND they are encoded in UTF-8.

Code: Select all

ascension/lang/spanish/ee.tra
ascension/lang/spanish/dialog_ee.tra       
(Also note that the corresponding translation files will be extracted with UTF-8 encoding too. To summarize: all "ee.tra"/"*_ee.tra" files in the mod will be in UTF-8. That is a convention for you to specify which files you want in UTF).

5. Ensure that all remaning files are using proper encoding, as per WeiDU documentation.
Special note: setup.tra/install.tra in Russian must be in cp866, not cp1251.

6. Ensure that all existing translations are actual:
- There are no, say, english strings in french tra files
- There are no outdated strings (when a source language string was updated, but translation was not).
Delete any such strings.

7. (For the time being) Ensure that source tra files are delimited by tildes: @1= ~Test~ (as opposed to quotes @1= "Test"). For now only tildes are supported.

8. Create a .bgforge.yml file. It shows where the translation files should be found. The two directives are "tra_dir" (directory with translations) and "src_lang" (source language). Defaults values are "tra" and "english". If your values differ from defaults, you need to specify them in the config.
Example:

Code: Select all

translation:
  tra_dir:  ascension/lang  # if this is just "tra", you don't need to specify it
  src_lang: russian         # if this is "english", you don't need to specify it       
9. Add github hook.

10. Create a request topic here, specifying mod name and repo url.
If you have existing translations, they can be pre-loaded.

11. Subscribe to github integration annoucement topic.
Please do not PM or email me about my mods and projects. Use forums. Also, see our talk channels.
User avatar
Magus
Site Admin
Posts: 474
Joined: Mon Nov 21, 2016 9:13 am
Contact:

Re: How to prepare a WeiDU mod for translation

Post by Magus »

Note: we are now using yaml instead of ini, see the updated instruction.
Please do not PM or email me about my mods and projects. Use forums. Also, see our talk channels.
Post Reply