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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Japanese input support #140

Open
bushrang3r opened this issue Jan 9, 2021 · 9 comments
Open

Japanese input support #140

bushrang3r opened this issue Jan 9, 2021 · 9 comments
Labels
area: kbd-layout Keyboard layout requests / issues / improvements proposal A proposal for a new feature or an enhancement proposal-accepted An accepted proposal for a new feature or an enhancement

Comments

@bushrang3r
Copy link

Great to see a new opensource keyboard on the scene 馃憤

I have installed Japanese as a language on my phone but am unable to add it as a subtype in FlorisBoard settings. Ir simply doesn't show as an option.
I wonder if I'm missing something, or if it's not possible at the moment.
I need this to be able to display the language selector button on the keyboard.
Thanks

@bushrang3r bushrang3r added the question Questions about FlorisBoard and its features label Jan 9, 2021
@patrickgold
Copy link
Member

No, besides Arabic and Persian FlorisBoard does currently not support any non-latin languages. FlorisBoard's set of languages will definitely expand, but I think that adding Japanese won't happen until after v0.4.0. I will add it to the corresponding milestone.

@patrickgold patrickgold added this to the 0.5.0 milestone Jan 9, 2021
@patrickgold patrickgold added proposal A proposal for a new feature or an enhancement proposal-accepted An accepted proposal for a new feature or an enhancement and removed question Questions about FlorisBoard and its features labels Jan 9, 2021
@bushrang3r
Copy link
Author

Thanks Patrick,
Understood. No worries. And thanks.
I actually already have a Japanese keyboard installed but switching between keyboards on Android is just not as quick as switching languages 'on the fly' with the language switching button. But I can live with it for now.

@patrickgold patrickgold changed the title [Question] Subtype language selection Japanese input support Jan 10, 2021
@lethallunatic
Copy link

@bushrang3r
I have reported an issue #168 to @patrickgold regarding the spacebar for switching languages. You can however use the spacebar to change to another keyboard, depending on the other keyboard you may also switch back to florisboard.

@ghost
Copy link

ghost commented Apr 29, 2021

A japanese input would be wonderful.
Currently I use Mozc for Android. It's UI the same as Gboard, also open source but is not updated since 4/10/19.

Is gonna be a hard work to put suggestions, japanese language use a high number of characters.

@patrickgold patrickgold added the area: kbd-layout Keyboard layout requests / issues / improvements label May 23, 2021
@Hayleia
Copy link
Contributor

Hayleia commented May 25, 2021

I just tried Mozc to get an idea of how this is supposed to work (I'm not a Japanese language user at all). From what I see, the layout is Latin, Latin letters are converted to hiragana only, and if the user intended to write katakana or kanji, then there is a suggestion bar at the top to convert hiragana to katakana/kanji?

The part where latin characters are converted to hiragana is doable pretty easily now (see video (yes i'm definitely typing in canadian french)), but the part where hiragana can be converted to katakana/kanji from the smart bar would probably require autocorrect/spellcheck to be stable and then it would only be a matter of using the correct dictionary I guess?
https://user-images.githubusercontent.com/7904776/119452735-f9194a80-bd36-11eb-88e8-8c5962478b46.mp4

@ghost
Copy link

ghost commented May 25, 2021

@Hayleia That exactly how the Mozc works, yes, but there another layout for typing.

One of this is the 12 Keys, which is very similar to older phones (The only diference is the way you type the characters, you need to slide, instead of pressing the same button)

Another suggestion is, instead to use suggestions bar, place a button to change Hiragana to Katakana/Kanji like on PCs (The key to change the characters is Space)

@Waelwindows
Copy link
Collaborator

While it may be easier to implement it like this for now, I think it's better to focus on the 12 key flick style as it's the input method that most native speakers use.

@ghost
Copy link

ghost commented May 25, 2021

Although I'm not a native japanese speaker, I use the standard Latin layout.

Writing Hiragana and using suggestions to type Kanji or Katakana seems pretty good to me, as find the Kanji can be a bit tedius pressing the same button (The con of the PC layout).

The 12 keys, in my experience, can be confusing at first, especially for those that still learning, but when continually using, practicing and muscle memory, I think that can be a great usage for the user.

I recommend implement the 12 Keys and latin layout with the option to change the way to write Katakana/Kanji to some button or using the suggestions.

@Waelwindows I agree with you, if you see japanese people typing in their phones, most of them use the 12 keys.

@Hayleia
Copy link
Contributor

Hayleia commented May 26, 2021

I'm linking #902 because it is also asking for flick layout support (but not necessarily applied to japanese) so it can be taken into account when thinking about flick layouts.

patrickgold added a commit that referenced this issue Aug 22, 2021
* feat: Add Japanaese JIS layout

* feat: Add KanaSelector and KanaSizeSelector

* test: Try out new selectors

* fix: Add new selectors to polymorphic key data list

This should help make florisboard recognize the new selectors
when used in layouts.

* fix: Implement `evaluteKana` for ComputingEvaluator

This should fix the crashes, hopefully

* feat: Rework the JIS layout

* fix: Implement basic logic for kana state

* feat: Add popups for JIS

* chore: Rename JIS specific layouts

For some reason this change broke the pop-ups

* feat: Add Kana Unicode compositor

* feat: Implement flipping small state and refactor

This should allow small kana characters to be switched over to their
normal counterparts. Also clean up and refactor `KanaUnicode` and make
the filename more appropriate

* Merge `master` to `japanese`

* chore: Add internal codes for Kana switching

This should be the starting point for getting actual keys
to switch between the kana types

* feat: Add initial modifer layout for JIS

* chore: Add keycode for ideographic CJK space

* feat: Add logic for kana switching

* chore: Update layout modifer to use kana switch

* feat: Add icon for kana switcher button

* fix: Scale the icon and update relevant entries

* feat: Begin work on kana selector popup

* Add kana attributes to keyboard state

* Add workaround for Japanese popups

* chore: Remove URL popups for JIS layout

* chore: Add codes and groups for kana switching

This commit adds the "~kana" group with groupId 4.

* feat: Use "~kana" in JIS layout.

* feat: Remove `KanaSizeSelector`.

It will be redundant when compositor handles it instead.

* feat: Add alpha code for making kana small.

This code currently uses a sentinel character to trigger
the transformation. This is not ideal as that means that users
won't be able to use that character in the keyboard. This won't
be a problem if the sentinel character is a Unicode codepoint
that cannot or would not be used normally. As such, this is just
a demonstration of the how the feature should function not it's
final implementation.

* test: Add kana small key in JIS for testing.

This is to preview changes to the kana small algorithm,
This commit should be removed from history later on.

* fix: Add `KANA_SWITCHER` to exceptionsForKeyCodes

* chore: Change "~kana" groupId to avoid conflicts

* fix: Change Kana small behaviour

* chore: Change internal kana small key code

* test: Remove kana small button from JIS layout

* feat: Add iteration marks to daku list

* feat: Allow swtiching between kana modifiers

This allows users to add/remove dakuten/handakuten/small
from kana and swtiching between the three. This is helpful
as it allows users to quickly rectify mistakes. It also lays
the groundwork for the future 12 flick layout

* feat: Change Kana swticher behaviour on katakana

Makes katakana switch over to hiragana immediately. As half-width
katakana is not usually used. The kana-switcher pop-up suffices
switching over to it when needed.

A potential downside to doing it like this making the half-width
katakana more hidden and less likely to be used.

* Add CJK_SPACE special behavior to input logic

* feat: Add CJK punctuation to popups and JIS layout

* feat: Add CJK punctuation symbols

* feat: Add CJK row numbers

* feat: Add postal mark symbol in CJK symbols

And change kana small internal code. Used to be set to
postal mark with face. Now set to geta mark.

* chore: Set default numeric row to CJK for JIS

* feat: Add modifiers layouts for CJK punctuation

* chore: Add latin half-width braces to CJK layout

* fix: Change composer behaviour on empty string

* chore: Add non-composing (han)daku to JIS popups

* fix: Change composer behaviour to be consistent

Also clean up the code a little.

* fix: Change composer empty string behaviour

* feat: Add WidthSelector and migrate half_kata Kana

This adds width selector for all languages instead of tying it down
to only `KanaSelector`. As such `KanaSelector`'s `half_kata`' field
is obsolete.

* fix: Fix bug in composing logic

* fix: Implement width properly and remove half_kata

* refactor: Clean up JIS layout JSON

* fix: Change JIS punctuation to use width_selector

* Improve half width implementation / Clean-up code base

* fix: Remove Half-kata from kana switcher cycle.

* feat: Add char width keycodes and implementation

* feat: Add half-width forms to symbols/cjk layouts

* feat: Add char width switcher to CJK mod layouts

Icons are yet to be added, so the labels will be strings for now

* feat: Add half-width forms for symbols2/cjk layout

* chore: Add more appropriate CJK chars to symbols2

* feat: Add icons for character width switching.

Note that `ic_keyboard_char_width_full` and `ic_keyboard_char_width_half`
are just copies of `ic_keyboard_char_width_switcher` for now.

* feat: Add relevant entries to show char width icons

* chore: Update the character width pop up icons.

And rename the internal names so that they match up with kana_switcher.

* fix: Make char width swticher icon toggle instead

* fix: Make character width icons more consistent.

* chore: Remove reference to char_width_switcher icon

* test: Iest code for why the composer is not working

* test: Remove test code for KanaUnicode

This reverts commit f6ae545.

* fix: Correct small kana association for E and U

* test: Remove test code for KanaUnicode

This reverts commit f6ae545.

* fix: Don't add small sentinel on non small char.

* fix: Correct small ya entry in KanaUnicode

* feat: Make kana switcher icon toggle between modes

* fix: Update svg colors to fit with other vectors

* Update app/src/main/java/dev/patrickgold/florisboard/ime/text/TextInputManager.kt

Co-authored-by: Patrick Goldinger <patrick.goldinger@pm.me>

* chore: Fix author name

* chore: Fix author name in CJK numbers

* chore: Fix indentation on author field

Co-authored-by: Waelwindows <waelwindows@hotmail.com>
Co-authored-by: Patrick Goldinger <patrick@patrickgold.dev>
@patrickgold patrickgold removed this from the 0.4.x milestone Jul 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: kbd-layout Keyboard layout requests / issues / improvements proposal A proposal for a new feature or an enhancement proposal-accepted An accepted proposal for a new feature or an enhancement
Projects
None yet
Development

No branches or pull requests

5 participants