BGforge translation system. Language-specific forums for translators are inside.
Locked
User avatar
Magus
Site Admin
Posts: 317
Joined: Mon Nov 21, 2016 9:13 am
Contact:

How to prepare a WeiDU mod for translation

Post by Magus » Sun Dec 03, 2017 11:10 am

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

First thing you should note is that once you offload translations to BGforge, you will no longer be able to edit them directly. All new translations will have to be added through web interface. No mix and match.
(But you can disconnect and go back to manual translation later, should you change your mind).

Second, you will need to use a version controlled hosting for the mod. Github, Bitbucket, any other git (or even mercurial, subversion) hosting will 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 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       
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.

6. 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       
7. Add github hook.

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

9. 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: 317
Joined: Mon Nov 21, 2016 9:13 am
Contact:

Re: How to prepare a WeiDU mod for translation

Post by Magus » Tue Jul 23, 2019 4:15 pm

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.

Locked