Programming Reference Manual
 
 
Translator Overview
 
Embedded in the TRADIUM Basic Script language is a dynamic and online translation engine, Translator, which operates as a class. Translation is performed fast and accurate, using DeepL™ technology.
 
Translation is easy to perform by setting the native language and foreign language, the input text and perform the translation. Response is set in both OutputText and OutputUnicode properties.
 
You can combine several features of the Tradium Basic Script engine to create a powerful and fast translation function, which combine Tradiumīs own translation database, the online Translator engine and fast storage and easy maintenance of translated string. An example of such a high level script is printed below:
 
 
Function TT(myText As String) As String
 
'-------------------------------------------
Const EDIT_TRANSLATIONS As Boolean = False
'-------------------------------------------
 
Dim sResult As String, EditResult As String
Dim Tr As Translator
         If ForeignLanguage <> "UK_English" Then
                 TT = myText
         Else
                 sResult = Trans(myText)
                 If sResult = myText Then
                         sResult = GetSetting("Tradium","MyTranslations", myText, "")
                         If Len(sResult) > 0 Then
                                 If EDIT_TRANSLATIONS Then
                                         EditResult = InputBox(myText,"Check Translation", sResult)
                                         If Len(EditResult) > 0 Then
                                                 SaveSetting "Tradium", "MyTranslations", myText, EditResult
                                                 sResult = EditResult
                                         End If
                                 End If
                                 TT = sResult
                         Else
                                 Set Tr = New Translator
                                 Tr.FromLanguage = "NL"
                                 Tr.ToLanguage = "EN"
                                 Tr.InputText = myText
                                 Tr.DoTranslate
                                 TT = Tr.OutputUnicode
                                 If Len(Tr.OutputUnicode) > 0 Then
                                         SaveSetting "Tradium", "MyTranslations", myText, Tr.OutputUnicode
                                 End If
                         End If
                 Else
                         TT = sResult
                 End If
         End If
 
End Function
 
 
For more information on DeepL™, visit deepl.com