Options
All
  • Public
  • Public/Protected
  • All
Menu

Class I18n

Hierarchy

  • I18n

Index

Methods

Static add

  • add(code: string, items: any): void
  • Add a languge dictionary and set the current code as the current language.

    Parameters

    • code: string
    • items: any

    Returns void

Static getDictByCode

  • getDictByCode(code: string): any

Static recycleOthers

  • recycleOthers(code: string): void
  • Removes unused languages to release memory.

    function

    recycleOthers

    Parameters

    • code: string

      The language code which should not released.

    Returns void

Static translate

  • translate(text: string, defaultText: string): any
  • Trnsaltes a given text. If the given text is missing in the dictionary, use the given default value.

    function

    translate

    Parameters

    • text: string

      A text to be translated.

    • defaultText: string

      The default value.

    Returns any

    The translation for the given text.

Generated using TypeDoc