CJK Char input

Discuss translation of Daggerfall Unity and the required Daggerfall installation. Help other communities learn how to translate Daggerfall using any available tools and processes.
높은산_낮은산
Posts: 40
Joined: Mon Apr 17, 2023 11:33 am

CJK Char input

Post by 높은산_낮은산 »

As i was put most of my time in translate text files, didn't realize there is big problem. :o
you have no way to input Korean Char(like fast traval find, CHAR name), even though location names translated. so you can read where but can't find where in worldmap. unless using quest journal

i can bypass this problem by add original names like "대거폴(daggerfall)" but names like "The Unfortunate Scorpion Inn", it gonna be "불행한 전갈 여관(The Unfortunate Scorpion Inn)" which is just too long and considering %locationnames in journal and ohter dialogue, it gets Weirder

there is other option that just do not translate location names, that i might gonna take...

but before that...
HELP!!!

높은산_낮은산
Posts: 40
Joined: Mon Apr 17, 2023 11:33 am

Re: CJK Char input

Post by 높은산_낮은산 »

I asked around and they said it would be difficult to modify it unless the cjk input was considered in the first place.
It's unlikely(hope), but you'd better ask. :)
I wonder how other language translation projects handle it.
Last edited by 높은산_낮은산 on Sun Oct 01, 2023 11:37 pm, edited 1 time in total.

User avatar
Interkarma
Posts: 7251
Joined: Sun Mar 22, 2015 1:51 am

Re: CJK Char input

Post by Interkarma »

Hey. :) I think I see the problem here. CJK character input requires IME composition, which isn't enabled by default in my input system. I can enable this and see the correct characters flow through events, but I need to be careful how and where IME composition is toggled so that it doesn't affect gameplay input.

I'll unpack the problem further and scope out a fix.

높은산_낮은산
Posts: 40
Joined: Mon Apr 17, 2023 11:33 am

Re: CJK Char input

Post by 높은산_낮은산 »

As you know, searching for destinations on world maps is an important part of daggerfall gameplay, so solving this problem is important. for other non-Latin languages as well i hope.

On my system, it was not possible to enter Korean in DFU under Korean IME sett.
and that does not affect gameplay(and dialogshortcuts)

Thanks for the effort. :)

User avatar
Interkarma
Posts: 7251
Joined: Sun Mar 22, 2015 1:51 am

Re: CJK Char input

Post by Interkarma »

DFU's input system is just a wrapper around Unity's Input framework, which supports IME composition. This should be completely possible in principle. :)

The good news is that I have this essentially working already by enabling IME composition when entering a UI expecting text input and restoring previous IME composition when exiting that UI. This is the recommended best practice and does not cause any issues with game input I have found.

Here's an example where I'm just typing randomly with Korean input mode enabled on my keyboard while inside DFU.

ime-composition-enabled.png
ime-composition-enabled.png (17.17 KiB) Viewed 2034 times

Input works basically the same as it does in any other application where you can toggle between English/Korean input modes with right-alt on keyboard.

I still have some work to do so that composition string in progress is always correctly displayed. I'm working on this problem now.

In any case, some good progress was made in a short amount of time. :)

User avatar
Interkarma
Posts: 7251
Joined: Sun Mar 22, 2015 1:51 am

Re: CJK Char input

Post by Interkarma »

Input with IME composition support for CJK characters is coming along nicely. :) Here I'm just typing "QWERTYUIOP" on keyboard with Korean Input Mode enabled.

ime-input.gif
ime-input.gif (745.41 KiB) Viewed 1985 times

At the moment this only looks correct when appending text as the composition frame is drawn at current cursor position. I'll keep refining it and make it look nicer at the end.

높은산_낮은산
Posts: 40
Joined: Mon Apr 17, 2023 11:33 am

Re: CJK Char input

Post by 높은산_낮은산 »

That's great. hangul combination input looks good, which is essential for korean input.

i hope CJ input is goes well as this.

however, what i am curious about now is whether it is possible to search for destinations on the world map with korean input.(which is traslated)

other input issues are negligible by other means, but this destination search is not.

if it is difficult to test, please release IME-enabled build and i will let you know after testing.

User avatar
Interkarma
Posts: 7251
Joined: Sun Mar 22, 2015 1:51 am

Re: CJK Char input

Post by Interkarma »

Travel map search should be OK, I considered this when setting up localization for place names. While this was tested on Latin languages like French and German, it should work in any language provided the strings are comparable.

I just ran a quick test by renaming Daggerfall to "ㅂㅈㄷㄱ쇼" in Internal_Locations.txt, then searched for it in-game. Travel map picked it up no problems. It even finds it with a partial search string like "ㅂㅈ".

search-ㅂㅈㄷㄱ쇼.png
search-ㅂㅈㄷㄱ쇼.png (16.79 KiB) Viewed 1941 times

높은산_낮은산
Posts: 40
Joined: Mon Apr 17, 2023 11:33 am

Re: CJK Char input

Post by 높은산_낮은산 »

Thats glad to hear, i don't know if it exists, but sure this is welcome news for other CJ lang teams as well.
i look forward to testing it myself.

Thank you for help.

User avatar
Interkarma
Posts: 7251
Joined: Sun Mar 22, 2015 1:51 am

Re: CJK Char input

Post by Interkarma »

I've progressed IME input support. It now does proper inline preview at any position and displays input panels where supported by language pack. Here's an example typing random stuff with a Japanese keyboard enabled.

ime-input-jp.gif
ime-input-jp.gif (833.81 KiB) Viewed 1898 times

You'll also be happy to know that I've added dynamic glyph loading for missing characters, provided the custom TTF or OTF contains these characters. This means no more need to provide a huge alphabet text file. In the video above, the Japanese characters are being loaded dynamically as I type them.

It might still be beneficial to provide an alphabet file so characters can be preloaded. But if you're testing in the editor a lot, it's nice to skip this file for faster startup.

Post Reply