From c6dc8a56a93650989f42b6ea862b20b580cc14fa Mon Sep 17 00:00:00 2001 From: "Steven R. Loomis" Date: Wed, 6 Mar 2024 13:01:17 -0600 Subject: [PATCH] CLDR-17441 show keyman keyboard - use language code --- tools/cldr-apps/js/src/esm/cldrMenu.mjs | 10 ++++++++++ .../src/main/java/org/unicode/cldr/web/SurveyTool.java | 9 +++++++++ 2 files changed, 19 insertions(+) diff --git a/tools/cldr-apps/js/src/esm/cldrMenu.mjs b/tools/cldr-apps/js/src/esm/cldrMenu.mjs index b86ea10349d..b5bc3b304a6 100644 --- a/tools/cldr-apps/js/src/esm/cldrMenu.mjs +++ b/tools/cldr-apps/js/src/esm/cldrMenu.mjs @@ -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); diff --git a/tools/cldr-apps/src/main/java/org/unicode/cldr/web/SurveyTool.java b/tools/cldr-apps/src/main/java/org/unicode/cldr/web/SurveyTool.java index bf3ee340b87..431760ba75b 100644 --- a/tools/cldr-apps/src/main/java/org/unicode/cldr/web/SurveyTool.java +++ b/tools/cldr-apps/src/main/java/org/unicode/cldr/web/SurveyTool.java @@ -237,6 +237,15 @@ public static void includeJavaScript(HttpServletRequest request, Writer out) + ".js\">\n"); includeJqueryJavaScript(request, out); includeCldrJavaScript(request, out); + + out.write( + "\n"); + out.write( + "\n"); + out.write( + "\n"); } private static void includeJqueryJavaScript(HttpServletRequest request, Writer out)