Options
All
  • Public
  • Public/Protected
  • All
Menu

Hierarchy

Index

Constructors

constructor

  • constructs the localization API and sets the current local from local storage

    Parameters

    • Default value localeList: Locale[] = defaultList

      the list of locales Available in the application

    • Default value imgMap: Record<string, any> = {}

      A object that maps the region to a path to the img scr

    Returns LocalizationApi

Properties

imgMap

imgMap: Record<string, any>

A object that maps the region to a path to the img scr

locale

locale: Locale

localeList

localeList: Locale[]

Locale list of localization api

Methods

Private getCachedData

  • getCachedData(id: string): Locale | undefined
  • Parameters

    • id: string

    Returns Locale | undefined

getFormateLocale

  • getFormateLocale(): string
  • Gets formatted locale

    Returns string

    formatted locale in the form language[_region][.encoding][@modifier]

getLocale

  • Gets locale from memory

    Returns Locale

localeToString

  • localeToString(currentLocal: Locale): string
  • converts a given locale to a formatted string

    Parameters

    • currentLocal: Locale

      the given locale

    Returns string

    the formatted string

onSwitch

  • onSwitch(): void
  • TODO: determine wether or not this should go into the API is a called when switching the locale

    Returns void

    void

Private setCachedData

  • setCachedData(id: string, data: Locale): void
  • Parameters

    Returns void

setLocale

  • setLocale(locale: Locale): void
  • Sets locale and stores it in locale storage

    Parameters

    Returns void

Object literals

default

default: object

language

language: object

code

code: string = "en"

label

label: string = "English"

Generated using TypeDoc