taisei icon indicating copy to clipboard operation
taisei copied to clipboard

Add languages thing

Open Aldair502 opened this issue 1 year ago • 4 comments

Idk. i mean, i could change every dialogs on https://github.com/taisei-project/taisei/tree/master/src/dialog to another language. but i don't want to make forks and edit every .c file everytime i want to use another lang

Aldair502 avatar Jan 07 '24 09:01 Aldair502

A language selector? I think it's a nice addition to the game, but do we have people willing to translate the game?

I'm no professional in programming and Taisei's large codebase still overwhelms me, but maybe I can give this one a shot! It's a good opportunity to learn more about the internals of the game.

Nhalrath avatar Mar 30 '24 09:03 Nhalrath

I attempted to take this one today, but it looks like non-English characters are not supported. My guess is that the fonts themselves doesn't have the necessary glyphs for these. screenshot

I'm not familiar with how fonts are handled, so I guess I'll pass on this one.

Nhalrath avatar Apr 16 '24 12:04 Nhalrath

Taisei's text renderer can handle non-English characters just fine, but the font we're using indeed doesn't support any CJK characters. GUI applications typically fall back to other fonts when the desired one is missing glyphs. Unfortunately, Taisei does not support this yet; we can only draw with one font at a time. Adding a fallback system is possible, but non-trivial… anything to do with text rendering is generally more complicated than you'd expect.

The idea of supporting localization came up quite a few times. I'd like to tackle it eventually, but it's a low-priority thing for now. I definitely want to finish the extra stage and finalize all the dialogue before starting on localization.

For the brave and adventurous: if you want to try implementing font fallback yourself, start here. Everything to do with font loading, glyph caching, and text drawing is currently in that file. And always feel free to ask me on Discord or by email about any aspect of the codebase.

Akaricchi avatar Apr 16 '24 23:04 Akaricchi

Yes, I wish to make a Chinese translation (as non-CJK characters are too out-of-character when playing this game), and the Chinese/Japanese font can use the open source Source Han Sans.

Firestar-Reimu avatar May 21 '24 07:05 Firestar-Reimu