Options
Modules
  • Command
  • Localization
  • Logger
All
  • Public
  • Public/Protected
  • All
Menu

This is the main class of the Localization module. This class contains all the static methods that will be used for leveraging localization within your project

Hierarchy

  • Localization

Index

Constructors

constructor

Methods

Static addPipeFunction

Static getKeys

  • Returns an array of resource keys for the given resource path. The array will be empty if none exist.

    Parameters

    Returns string[]

Static getPipeFunction

Static getResourceProxy

Static hasPipeFunction

  • hasPipeFunction(ident: string): boolean

Static loadFromDirectory

  • loadFromDirectory(language: string, dir: string): void
  • Loads and parses all .lang files in the given directory (and subdirectories therein) and caches them under the given language

    Parameters

    • language: string
    • dir: string

    Returns void

Static loadLangFile

  • loadLangFile(language: string, file: string): void
  • Loads and parses the given .lang file, caching it under the given language

    Parameters

    • language: string
    • file: string

    Returns void

Static resource

  • Fetches a Localization string resource for the given path and key. The string will be built using the given arguments

    Parameters

    Returns string

Static resourceExists

  • Returns whether or not a Localization resource exists for the given path.

    NOTE: Does not check the fallback language

    Parameters

    Returns boolean

Static setFallbackLanguage

  • setFallbackLanguage(language: string): void
  • Sets the fallback language to use if a resource doesn't exist for the language given to Localization.resource()

    Parameters

    • language: string

    Returns void

Generated using TypeDoc