Using non-latin language on Librem 5

Yay, first contribution incoming!

Buttons need to be added in the list only if something is overridden from the default for the button. The default is:

  • outline “default”
  • action “submit label”
  • label as provided
  • no icon
  • keysym for libxkbcommon automatically derived

In general, the button needs to be there if:

  • it’s not a letter (action)
  • it’s got a fancy shape or sometimes color (outline)
  • it has an icon
  • it causes problems when creating a keymap (keysym)

The nb.yaml keyboard hasn’t been updated for a while, and that’s why it lists all symbols in the buttons list.

1 Like

I’m not aware of anyone else trying to do that.

You can either submit a merge request, or file an issue and include the file, or send me the file directly.

It’s Cantarell at the moment. But please don’t pay attention - if the font in use prevents any characters, it’s a bug that I promise to fix.

1 Like

I will try to create an el file for Greek and get back to you.

But it is unfortunate (for me) that Cantarell does not have Greek support. It has also received a lot of criticism. I hope it would be easy to change the font. Of course there are tons of fonts available. I consider the Go fonts created by well known and very respected font designers, Professor Bigelow and Holmes, a much much better choice. Both for legibility and for international support. License is also free.

In nb.yaml I do not see a way to type accents. Say you want to type alpha (α) and alphatonos (ά). On android you keep the alpha pressed and then a popup window appears offering you to type alphatonos (usually more options are available on this popup such as numbers). So, is a similar mechanism supported? I do not think there is space to have both non-accented and accented letters on the default layout.

More on keyboard: how does the language switch work? Some androids have a dedicated button on the keyboard. Others do not have this but you swap the space button to switch. I ask because I do not see a dedicated button for languages in your us.yaml

I need aswell a way to type accents in my mother tongue (Spanish), a kind of long press menu like the Android one:

a > á
e > é
i > í
o > ó
u - ú
A > Á
E > É
I > Í
O > Ó
U > Ú

With that and this modifications should be enough for the Spanish (from Spain) keyboard.

views:
    base:
        - "q w e r t y u i o p"
        - "a s d f g h j k l ñ"
        - "Shift_L   z x c v b n m  BackSpace"
        - "show_numbers preferences         space        period Return"
    upper:
        - "Q W E R T Y U I O P"
        - "A S D F G H J K L Ñ"
        - "Shift_L   Z X C V B N M  BackSpace"
        - "show_numbers preferences         space        period Return"
    numbers:
        - "1 2 3 4 5 6 7 8 9 0"
        - "@ # € % & - _ + ( )"
        - "show_symbols   , \" ' « » colon ; ¡ ! ¿ ?  BackSpace"
        - "show_letters preferences         space        period Return"
    symbols:
        - "~ ` | · √ π τ ÷ × ¶"
        - "© ® £ $ ¥ ^ ° * { }"
        - "show_numbers_from_symbols   \\ / < > = [ ]  BackSpace"
        - "show_letters preferences         space        period Return"

I just added the ñ Ñ letters, the latin quitation marks « », ¿ and ¡ and swap the symbol for the dollar one.

2 Likes

No single font is going to cover all my needs: latin, cyrylic and japanese symbols. Plus all sorts of accents, I like having people’s names in their exact preferred spelling.

There’s no special way to type accents. You can put them on dedicated keys in a different view. You can have as many views as you want, so you will never run out of space. Make sure that there are enough buttons with the action “change view” and that they make sense.

Long press is in plans, but not the top priority.

The language can be switched from settings. The “preferences” button will open a dedicated switcher in the near future.

Did you check whether there are fallbacks? I have to admit I haven’t tested that.

2 Likes

OK, I think I have the Greek keyboard ready. A couple of questions before submitting:

I have used 11 symbols for some lines as in nb.yaml. The us.yaml has 10 maximum. Is this OK or i should try to have max 10;

I solved the issue with accents adding a new view. This is fine and I prefer it to the long press. But for switching to English it is important for Greek users. So I added the us keyboard in more views in my file el.yaml with some buttons/actions to switch back and forth to Greek. Is this OK?

Finally, I can not test the file. Is it possible for you to check at least that the syntax has no errors? (I guess it will not compile if it has errors).

Great!

I think if you can’t test it, then it’s too early to submit the layout; others won’t be able to use it either. Where did you get stuck? Did you try running the testing instructions from the HACKING.md file?

If you did, then you can place the keyboard in the directory ~/.local/share/squeekboard/keyboards/, this will override the provided one (there isn’t one yet). Then use the settings app to select Greek as your system layout and confirm by:

gsettings get org.gnome.desktop.input-sources sources
gsettings get org.gnome.desktop.input-sources current

After you do that, you’ll get a good feel of whether the 11th button is placed correctly.

Oh, and the application will print things on the console if anything’s wrong. It will try not to crash even if something goes wrong. No one wants the input method to crash.

When it comes to an embedded US view, I’d rather not accept this upstream, especially as I’m working on the switcher right now. You’re free to have it as an override on your own system.

2 Likes

Sorry, it did not cross my mind that I have to run in an emulator the whole L5-phone just to test a simple text layout.

OK, so I guess I should start from here:
https://developer.puri.sm/Librem5/Development_Environment/Boards/qemu.html#linux-environments

Right?

You can do that, but I use something different for development: https://source.puri.sm/Librem5/squeekboard/blob/master/README.md#running (sorry, I directed you to HACKING.md instead).

If you use this method, all you need is phoc, and it will turn into a window on your desktop. But there are probably problems with that, so unless you wish to help me better document the testing procedure, it’s better to use the emulator from the page you linked.

1 Like

As you will be on a Debian Linux in all likelihood with PureOS or most others applicable (Debian OS, Ubuntu Touch, 4QOS, etc. simply install gnome character by either the Terminal (apt-update first, then apt-install gnome_charachters, etc.)
Once this is done you can use the app menu looking for ‘characters’.
This may not work for a keyboard of phone directly, but using Libre Office you can make and cut and paste from a saved list (smart list) of items to the needed applications, perhaps assigning some to a saved shortcut that can be pasted rather than doing this each time from the smart list.

Oops …by either the Terminal (stuff in parentheses) or can install from an application such as synaptic package manager.
Once this is done…

@uzanto’s keyboard layout is in squeekboard now! Thanks!

image

It’s going to take some additional MRs before it works and looks as intended (them bugs), but it’s there and not going anywhere.

1 Like

The ‘problem’ here it’s about the virtual keyboard squeekboard and the use of ‘non common’ characters, like the ones we’ve got in French, German, Russian, Greek, Spanish… and it’s easy to fix just adding a new keyboard layout thanks to Purism team.

@dcz That’s nice, I hope we can add the long press support eventually because it will make it easier to type for us (non english speakers), but by the time being it’s functional like that, obviously needs some improvement, I’ll try to help all I can with this.

1 Like

One idea I have is to make the eschars button work the same way the Shift_L button works:

        action:
            locking:
                lock_view: "eschars"
                unlock_view: "base"

This saves one click by not needing to press it again to go back to the base view.

1 Like

The fastest the better when typing, I didn’t understood perfectly how it’s works when I started with the keyboard really.

How can I update your changes in my fork trough the webapp? I can’t see the Spanish layout in it.

That’s totally expected, we didn’t write the documentation yet.

The file is here: https://source.puri.sm/Librem5/squeekboard/blob/master/data/keyboards/es.yaml

It will be picked up by the application after someone reviews and tests https://source.puri.sm/Librem5/squeekboard/merge_requests/188 and https://source.puri.sm/Librem5/squeekboard/merge_requests/186

Yes I know, but if I want to edit something else in that file is asking to make another fork to do it and I’ve got already one done, I want to edit it in that one and then send the merge request to the main one.

It’s the first time that I use gitlab to send merge requests.