Skip to content

Commit 5163fa7

Browse files
committed
WIP kbds
1 parent dbadf99 commit 5163fa7

File tree

2 files changed

+29
-0
lines changed

2 files changed

+29
-0
lines changed
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
/**
2+
* Operations around keyboard support
3+
*/
4+
5+
// See https://keyman.com/developer/keymanweb/ for the latest version and scripts to use
6+
const KEYMAN_VERSION = "17.0.333";
7+
const KEYMAN_SCRIPTS = ["keymanweb.js", "kmwuitoggle.js"];
8+
const KEYMAN_BASE = "https://s.keyman.com/kmw/engine/";
9+
10+
/*
11+
out.write(
12+
"<script src='https://s.keyman.com/kmw/engine/16.0.141/keymanweb.js'></script>\n");
13+
out.write(
14+
"<script src='https://s.keyman.com/kmw/engine/16.0.141/kmwuitoggle.js'></script>\n");
15+
out.write(
16+
"<script>(function(kmw) {"
17+
+ "kmw.init({attachType:'auto'});\n"
18+
+ "})(keyman);</script>\n");
19+
*/

tools/cldr-apps/js/src/esm/cldrMenu.mjs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -418,6 +418,16 @@ function updateLocaleMenu() {
418418
const curLocale = cldrStatus.getCurrentLocale();
419419
let prefixMessage = "";
420420
if (curLocale != null && curLocale != "" && curLocale != "-") {
421+
// here, update keyboards
422+
423+
for (const { InternalName } of keyman.getKeyboards()) {
424+
keyman.removeKeyboards(InternalName);
425+
console.log(`Removed kbd: ${InternalName}`);
426+
}
427+
console.log(`Adding kbd: @${curLocale}`);
428+
keyman.addKeyboards(`@${curLocale}`);
429+
// end keyboards
430+
421431
const locmap = cldrLoad.getTheLocaleMap();
422432
cldrStatus.setCurrentLocaleName(locmap.getLocaleName(curLocale));
423433
var bund = locmap.getLocaleInfo(curLocale);

0 commit comments

Comments
 (0)