diff --git a/web/widget-event-handlers.js b/web/widget-event-handlers.js index 8ab599e1..07964eb5 100644 --- a/web/widget-event-handlers.js +++ b/web/widget-event-handlers.js @@ -215,8 +215,8 @@ export function attachAllEventHandlers( if (isLanguageCode(beforeColon)) { // It's already a language tag - only update if language is different if (beforeColon === lang) { - // Same language already exists, don't add duplicate - return null; + // Same language already exists, return unchanged + return tagContent; } else { // Replace the language part with new language const charPart = firstPart.substring(colonIndex + 1); diff --git a/web/widget-ui-builder.js b/web/widget-ui-builder.js index eaa5afef..ac7d3a15 100644 --- a/web/widget-ui-builder.js +++ b/web/widget-ui-builder.js @@ -5,6 +5,10 @@ */ import { TagUtilities } from "./tag-utilities.js"; +import { loadSupportedLanguages } from "./language-constants.js"; + +// Load supported languages into memory on module load +loadSupportedLanguages(); export function buildHistorySection(state, storageKey) { const historySection = document.createElement("div");