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:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user