![]() |
[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:
|
All times are GMT. The time now is 01:10. |
vBulletin® Version 3.8.8