Options
All
  • Public
  • Public/Protected
  • All
Menu

Hierarchy

  • default

Index

Constructors

  • Parameters

    • distributionHash: string

      hash of released Crowdin project distribution

    • Optional config: ClientConfig

      client config

    Returns default

Methods

  • clearStringsCache(): void
  • Clear cache of translation strings

    Returns void

  • getCurrentLocale(): undefined | string
  • Get language code

    Returns undefined | string

  • getFileTranslations(file: string, languageCode?: string): Promise<any>
  • Returns file translations

    Parameters

    • file: string

      file from distribution

    • Optional languageCode: string

      language code

    Returns Promise<any>

  • getHash(): string
  • getLanguageObjects(): Promise<(Language | CustomLanguage)[]>
  • List of project language objects

    Returns Promise<(Language | CustomLanguage)[]>

  • Returns translations per each file in disribution for specific language

    Parameters

    • Optional languageCode: string

      language code

    Returns Promise<LanguageTranslations[]>

  • getManifestTimestamp(): Promise<number>
  • Get manifest timestamp of distribution

    Returns Promise<number>

  • List of files in distribution with variables replaced with the corresponding language code

    Returns Promise<LanguageFiles>

  • getReplacedLanguages(format: LanguagePlaceholders): Promise<string[]>
  • List of project language codes in the provided format

    Parameters

    • format: LanguagePlaceholders

      The placeholder format you want to replace your languages with

    Returns Promise<string[]>

  • getStringByKey(key: string | string[], file?: string, languageCode?: string): Promise<any>
  • Returns translation string for language for specific key

    Parameters

    • key: string | string[]

      path to the translation string in json file

    • Optional file: string

      filter strings by specific file (leave undefined to get from all json files)

    • Optional languageCode: string

      language code

    Returns Promise<any>

  • Returns translation strings from json-based files for all languages

    Parameters

    • Optional file: string

      filter strings by specific file (leave undefined to get from all json files)

    Returns Promise<LanguageStrings>

  • getStringsByLocale(file?: string, languageCode?: string): Promise<any>
  • Returns translation strings from json-based files for specific language

    Parameters

    • Optional file: string

      filter strings by specific file (leave undefined to get from all json files)

    • Optional languageCode: string

      language code

    Returns Promise<any>

  • listFiles(): Promise<string[]>
  • List of files in distribution

    Returns Promise<string[]>

  • listLanguages(): Promise<string[]>
  • List of project language codes

    Returns Promise<string[]>

  • setCurrentLocale(languageCode?: string): void
  • Default language code to be used if language was not passed as an input argument of the method

    Parameters

    • Optional languageCode: string

      laguage code

    Returns void