Home Reference Source
public class | source

Dictionary

Dictionary for translation

Constructor Summary

Public Constructor
public

constructor(translations: Object)

Dictionary

Member Summary

Public Members
public

Default language

public

Dictionary store

Method Summary

Public Methods
public

addTranslation(sourceText: string, translatedText: string, language: string)

Add translation pair to dictionary

public

addTranslations(translations: Object)

Add translations to dictionary

public

translate(text: string, language: string): string

Translate phrase

Public Constructors

public constructor(translations: Object) source

Dictionary

Params:

NameTypeAttributeDescription
translations Object

Public Members

public defaultLanguage: string source

Default language

public dictionary: Object source

Dictionary store

Public Methods

public addTranslation(sourceText: string, translatedText: string, language: string) source

Add translation pair to dictionary

Params:

NameTypeAttributeDescription
sourceText string

phrase

translatedText string

translated phrase

language string

language token

public addTranslations(translations: Object) source

Add translations to dictionary

Params:

NameTypeAttributeDescription
translations Object

public translate(text: string, language: string): string source

Translate phrase

Params:

NameTypeAttributeDescription
text string

phrase to translate

language string

language token

Return:

string

translated text