Options
All
  • Public
  • Public/Protected
  • All
Menu

Class TranslatorService

Hierarchy

  • TranslatorService

Index

Properties

Private _translations

_translations: {}

Type declaration

Methods

Private _getTranslation

  • _getTranslation(value: string, pluralOrSingular: typeof PLURAL | typeof SINGULAR): string
  • Get plural or singular translation for given value

    throws

    {MissingTranslationError}

    Parameters

    Returns string

getCapitalizedPlural

  • getCapitalizedPlural(value: string): string
  • Get the plural translation for the given value and capitalize it

    throws

    {MissingTranslationError}

    Parameters

    • value: string

    Returns string

getCapitalizedSingular

  • getCapitalizedSingular(value: string): string
  • Get the singular translation for the given value and capitalize it

    throws

    {MissingTranslationError}

    Parameters

    • value: string

    Returns string

getPlural

  • getPlural(value: string): string
  • Get the plural translation for the given value

    throws

    {MissingTranslationError}

    Parameters

    • value: string

    Returns string

getSingular

  • getSingular(value: string): string
  • Get the singular translation for the given value

    throws

    {MissingTranslationError}

    Parameters

    • value: string

    Returns string

maybePluralize

  • maybePluralize(count: number, value: string): string
  • Get the either the singular or plural translation, based on the given count Return the string ${count} ${translation}

    throws

    {MissingTranslationError}

    Parameters

    • count: number
    • value: string

    Returns string

setTranslation

  • setTranslation(key: string, translation: Translation): void

Generated using TypeDoc