Improve locale resolution in loadPSPDFKit function

Updated loadPSPDFKit to determine the locale by checking the provided argument, localized.culture, browser language, and defaulting to 'en'. This enhances locale selection robustness and user experience. Minified code updated accordingly.
This commit is contained in:
2026-02-16 18:35:36 +01:00
parent 8cf6484786
commit 352618a745
2 changed files with 3 additions and 2 deletions

View File

@@ -1,7 +1,8 @@
function loadPSPDFKit(arrayBuffer, container, licenseKey, locale) {
const resolvedLocale = locale || (typeof localized !== 'undefined' && localized.culture) || navigator.language || 'en'
return PSPDFKit.load({
inlineWorkers: false,
locale: locale,
locale: resolvedLocale,
licenseKey: licenseKey,
styleSheets: ['/css/site.css'],
container: container,