Skip to content

Commit

Permalink
CLDR-17441 show keyman keyboard
Browse files Browse the repository at this point in the history
- use language code
  • Loading branch information
srl295 committed Mar 6, 2024
1 parent 02a4b1c commit c6dc8a5
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
10 changes: 10 additions & 0 deletions tools/cldr-apps/js/src/esm/cldrMenu.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -418,6 +418,16 @@ function updateLocaleMenu() {
const curLocale = cldrStatus.getCurrentLocale();
let prefixMessage = "";
if (curLocale != null && curLocale != "" && curLocale != "-") {
// here, update keyboards

for (const { InternalName } of keyman.getKeyboards()) {
keyman.removeKeyboards(InternalName);
console.log(`Removed kbd: ${InternalName}`);
}
console.log(`Adding kbd: @${curLocale}`);
keyman.addKeyboards(`@${curLocale}`);
// end keyboards

const locmap = cldrLoad.getTheLocaleMap();
cldrStatus.setCurrentLocaleName(locmap.getLocaleName(curLocale));
var bund = locmap.getLocaleInfo(curLocale);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,15 @@ public static void includeJavaScript(HttpServletRequest request, Writer out)
+ ".js\"></script>\n");
includeJqueryJavaScript(request, out);
includeCldrJavaScript(request, out);

out.write(
"<script src='https://s.keyman.com/kmw/engine/16.0.141/keymanweb.js'></script>\n");
out.write(
"<script src='https://s.keyman.com/kmw/engine/16.0.141/kmwuitoggle.js'></script>\n");
out.write(
"<script>(function(kmw) {"
+ "kmw.init({attachType:'auto'});\n"
+ "})(keyman);</script>\n");
}

private static void includeJqueryJavaScript(HttpServletRequest request, Writer out)
Expand Down

0 comments on commit c6dc8a5

Please sign in to comment.