GDQuest / learn-gdscript-translations

Translations for the open-source app Learn GDScript From Zero
MIT License
31 stars 13 forks source link

In engine cant show Chinese currectly. #126

Open wo-ri-gou-le opened 7 months ago

wo-ri-gou-le commented 7 months ago

I'm submitting a...

Bug report

What is the current behavior? In Godot cant show Chinese currectly.

So I've been working on the Chinese zh_Hans ver for few days, and have compility finished first 10 courses. So I tried to test them in Godot, followed the method in the readme doc. I download the PO files and put them in the right place. Run the project in Godot3.5, and in language settings it showed up, well, kind of.

The problem is, once switch to Chinese, every piece of sentence just disappeared, or been replaced with empity spaces I looked through the files and found where those PO files were placed in. the py script grabbed them in place correctly.

Tell us the steps to reproduce the bug, and if possible share a minimal demo of the problem. So my theory is that, maybe Chinese is not supported by the font or something? Cause I also saw that classic diamond-shaped ? thing a lot.

Sorry that I dont have further skills to dive into those longlong scripts to find it out. But I am sure and really into make Chinese translation happen there, I will complete the translation very soon. I know that this project is quite old and not focused on, so I may not get a quick response. That's fine, once I fixed the buggy translation, I'll try more on this problem and see if I could just solve it by myself. image image

wo-ri-gou-le commented 6 months ago

Ok, I spent some time on it and found the logic that font works, now the problem is clear. The original font is OpenSans and just dont support Chinese charactors. I changed it into something I use and it turned ok. But still I have no idea how to merge this into the original project, cause I need to twick things like line spacing to make it readable to chinese learners. Which means when switched to CN in settings, format things like line spacing and font need to be reconfigured.

NathanLovato commented 6 months ago

Thanks for taking the time to write about and look into this. Translating to Chinese is a big project, not only because of the translation itself, but also because of the technical challenges you're facing.

There has been work towards it by a contributor, you can find it here: https://github.com/GDQuest/learn-gdscript/pull/688

We would like the fonts to be downloaded on demand instead of being included in the project, to avoid adding dozens of mb. of download to everyone for languages they don't use.

Then, the line spacing and all that are tricky with Godot 3, the version of Godot we used at the time. So, our general plan is to make a new course that's web-native in the future, so we can leverage all the tooling, system fonts, and accessibility features of the web.

In the meantime, for Learn GDScript, we depend on contributors for translations and technical improvements for translations. If someone volunteers to work on the line spacing and font download, I'll be happy to follow up and merge the features.

wo-ri-gou-le commented 6 months ago

@NathanLovato Much thanks for your reply and explianation! Yes I check that it will take 24mb to add CN to this😨... Which is not a good idea to just add as a default for something that need to run in webpages.

Im thinking maybe we could just add a different version of the app for example, another page in itch.io, is that a possiable approach? Your team made some really great courses, and I do wish more people could get a chance of accessing.

Also, I am finishing localization in like 2 days. And I wonder if is it ok for me to just pack a CN ver by myself and share it online with my friends? I can mention the origin in the beginning with links to all sort of things. (I am still a student and in China, and there's lots of communities where students like me chat and make games together, doing gamejams etc. So there is really a lot of people came with no ability to code and want to learn)

I was actually planning to make tutorial videos with this, quickly go though the course and make explainations whenever things ain't that much clear. Then publish them on Bilibili, which is youtube in China. I have no intend to make any cash with it, just had this feeling of sharing good stuff to people who should have known it in their beginning.

But yes I found myself come in an awkward period of time, this project is a bit old, and Godot4 is freash like releasing a new gaming consle. This project is indeed a little behind like an old playstation3 game, haha.

In conclusion, I understand the problems there, and am glad to know that this is going to be fixed in the upcoming new course. And I want to know if it is OK that I pack CN ver with links to the original and share that free online? Or if possiable, could we just have a new itch page that contains this bloody bigger CN version?

NathanLovato commented 6 months ago

Im thinking maybe we could just add a different version of the app for example, another page in itch.io, is that a possiable approach?

It's definitely possible, but probably not recommendable. It's more work to maintain two separate versions of the same project. You need to set up a build system to work for the two versions, and you need to keep both versions up to date.

Downloading the CJK fonts itself is not very difficult code, nor is getting the line spacing etc. right. It just takes time, and we have enough work to keep us in crunch until the end of the summer right now.

is it ok for me to just pack a CN ver by myself and share it online with my friends?

Absolutely! You can do anything you want: this project is free and open source. You can share it with your friends, make tutorials around it... whatever you'd like! There are schools using it to introduce their students to code.