Truinto / ONI-Modloader-SimpleMods

OxygenNotIncluded Mods
MIT License
16 stars 6 forks source link

Do you mind people translating your mods via "Mod Translation"? #25

Closed DDEle closed 2 years ago

DDEle commented 2 years ago

Hi Truinto,

I'm the author of Mod Translation. Do you mind people adding translations of your mods in including this one with Mod Translation? You don't need to change anything in your code (though welcomed) and you are not expected to keep your mod stable.

Mod Translation is designed for modders and translators and helps mods to be international easily and timely. It worked by downloading translations from a Github repo and overriding game strings with them, which means your mods don't need to update and force everyone to restart their game for a new language to appear, and Steam failing to update is not an issue either. Similarly, it also makes the translator's life easier when adding or updating mod text in terms of updating translations accordingly. (continuing)

You may have noticed that there are only a few or none of your users who have requested or contributed translations of your mods. IMHO, one of its reason is that not all developers are active and people often get very slow responses when they request or contribute translations. Mod Translation can help solve this problem as only one of the active admins of Mod Translation Repo is necessary to accept translations for all mods (maybe one for each language later for QC). Meanwhile, translators can browse Mod Translation's repo and get a list of mods waiting for translations without opening the steam workshop page for every mod.

Mod Translation only holds strings for translation. Therefore, it will never be able to steal your work as users must subscribe to the original mod (or install locally if you have made that possible). Both the mod itself and the repository that holds translations are with MIT license and are free for everyone to use and contribute. If you don't mind me adding support to your mods, you will be able to opt out at any time later.

Truinto commented 2 years ago

I do have implemented a translation system into my mod. It's probably more complicated than it had to. Looking back I probably should have looked up how other people solved the issue.

You can see the code here: (probably not interesting) https://github.com/Truinto/ONI-Modloader-SimpleMods/blob/8667863a2d6d136d4a29d1b29ed4f531cadb52d9/src/Common/Helpers.cs#L286

There is also my solution to have the config file translated: (this is relatively important for my mods, since I have little ingame text, but a lot of configuration) https://github.com/Truinto/ONI-Modloader-SimpleMods/blob/8667863a2d6d136d4a29d1b29ed4f531cadb52d9/src/Common/ConfigManager.cs#L15

I do use the internal strings dictionary, so your project probably works for my mods. The ids are in this file "strings_.pot" which are in the mod folders (some of them at least). You can get the zips from Steam or here: https://github.com/Truinto/ONI-Modloader-SimpleMods/tree/master/Mods

Example:

#. CustomizePlants.LOCSTRINGS.WildFlowerVase_ToolTip
msgctxt "CustomizePlants.LOCSTRINGS.WildFlowerVase_ToolTip"
msgid "When true, the basic Flower Pot grows plants as if they were wild."
msgstr ""

Not sure what of this info you even need. Your readme doesn't explain how it works and I didn't take the time to read your code. Ah, never mind it states

Mod Translation only provides translation strings.

I thought you might overwrite building names or even replace dll strings. But that's quite difficult.

I will upload any submitted translations to Steam as well. I don't mind your project. Feel free to do whatever you want. Although I do not see how you organize the translations. Do you just use the issues tab here: https://github.com/ONI-Wiki-zh/ONIi18n ? Mh, I wonder how to automated that a little bit...

Ventulus-lab commented 2 years ago

hi, Truinto I can explain a bit for DDEle's translation mod. The most usage of his mods is that some mod authors don't have a lot of energy to put into the game and mod improvements. Translators are unable to contact the mod authors for a long time . This is where DDEle's mods can serve as an alternative and immediate solution. There are many mods in this situation where the author is unable to update them. If the author mod author is as keen as you are to get the translation into the mod in time, then of course submitting it to the original author would be the best option. Technically speaking, DDEle is extracted the strings that the mod registered to the game and is valid for most cases. This is not a bad alternative and effective solution.

DDEle commented 2 years ago

Hi Truinto, thank you for your explanation of how your mods manage translations. Basically, ModI18n works by trying to Strings.add translation stings in multiple stages (for compatibility reasons) of game lanunching. I also thought about patching Strings.add itself but I just don't have to test its performance impact. And yes, replacing dll strings probably needs a per-mod solution.

https://github.com/Truinto/ONI-Modloader-SimpleMods/blob/8667863a2d6d136d4a29d1b29ed4f531cadb52d9/src/Common/Helpers.cs#L286

For StringsLoad and LocalizeTypeToPOT, it may be better to use the global::Localization.GenerateStringsTemplate, global::Localization.OverloadStrings and global::Localization.LoadStringsFile.

Do you just use the issues tab here: https://github.com/ONI-Wiki-zh/ONIi18n ? Mh, I wonder how to automate that a little bit...

Currently, yes. There is a plan to integrate it with SmartCat with serge.io, but I'm not sure when.

Again, thank you for your friendly explanation above and all the work you have done to make your mods localizable.

Truinto commented 2 years ago

There are some rules about localization I do not know. It makes this very frustrating. For example, naming a file 'zh.po' in the mod folder is not allowed. It will just crash.

Truinto commented 2 years ago

Well, do you know what's going on? Apparently if any file is of type .po it tries to load that file as a translation for the whole game.

DDEle commented 2 years ago

I think so. But I have no idea why it crashes games.