function getLanguageCodeFromUrl() { try { const pathname = window.location.pathname; const parts = pathname.split("/").filter(Boolean); // Remove empty segments // Check if the first segment is a two-letter language code const languageCode = parts.length > 0 && /^[a-zA-Z]{2}$/.test(parts[0]) ? parts[0] // Return the detected language code : "en"; // Default to "en" if no valid language code is found return languageCode; } catch (e) { return 'en'; } } //window.pnrApplicationSettings = { // Application: "pnr", // ApplicationUrl: 'https://localhost:51666', // SelectedLocale: getLanguageCodeFromUrl(), //} document.addEventListener("DOMContentLoaded", function () { console.log("DOM is ready"); });