MCprep
MCprep copied to clipboard
i18n support (adding translations)
I like this addon and if it has i18n support, it will more easy for user to learn it
Thank you for calling out the need for internationalization support! Agreed, this should be a top priority for making this more usable. Will use this space to reference exploration of the "right" way to support i18n. For now, referencing this thread on another repository I help maintain.
Adding additional resources as I come across them:
- Blender's page on internationalization for addons, noting I believe this is more for blender internal teams which have an explicit role of processing the translations themselves. Would be good to see what this process looks like.
- The link above is for core blender, whereas this is for other addons/code. Indeed it seems the recommended approach includes this .po msgid approach.
- Further down in the above link, see the section "Translating non-official addons" where the use of translations_dict is in play.
- See the render_copy_settings addon as an example (as per page above)
I like this addon and if it has i18n support, it will more easy for user to learn it
https://www.bilibili.com/video/BV1Wa4y1s7ti 如果你需要的是中文翻译,这个视频里有翻译的软件,可以翻译mcprep blt可以翻译到其他语言,但是因为开发者忙于工作,所以仅限于中文 我的英语水平很烂,所以写了两遍 If you need Chinese translation, there is translation software in this video, you can translate mcprep blt can be translated to other languages, but because the developer is busy with work, it is limited to Chinese My English is poor, so I wrote it twice
Bumping this back up, I think it would be good to start working on this in a parallel branch. There may be a few ways to approach translations, but here is at least one example using the built in blender setup for string mapping.
Per subpage above, this is probably a better general starting point: https://docs.blender.org/api/current/bpy.app.translations.html
ok i will try fork it and start a new branch.
I think I'll get started on this
So I found a guide on localization. Blender provides an API for it: https://b3d.interplanety.org/en/localization-of-blender-add-ons-with-api/
Just need to confirm this works in 2.78+. If it doesn't, there's also an older way: https://b3d.interplanety.org/en/localization-of-blender-add-ons/
Only problem is that now, we need to manually translate different parts of MCprep, there's no automatic translation
So I think what we could do is have a bunch of JSON files (with the name set to the language in question), with the following format:
{
"language" : "<language here>",
"translation" : {
"<insert something from the UI>" : "<translation>"
}
}
That way users wanting to translate only need a text editor (even Notepad works in this case). MCprep could then load these JSON files at startup
Of course opening up translations to the userbase also runs the risk of Google Translate (or something simillar) being used, but that's whole other discussion
Great, having a standalone file storing translates can have more flexelibity. using structed format like json could parse it more easily.
I've now opened a GitHub issue to track progress on this (#439) and have started work on i18n support for MCprep 3.5.1 (so not next release, but the release after next)