KeyboardKit / KeyboardKit

KeyboardKit is a Swift SDK that lets you create fully customizable keyboards with a few lines of code, using SwiftUI.
https://keyboardkit.com
MIT License
1.52k stars 231 forks source link

Localization - Add support for Vietnamese locale #744

Open TaezIT opened 5 months ago

TaezIT commented 5 months ago

Hey @danielsaidi,

How can I set vietnamese language in KeyboardKit or another custom keyboard. I try to set "vi" in primaryLanguage but it doesn't work. Can you help me, pls.

Thanks

danielsaidi commented 5 months ago

Hi @TaezIT

KeyboardKit doesn’t yet support Vietnamese but it may be added in the future.

You can still build a Vietnamese keyboard with the SDK though.

which Vietnamese keyboard variant would you like to have in the library?

TaezIT commented 5 months ago

I tried to customize a keyboard with Vietnamese by set "vi" in primaryLanguage but it doesn't work. Anyway, can you teach me how I can use Vietnamese language in KeyboardKit normal, not pro version

danielsaidi commented 5 months ago

The primary language only sets the native keyboard language, which is shown in the keyboard switcher. It doesn’t affect KeyboardKit.

In KeyboardKit, you have to create a Vietnamese keyboard layout and pass that into the system keyboard, or use the base components to build your own custom keyboard view.

TaezIT commented 5 months ago

I know that but when I create a new keyboard extension and set "vi" for primaryLanguage in Info.splist. Then, my keyboard show with Vietnamese like this but I still can not use Vietnamese. ImportedPhoto 739443802 86321

In Vietnamese, after I double click to "a", it change to "â". But it doesn't work. Do you know reason ?

danielsaidi commented 5 months ago

KeyboardKit currently has no support for Vietnamese. You currently have to implement it yourself.

Which Vietnamese keyboard variant would you like to use?

TaezIT commented 5 months ago

I want it to be like your keyboard My difficulty is that in the Vietnamese language, when I press the two letters "a" will, my character will turn into "â". Do I have to handle this myself or when I set Primary Language to "vi" will Apple help me do it ?

nts-sixblack commented 5 months ago

In KeyboardKit, when press on button, just insert character to textDocumentProxy, not handle to change current word. So, if you want to press double a, character will return "â", you need write func to handle it before insert to textDocumentProxy. I am trying to write it.