Multiple Lexical Models for one keyboard

I have one keyboard which should work for many languages, but the predictive text needs to be separate for each language. Given the multilingual situation of Nigeria it’s helpful if we can keep things together as much as possible but enable say English + Hausa + a home language to be supported by the one keyboard…

I think I can answer some of my own questions now. It appears that I should:

  1. In Keyboards add the same .kmp file multiple times changing the Keyboard Name and Language to match what I have in Lexical Models.
  2. Don’t change the Keyboard ID. Make it all the same.

What I still don’t understand is why some of my lexical models work and others don’t.

So this is what I have now and it seems to largely work. Would still love to know how to debug or assess a situation where the lexical model never pops up the banner above the keyboard.

I never received any feedback on this question. It seems to work but

  1. I don’t know whether I should change the Keyboard ID to be unique for each language/lexical model
  2. I sometimes get people reporting a Fatal keyboard error cloud:naijatype-en.
  3. The lexical model doesn’t always work.
  4. It’s unclear what I need to do to update the app when I’ve updated the .kmp file. It seems that I need to right-click and edit each language and choose the .kmp file, but that is annoying when I support lots of languages. I think I must be doing it wrong. Also that wipes out much information about each language.

It seems that the BCP47 code needs to carefully match between Lexical model and the keyboard. When one keyboard supports multiple languages then you have to be rather careful about those entries, especially when updating a keyboard.

If I’m well out of the usual paradigm having 6+ languages for the one keyboard then I’d like someone to tell me what to avoid. From my perspective, maintaining one app for one keyboard for Nigeria’s hundreds of languages is better than supporting hundreds of apps.

Apologies on the lack of response until now.

  1. I don’t know whether I should change the Keyboard ID to be unique for each language/lexical model

You should be able to keep the same keyboard ID for all languages being used. What matters is that the lexical model for a language must be tagged with the same language ID used by the keyboard when typing in that language; the Keyman system within the App Builder won’t activate without the two language IDs matching.

It seems that the BCP47 code needs to carefully match between Lexical model and the keyboard. When one keyboard supports multiple languages then you have to be rather careful about those entries, especially when updating a keyboard.

Yep.

As for your other points, I would need more details. Then again, some of those points may be Keyboard App Builder specific; my work is focused on Keyman.

Noting this:

  1. I sometimes get people reporting a Fatal keyboard error cloud:naijatype-en.

What version of Keyboard App Builder are you working with? It sounds like you’re on an older version, not the most current one; if you’re using .kmp files, you shouldn’t ever see that cloud:: part; it should correspond with your .kmp’s file name. That’s an error coming from Keyman code, and as of version 14 or 15 of Keyman, installation from a .kmp should never result in that cloud:: prefix. I’m pretty certain a recent release of KAB updated to use version 15 of Keyman.

  1. The lexical model doesn’t always work.

So, like… the area where predictions are displayed just doesn’t show up? Or does it show up, but no predictions ever do? I’d need more details to be able to help here.