ubports / keyboard-component

Moved to https://gitlab.com/ubports/core/lomiri-keyboard
https://gitlab.com/ubports/core/lomiri-keyboard
GNU Lesser General Public License v3.0
10 stars 36 forks source link

Text prediction, autocorrection and the like not working automatically with swiss-french keyboard layout #132

Closed ghost closed 3 years ago

ghost commented 4 years ago

Steps to reproduce

  1. In the system settings, set the keyboard layout to swiss-french only
  2. Reboot the phone (optional, but just to be extra sure)
  3. Open any app that makes you write text (Messages, Notes, TELEports)
  4. Write something in french such as "Bonjour"

Expected behaviour

Autocorrection, text prediction and such features should work.

Actual behaviour

I can write as much text as I like, but the text checking features don't work. Workaround : I switched to french keyboard and to swiss-french again, and then the text checking and autocorrecting features do work.

I am the one that "coded" the swiss-french keyboard layout back in 2018 (thank you very much for implementing it !). I just copied the files from the french keyboard and changed the keys to match my keyboard, expecting this to produce a working keybord out of the box. Hopefully the workaround works, but if would be pretty cool if the swiss-french keybord could be linked to the french dictionary from start. So what did I miss here ?

Feature request

I see that the language is "Swiss-French". Would it be possible to translate the text to "Français (Suisse)" for the next keyboard ?

Fuseteam commented 4 years ago

this is related to #100 the french-swiss keyboard does not have a dictionary of its own, it just takes the dictionary of the last active keyboard

ghost commented 4 years ago

Thanks for the info, it makes more sense now. Reading what you wrote in #100, what would be the most logical way to solve this ? Rewrite the function to make it load only the relevant languages ("fr" and "en" in that case), or create the corresponding dictionaries ?

Fuseteam commented 4 years ago

I believe the most thorough way to solve this is to separate layout from language, the keyboard doesn't know the difference between the two atm. My emoji layout pr is an example of a layout as opposed to a language. we can use a similar approach for the swiss-french layout and the dvorak layout.

lduboeuf commented 4 years ago

should be the culprit: https://github.com/ubports/keyboard-component/blob/xenial/plugins/fr-ch/src/src.pro#L18 maliit is lookink for libfr-chplugin.so file

Fuseteam commented 4 years ago

@lduboeuf wait so it's looking for libfr-chplugin even tho it should be looking for libfrplugin?

lduboeuf commented 4 years ago

the language variable here is fr-ch at that line https://github.com/ubports/keyboard-component/blob/93e577f6f9644b84eec26d0b4671a2ba8bd08f00/src/plugin/inputmethod.cpp#L722

Fuseteam commented 4 years ago

yes iirc the french swiss layout is supposed to use the same dictionary as the french layout

lduboeuf commented 4 years ago

if it is ok to fallback to the "prefix" language if not found, so better change the code. But is it fine for all cases ?

Fuseteam commented 4 years ago

i think it's better to fallback to the "prefix" language, we have the same isssue with en@dv. if it's fine for all cases is good question tho looking at the plugins directory i'm inclined to say yes

lduboeuf commented 4 years ago

ok, but no standard way for directory names :-|

I believe the most thorough way to solve this is to separate layout from language, the keyboard doesn't know the difference between the two atm. My emoji layout pr is an example of a layout as opposed to a language. we can use a similar approach for the swiss-french layout and the dvorak layout.

Will have a look, nice idea, but maybe you will be quicker than me for doing that ?

Fuseteam commented 4 years ago

i haven't been quick with most things but feel free to make use of my emoji pr. if we can figure out a standard way to switch layouts that will be great progress. i am currently stuck on that; how do we switch layouts, should we modify the language menu to switch layout rather than language? should it still switch both? do we need a new interaction to switch layout leaving the language key as is? i currently have no idea :x

lduboeuf commented 4 years ago

So if i understand, for fr-ch, database and all french prediction stuffs should not be in the fr-ch/src directory. Can we rename fr-ch with fr@ch so that keyboard-component can load the database ( like for en@dv ) ?

lduboeuf commented 4 years ago

See PR for improvement.What do you think ? (i've finally didn't rename fr-ch to fr@ch because it implies renaming lots of things )

Fuseteam commented 3 years ago

renaming would be quite a bit of work yeah :joy: but anyway @spartid can you test pr #134?

ghost commented 3 years ago

With pleasure ! But how do I do it ? I'm on RC at the moment. Do I simply switch to devel or do I have to install the PR from the terminal ? And if so, what do I install ?

Le 22.12.2020 13:12, Merkhad Luigton a écrit :

renaming would be quite a bit of work yeah 😂 but anyway @spartid [1] can you test pr #134 [2]?

-- You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub [3], or unsubscribe [4].

Links:

[1] https://github.com/spartid [2] https://github.com/ubports/keyboard-component/pull/134 [3] https://github.com/ubports/keyboard-component/issues/132#issuecomment-749510388 [4] https://github.com/notifications/unsubscribe-auth/AQJYDVJL5F4P7Y5GWP57623SWCEJVANCNFSM4O4MUAXA

Fuseteam commented 3 years ago

@spartid you can test it on rc too,

just run ubports-qa install keyboard-component 134 maybe run restart maliit-server for good measure test away

ghost commented 3 years ago

@Fuseteam so I had to switch to devel to test it. The ubports-qa script just told me I didn't have enough space in /var/cache/apt, even after I deleted the folder to make space. Sadly it doesn't work for me. Logviewer still says there is an error : maalit-server-error.txt I'm back on RC now, but keep in touch !

Fuseteam commented 3 years ago

hmmm could it be a difference between rc and devel? hmmmm if you want to try it on rc you can run mount -t tmpfs tmpfs /var/cache/apt/archives before running ubports-qa this was fixed recently on devel

ghost commented 3 years ago

I didn't use you trick, but deleting /var/cache/apt and remounting the rootfs read-only did the trick, despite some errors :

ERROR:ubports-qa:Failed to run 'apt upgrade'. See the output above for details. mount: / is busy ERROR:ubports-qa:Failed to remount root filesystem read-only. ERROR:ubports-qa:Please consider rebooting your device. INFO:ubports-qa:You can remove this repository by running 'sudo ubports-qa remove PR_keyboard-component_134'

And @lduboeuf : it works, thank you very much !! And switching from emoji to swiss-french keyboard doesn't remove text prediction :smiley: screenshot20201228_105955002 Oh, now that I think about it. Can I keep this on my phone, or do I have to delete it before next RC ?

Fuseteam commented 3 years ago

@spartid you can keep it on your phone, i don't think should be any issue

ghost commented 3 years ago

@Fuseteam okay, thank you. And do you know how I can translate what's written on the space bar [French (Swiss)] ?

Fuseteam commented 3 years ago

i think you can do that at https://translate.ubports.com/projects/ubports/keyboard-component/