Skip to content

Customize i18n resources ​

Assumptions ​

Assume an assets/ folder at the website root for i18n resources, referred to as websiteRoot/assets/.

Configuration ​

  1. Copy the lib/locales folder from the SDK package to websiteRoot/assets/.

  2. Set the i18n path to load resources.

    js
    new UIExtension.PDFUI({
        i18n: {
            absolutePath: 'websiteRoot/assets/locals'
        },
        / the other options...
    });
  3. Add locales by creating a folder under websiteRoot/assets/locales using a standard language code (for example zh-CN for Chinese, ru-RU for Russian).

  4. Copy "ui_.json" from websiteRoot/assets/locales/en-US into the new folder and translate ( localize) all entries in "ui_.json".

  5. Set the default language.

    js
    new UIExtension.PDFUI({
        i18n: {
            absolutePath: `websiteRoot/assets/locals`,
            lng: 'zh-CN'
        },
        / the other options
    })

Verify configuration in development ​

  1. Clear the browser cache so the latest i18n resources load.

  2. Refresh the browser, open the Network panel in DevTools, and confirm the ui_.json request URL points to your custom locale path.