Options
All
  • Public
  • Public/Protected
  • All
Menu

Multi-language support

Index

Properties

default

default: { changeLanguage: (languageCode: string) => void; instance: i18n; registerTranslationModule: (moduleName: string, translationModule: ITranslationModule) => void; setup: () => void }

Type declaration

  • changeLanguage: (languageCode: string) => void
      • (languageCode: string): void
      • Parameters

        • languageCode: string

        Returns void

  • instance: i18n
  • registerTranslationModule: (moduleName: string, translationModule: ITranslationModule) => void
      • (moduleName: string, translationModule: ITranslationModule): void
      • Register business language module in sub business packages. Please call this function before setup

        Parameters

        • moduleName: string
        • translationModule: ITranslationModule

        Returns void

  • setup: () => void
      • (): void
      • Please call this function in App.tsx

        Returns void

Variables

i18n

i18n: i18n = _i18n

Functions

changeLanguage

  • changeLanguage(languageCode: string): void
  • Parameters

    • languageCode: string

    Returns void

registerTranslationModule

  • registerTranslationModule(moduleName: string, translationModule: ITranslationModule): void
  • Register business language module in sub business packages. Please call this function before setup

    Parameters

    • moduleName: string
    • translationModule: ITranslationModule

    Returns void

setup

  • setup(): void
  • Please call this function in App.tsx

    Returns void

Const useNameSpace

  • useNameSpace(namespace: string, options?: {}): { i18n: i18n; t: (key: string, ...params: any[]) => string }
  • Parameters

    • namespace: string
    • Optional options: {}
      • [key: string]: any

    Returns { i18n: i18n; t: (key: string, ...params: any[]) => string }

    • i18n: i18n
    • t: (key: string, ...params: any[]) => string
        • (key: string, ...params: any[]): string
        • Parameters

          • key: string
          • Rest ...params: any[]

          Returns string

Generated using TypeDoc, the 2021/11/30 at 下午2:46:41