![]() |
[WIP] Japanese input method for Sailfish OS (now with 99% less crashes -- for real this time)
[2015-06-15: Updated jolla-anthy-jp to v0.04]
[2014-11-09: Updated jolla-anthy-jp to v0.03] [2014-05-17: Updated jolla-anthy-jp to v0.02] TL;DR: Enable installing of untrusted software in the settings, then install the following three packages (in order):
Then reboot the phone. Hi everyone. As I've mentioned on together.jolla.com already, the last major feature that I was missing on my Jolla was the ability to input Japanese. However, as there was no response from Jolla nor from what I've seen any major effort from a third party to develop a Japanese input method, I finally gave up and took it upon myself to at least create a working proof of concept. Well, said and done, I now have a fully usable input method, though it is very, very much in alpha state. To use this input method, you'll need three packages: anthy, which segments kana and converts it into kanji; libanthy-qml-plugin, which acts as a thin wrapper around anthy, making the library usable from QML; and finally jolla-anthy-jp, which contains the actual keyboard layout as well as logic such as wāpuro rōmaji→hiragana conversion, kanji candidate selection, and more. Anthy is of course not written by me, but is a preexisting project licensed under the LGPL. Its official website can be found at http://sourceforge.jp/projects/anthy/. The above linked packages can be installed from the GUI by allowing untrusted software in the settings, or from terminal by running Code:
$ pkcon install-local After installing the packages, you either need to restart the Maliit keyboard or reboot the device. To restart the Maliit keyboard (again, this requires developer mode): Code:
$ systemctl --user restart maliit-server.service In addition, I've created a repository at openrepos.net, which you should be able to add to the package manager in Sailfish if you don't want to install the above packages manually. From there you can install jolla-anthy-jp, and anthy and libanthy-qml-plugin should come along as dependencies. You can also find screenshots there. Now, keep in mind that, as I said, this is very much a non-stable version, so don't be surprised if anything wonky happens, and please report back if you have any suggestions for improvements or fixes---or even better, do a pull request on GitHub. Known issues
Changes as of v0.04
Changes as of v0.03
Changes as of v0.02
P.S.: If you find yourself wanting to hack the code or experiment with your own input handlers, the way to get output from your code is by stopping Maliit and then starting it again in the foreground: Code:
$ systemctl --user stop maliit-server.service && maliit-server As far as hacking the keyboard goes, the interesting files are the .qml files in /usr/share/maliit/plugins/com/jolla/ (especially KeyboardBase and InputHandler) as well as /usr/lib/maliit/plugins/jolla-keyboard.qml. Binary plugins for the keyboard can be found in /usr/lib/qt5/qml/com/jolla/{keyboard,xt9,xt9cp}. |
Re: [WIP] Japanese input method for Sailfish OS
Glad to see that you have chosen openrepos.net for distributing :cool:
It is my fault, that there is no public publishers guide yet. :( One thing on openrepos usage: You have uploaded multiple packages to same application. All packages have different names. This will confuse Warehouse application. To make it work as expected you have to select one of the ways: 1) Create separate applications for each rpm package 2) While editing sailfishos package, move main 'jolla-anthy-jp' package to the top of the uploaded files list, so it will be the first one in attachment list. |
Re: [WIP] Japanese input method for Sailfish OS
Quote:
|
Re: [WIP] Japanese input method for Sailfish OS
Cool stuff, it works! ありがとうございます!
|
Re: [WIP] Japanese input method for Sailfish OS
Quote:
You did it right, everything is cool :cool: |
Re: [WIP] Japanese input method for Sailfish OS
Awesome, thanks! Much appreciated!
Edit: "found" an issue, need to learn to read posts more carefully... |
Re: [WIP] Japanese input method for Sailfish OS
Looks excellent. You could think about fewpath and naming changes to avoid collisions with possible future OS packages in Jolla. You can also create postinstall and postuninstall script to your RPM package to enable maliit.service restart. Just add following to SPEC file.
Code:
%post |
Re: [WIP] Japanese input method for Sailfish OS
Thank you very much for figuring out how to plug in a custom input method for Sailfish.
If you have the time, could you please explain how the "jolla-anthy-jp" rpm is built. Based on this thread, I finally decided to write an input method for Korean (sources here: https://github.com/ascense/jolla-hangul), but I cannot figure out how to make a non-binary rpm (the SDK really wants to have something to compile...) |
Re: [WIP] Japanese input method for Sailfish OS
Don't use SDK to pack the RPM. You can create spec file with any text editor and use rpm-build to create rpm package. I think SDK will also sandbox you out of keyboard folders.
|
Re: [WIP] Japanese input method for Sailfish OS
Quote:
|
Re: [WIP] Japanese input method for Sailfish OS
Quote:
|
Re: [WIP] Japanese input method for Sailfish OS
Quote:
http://talk.maemo.org/showthread.php?p=1409210 |
Re: [WIP] Japanese input method for Sailfish OS
Nice to meet you, Behold.
I am so interested about input method and keyboard in Sailfish, since a traditional chinese input methos is still not readily available. May I have your experience about developing one input method? Thank you very much ! @Behold |
Re: [WIP] Japanese input method for Sailfish OS
Hey Behold,
I can type Japanese with your IM on Android apps, but on native apps I just get latin text, anthy never seems to kick in. Any ideas? (I even rebooted the phone.) |
Re: [WIP] Japanese input method for Sailfish OS
Quote:
|
Re: [WIP] Japanese input method for Sailfish OS
All right, I've pushed a small fix and updated the jolla-anthy-jp package. It should be a bit better about switching to the correct input handler now. Note though that you might still have trouble getting it working in for example the browser, or at least I had, because Maliit reports 'predictionEnabled' as false for some input fields, which will cause the input handling code in jolla-keyboard to fallback on a more basic input handler. This affects not only the Japanese input method, though, but all other input methods as well.
Edit: The problem is mentioned here: https://together.jolla.com/question/...king-features/ |
Re: [WIP] Japanese input method for Sailfish OS
I did notice today I'm not getting prediction in the browser with English, either.
|
Re: [WIP] Japanese input method for Sailfish OS
Hi,
I am using your japanese input method for some time now but the crash rate (when choosing other than the first suggestion) is pretty bad on my end so I am trying to track the bug down. Using gdb, I found that it crashes in libanthy when swapping the suggestions around to make the one with the highest score in the first place and it seems the memory is in pretty bad shape within the suggestions' dictionary. I'd like to trying a workaround for now (just commenting out the swap process) but I have a hard time figuring out how you managed to compile libanthy using the source available in your repository on github… Could you help me? |
Re: [WIP] Japanese input method for Sailfish OS
I am experiencing the same behavior as razcampagne, to be honest it makes it very hard to input Japanese, I can't even select my wife's name ^-^;;
|
Re: [WIP] Japanese input method for Sailfish OS (now with 99% less crashes)
All right, I've updated jolla-anthy-jp to version v0.03 which *should* fix the frequent crashes. Please report any issues you're having.
I'd like to extend a thank you to razcampagne and p2501 for taking some time to look into the issue and pointing me in the right direction which enabled me to finally find a working workaround. |
Re: [WIP] Japanese input method for Sailfish OS (now with 99% less crashes)
Thanks a lot, it's a whole lot better. I can now select my wife and son's names.
This really makes the phone a lot more useful to me, thank you. I can crash it but in an improper use situation that does not matter. How I can make it crash is say I select a word and it inputs it into a chat or mail but there is still a list of words showing, if I select any of those it crashes. I do not think that has to be changed as I consider that improper usage as I have not input anything new. |
Re: [WIP] Japanese input method for Sailfish OS (now with 99% less crashes)
Quote:
|
Re: [WIP] Japanese input method for Sailfish OS (now with 99% less crashes)
Not working for me, (2014.12.24).
Maybe this is due to the latest Jolla update ? I have this error: Code:
[nemo@Jolla plugins]$ systemctl --user stop maliit-server.service && maliit-server |
Re: [WIP] Japanese input method for Sailfish OS (now with 99% less crashes)
Quote:
No idea. Same error-text can be seen here. Best wishes. ~~~~~~~~~~~~~~~~~ Per aspera ad astra... |
Re: [WIP] Japanese input method for Sailfish OS (now with 99% less crashes)
I understand keyboards changed in the very latest opt-in Sailfish update breaking many keyboards. I am hesitating to update since I saw that. Will this keyboard be updated?
|
Re: [WIP] Japanese input method for Sailfish OS (now with 99% less crashes)
Quote:
But yes, if required I will update the keyboard for compatibility. |
Re: [WIP] Japanese input method for Sailfish OS (now with 99% less crashes)
From the keyboard layouts thread may be a hint.
Code: import QtQuick 2.0 import ".." KeyboardLayout { splitSupported: true KeyboardRow { and Code: KeyboardRow { splitIndex: 5 ShiftKey {} |
Re: [WIP] Japanese input method for Sailfish OS (now with 99% less crashes)
I went ahead and upgrades. I see no change in functionality of this particular keyboard.
|
Re: [WIP] Japanese input method for Sailfish OS (now with 99% less crashes)
Thanks for confirming. I've been incredibly swamped lately so I haven't had a chance to look at how the keyboard works with the latest version yet.
|
Re: [WIP] Japanese input method for Sailfish OS (now with 99% less crashes)
3 Attachment(s)
Hi.
I made some workaround modification on JaInputHandler.qml to avoid crash when tapping "prediction type" candidate. I don't know if it is right solution but at least it seems to work. I also made updated keyboard (from 1.1.4.29 stock english keyboard) with:
I now testing flick-style keyboard and will post qmls if it goes well. |
Re: [WIP] Japanese input method for Sailfish OS (now with 99% less crashes)
Quote:
|
Re: [WIP] Japanese input method for Sailfish OS (now with 99% less crashes)
Quote:
And as for JaInputHandler.qml, my modification is only to comment out Code:
} else if (item.type == "prediction") { But it's really a temporal workaround so fixing anthy.commit_prediction(item.candidate) will be better if possible. |
Re: [WIP] Japanese input method for Sailfish OS (now with 99% less crashes)
Quote:
Regarding the crashes, I do know what the root problem is, so a workaround like that shouldn't be necessary hopefully, I just need to find the time to actually look at the problem and make sure I'm doing everything the right way and that I have all the corner cases worked out. |
Re: [WIP] Japanese input method for Sailfish OS (now with 99% less crashes)
Thanks for let me know. But it's ok if it take some time.
Glad if I could help because as a Japanese I would not have bought Jolla if you hadn't made Japanese input possible. Thank you so much. |
Re: [WIP] Japanese input method for Sailfish OS (now with 99% less crashes)
Aight, I've now bumped jolla-anthy-jp to version 0.04, which includes the changes submitted by sleepsounds as well as a fix to prevent the keyboard from crashing when attempting to select a prediction candidate.
sleepsounds: If you get your flick-style keyboard working well, feel free to do another pull request on GitHub, I'd love to include it in jolla-anthy-jp if you'd like. |
Re: [WIP] Japanese input method for Sailfish OS (now with 99% less crashes)
4 Attachment(s)
OK, I tested flick-style Japanese keyboard on 1.1.6.27 and it basically seems to work. So I upload it here.
But it's still in an alpha state. Please keep it in mind. Also, it needs modification of KeyboardBase.qml. PLEASE BACKUP YOUR ORIGINAL KeyboardBase.qml because if something goes wrong it would affect to all other keyboards. Before install: You must have jolla-anthy-jp (currenly 0.4) installed on your Jolla. How to install:
Some features/known issues:
ToDo: A lot. I'm rather at a loss for what to explain and what to not. Please let me know if you have any question, idea or some other things for this keyboard. |
Re: [WIP] Japanese input method for Sailfish OS (now with 99% less crashes)
What font do you use?
|
Re: [WIP] Japanese input method for Sailfish OS (now with 99% less crashes)
1 Attachment(s)
I found Popper meaninglessly expands on alphabet mode when tap and hold so fixed it not to.
Quote:
Also included in Windows 8.1. |
Re: [WIP] Japanese input method for Sailfish OS (now with 99% less crashes)
Did you order a tablet? I wonder if this input method could be recombiled for the tablet.
|
Re: [WIP] Japanese input method for Sailfish OS (now with 99% less crashes)
1 Attachment(s)
On SFOS 2.0 update, several changes were made for keyboard-related files and it affected to flick keyboard that popper does not show character to be input when flicking on a key.
So I made some changes to keyboard files to fix them. Also I implemented changes on KeyboardBase.qml and adjust flick direction detection. Attached zip contains all files needed (not only updated file.) How to install: http://talk.maemo.org/showpost.php?p...5&postcount=36 |
All times are GMT. The time now is 09:03. |
vBulletin® Version 3.8.8