C# Class MtEnhancedTradosPlugin.MtTranslationProviderGTApiConnecter

Mostra file Open project: patrickporter/MT-Enhanced-Trados-Plugin Class Usage Examples

Public Methods

Method Description
GetSourceLangsList ( string targetLang ) : List
MtTranslationProviderGTApiConnecter ( String key ) : System
Translate ( LanguagePair langPair, String text ) : String

Used to translate plain text only.

Translate ( LanguagePair langPair, String text, String format ) : String

Used to translate as html to allow for tag markup

isSupportedLangPair ( CultureInfo sourceCulture, CultureInfo targetCulture ) : bool

Private Methods

Method Description
DoTranslate ( LanguagePair langPair, String text, String format ) : String
EncodeSpecialChars ( string strInput ) : string
GetExceptionReason ( WebException exception ) : string
GetLanguageCode ( CultureInfo ci ) : string
GtRemoveBoms ( string input ) : string
ParseLanguageDetect ( string input ) : string

need to handle this differently from translate b/c the json is formed differently

UpdateSupportedLangs ( string target ) : void
parseReturnedError ( string input ) : string
parseReturnedResults ( string input, string findKey ) : List

Method Details

GetSourceLangsList() public method

public GetSourceLangsList ( string targetLang ) : List
targetLang string
return List

MtTranslationProviderGTApiConnecter() public method

public MtTranslationProviderGTApiConnecter ( String key ) : System
key String
return System

Translate() public method

Used to translate plain text only.
public Translate ( LanguagePair langPair, String text ) : String
langPair LanguagePair
text String
return String

Translate() public method

Used to translate as html to allow for tag markup
public Translate ( LanguagePair langPair, String text, String format ) : String
langPair LanguagePair
text String
format String
return String

isSupportedLangPair() public method

public isSupportedLangPair ( CultureInfo sourceCulture, CultureInfo targetCulture ) : bool
sourceCulture System.Globalization.CultureInfo
targetCulture System.Globalization.CultureInfo
return bool