Nutrient Web SDK

v0.0.0-dev

ReferenceNutrientViewerI18npreloadLocalizationData

Function preloadLocalizationData

Nutrient Web SDK comes with a number of predefined locales which are loaded automatically on demand when using the NutrientViewer.Instance#setLocale API or when setting a locale in the main Configuration.

The locale information are then exposed to NutrientViewer.I18n.messages.

You can use this method to preload these information instead of loading them on demand. This would allow you to modify some translations before loading Nutrient Web SDK for example.

ReadonlyFunction
Type Signature
preloadLocalizationData(
    locale: string,
    options?: { baseUrl?: string },
): Promise<void>
  • Type Declaration

    Parameters

    localestring

    The locale to load the localization data for.

    options{ baseUrl?: string } = {}

    The options for the preloadLocalizationData function.

    Returns

    Promise<void>

    Returns a promise that resolves when the locale data have been loaded.