Customize i18n resources ​
Assumptions ​
Assume an assets/ folder at the website root for i18n resources, referred to as websiteRoot/assets/.
Configuration ​
Copy the
lib/localesfolder from the SDK package towebsiteRoot/assets/.Set the i18n path to load resources.
jsnew UIExtension.PDFUI({ i18n: { absolutePath: 'websiteRoot/assets/locals' }, / the other options... });Add locales by creating a folder under
websiteRoot/assets/localesusing a standard language code (for examplezh-CNfor Chinese,ru-RUfor Russian).Copy
"ui_.json"fromwebsiteRoot/assets/locales/en-USinto the new folder and translate ( localize) all entries in"ui_.json".Set the default language.
jsnew UIExtension.PDFUI({ i18n: { absolutePath: `websiteRoot/assets/locals`, lng: 'zh-CN' }, / the other options })
Verify configuration in development ​
Clear the browser cache so the latest i18n resources load.
Refresh the browser, open the Network panel in DevTools, and confirm the
ui_.jsonrequest URL points to your custom locale path.