Options
All
  • Public
  • Public/Protected
  • All
Menu

Hierarchy

  • GoogleTranslationService

Implements

Index

Constructors

constructor

Properties

Private apiResponseParser

apiResponseParser: GoogleTranslateAPIParser

Private apiUrl

apiUrl: string = "https://translate.googleapis.com/translate_a/single?client=gtx"

Private httpClient

httpClient: any = axios

Static BATH_REQ_SEP

BATH_REQ_SEP: string = "~"

Methods

applyTranslation

  • applyTranslation(translatedValues: Array<string>, locale: any, overrideExisting: boolean): Object
  • Apply array of translated values on locale

    Parameters

    • translatedValues: Array<string>

      Array of values translated by Goggle

    • locale: any

      Locale to apply values on

    • overrideExisting: boolean

      If true, existing values in locale will be replaced by new one.

    Returns Object

getBatchTranslateUrl

  • getBatchTranslateUrl(source: string, target: string, locale: any): string

getTranslateReqUrl

  • getTranslateReqUrl(source: string, target: string, word: string): string

translate

  • translate(source: string, target: string, locale: any, overrideExisting?: boolean): Promise<any>

Generated using TypeDoc