跳到主要内容
版本:Next

MidwayI18nServiceSingleton

Index

Constructors

constructor

Methods

publicaddLocale

  • addLocale(locale: string, localeTextMapping: Record<string, any>): void
  • add a language text mapping

publicgetAvailableLocale

  • getAvailableLocale(locale: string, group?: string): any
  • get locale string by find fallback and default, ignore match message

publicgetDefaultLocale

  • getDefaultLocale(): string
  • get current default language

publicgetLocaleMapping

  • getLocaleMapping(locale: string, group?: string): any
  • get mapping by locale

publichasAvailableLocale

  • hasAvailableLocale(locale: string): boolean
  • get available local in locale text map, include fallbacks

publictranslate

  • translate a message