Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

i18n support (adding translations) #165

Closed
chisaato opened this issue Oct 21, 2020 · 11 comments · Fixed by #445 or #538
Closed

i18n support (adding translations) #165

chisaato opened this issue Oct 21, 2020 · 11 comments · Fixed by #445 or #538
Assignees
Labels
enhancement Feature requests or new functionality suggestions first good contribution This issue makes a good first submission for someone looking to contribute to MCprep
Milestone

Comments

@chisaato
Copy link

I like this addon and if it has i18n support, it will more easy for user to learn it

@TheDuckCow TheDuckCow added the enhancement Feature requests or new functionality suggestions label Oct 21, 2020
@TheDuckCow
Copy link
Member

TheDuckCow commented Oct 21, 2020

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)

@ttrtty5
Copy link

ttrtty5 commented Dec 13, 2020

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

@TheDuckCow
Copy link
Member

TheDuckCow commented Jul 12, 2022

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

@TheDuckCow TheDuckCow added this to the v3.5.0 milestone Jul 12, 2022
@chisaato
Copy link
Author

ok i will try fork it and start a new branch.

@StandingPadAnimations
Copy link
Collaborator

I think I'll get started on this

@StandingPadAnimations
Copy link
Collaborator

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/

@StandingPadAnimations
Copy link
Collaborator

Only problem is that now, we need to manually translate different parts of MCprep, there's no automatic translation

@StandingPadAnimations StandingPadAnimations added the first good contribution This issue makes a good first submission for someone looking to contribute to MCprep label Mar 21, 2023
@StandingPadAnimations
Copy link
Collaborator

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

@chisaato
Copy link
Author

Great, having a standalone file storing translates can have more flexelibity. using structed format like json could parse it more easily.

@TheDuckCow TheDuckCow changed the title i18n support? i18n support (adding translations) Apr 2, 2023
@StandingPadAnimations
Copy link
Collaborator

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)

@StandingPadAnimations StandingPadAnimations self-assigned this Aug 7, 2023
@StandingPadAnimations StandingPadAnimations linked a pull request Aug 7, 2023 that will close this issue
@StandingPadAnimations StandingPadAnimations linked a pull request Aug 17, 2023 that will close this issue
@StandingPadAnimations StandingPadAnimations modified the milestones: v3.5.1, v3.6.0 Sep 20, 2023
@StandingPadAnimations StandingPadAnimations linked a pull request Jan 1, 2024 that will close this issue
@StandingPadAnimations StandingPadAnimations linked a pull request Jan 31, 2024 that will close this issue
@StandingPadAnimations
Copy link
Collaborator

I'll close this as completed since we've gotten preliminary support, which we'll be expanding on in the next couple of releases.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Feature requests or new functionality suggestions first good contribution This issue makes a good first submission for someone looking to contribute to MCprep
Projects
Status: Done
4 participants