Options
All
  • Public
  • Public/Protected
  • All
Menu

Class IlcIntl

WARNING: this class shouldn't be imported directly in the apps or adapters. Use IlcAppSdk instead.

Hierarchy

  • IlcIntl

Index

Constructors

constructor

Methods

get

getDefault

getSupported

  • getSupported(): { currency: string[]; locale: string[] }
  • Allows to fetch all supported values for currency & locale

    Returns { currency: string[]; locale: string[] }

    • currency: string[]
    • locale: string[]

localizeUrl

  • localizeUrl(url: string, configOverride?: { locale?: string }): string
  • Allows to convert plain URL into a one that contains i18n information.

    Parameters

    • url: string

      absolute path or absolute URI. Ex: "/test?a=1" or "http://tst.com/"

    • configOverride: { locale?: string } = {}

      allows to override current i18n configuration & retrieve localized URL for desired configuration.

      • Optional locale?: string

    Returns string

onChange

  • onChange<T>(prepareForChange: (event: IntlUpdateEvent) => T | Promise<T>, performChange: (event: IntlUpdateEvent, preparedData: T) => void | Promise<void>): () => void
  • [CSR ONLY] Allows to watch changes to locale or currency that are happening at the client side.

    Type parameters

    • T

    Parameters

    Returns () => void

    • callback that can be used to unsubscribe from changes
      • (): void
      • Returns void

parseUrl

  • parseUrl(url: string): { cleanUrl: string; locale: string }
  • Allows to parse URL and receive "non-localized" URL and information about locale that was encoded in URL.

    Parameters

    • url: string

      absolute path or absolute URI. Ex: "/test?a=1" or "http://tst.com/"

    Returns { cleanUrl: string; locale: string }

    • cleanUrl: string
    • locale: string

set

unmount

  • unmount(): void
  • [CSR ONLY] In apps that are running under ILC it shouldn't be used directly.

    Returns void

Generated using TypeDoc