idea-aws
    Preparing search index...

    Class Translate

    A wrapper for Amazon Translate.

    Index

    Constructors

    • Initialize a new Translate helper object.

      Parameters

      • options: { region?: string } = {}

      Returns Translate

    Properties

    client: TranslateClient
    sourceLanguageCode: string = 'en'

    Default input language code.

    targetLanguageCode: string = 'en'

    Default output language code.

    terminologyNames: string[] = []

    Default terminology list.

    Methods

    • Analyse a PDFTemplate to extract terms to translate based on a PDFEntity (using a sourceLanguage as reference).

      Parameters

      • template: PDFTemplateSection[]
      • entity: PDFEntity
      • sourceLanguage: string

      Returns Promise<Set<string>>

    • Get the contents of a PDF template (against a PDFEntity) translated in the desired language, if the latter isn't between the ones already available.

      Parameters

      • entity: PDFEntity
      • template: PDFTemplateSection[]
      • language: string
      • languages: Languages

      Returns Promise<Record<string, string>>

      an object that maps original texts with their translations (or nothing).