Difference between revisions of "API Language.Translate"

From Flowcode Help
Jump to navigationJump to search
Line 27: Line 27:
  
 
==Detailed description==
 
==Detailed description==
''<span style="color:red;">No additional information</span>''
+
This takes the '''English''' string ''Text'' and attempts a conversion to an equivalent phrase in the users native language. The dictionary searches are exact (minus punctuation and case) - there is no predictive or fuzzy logic applied in order to translate. This means results stay fast and accurate.
 +
 
 +
 
 +
If the English phrase is not found in the dictionary then it will be returned as the result.
 +
 
 +
 
 +
The ''Hint'' is used in cases where an English phrase is ambiguous - "Bark" for example may refer to bark of a tree or the sound a dog makes. In this case supplying the ''Hint'' as "dog" or "tree" helps resolve ambiguity. Hints are not case sensitive and by convention are always one word. Not all phrases have a hint 9most will not) as these are only required where a phrase can have different English meanings.
 +
 
 +
 
 +
By convention Flowcode uses Americanised English, so "color" not "colour".
  
  

Revision as of 20:28, 8 August 2013


<sidebar>API contents</sidebar> Takes English text and optional hint and converts to the current language

Class hierarchy

Language

Translate

Parameters

STRING Text

The English text to translate to the Flowcode language

STRING Hint

A contextual single word hint to help the translation
The default value for this parameter is: ""


Return value

STRING

The converted string in UTF8 format for the selected Flowcode language pack. Text if no conversion exists.


Detailed description

This takes the English string Text and attempts a conversion to an equivalent phrase in the users native language. The dictionary searches are exact (minus punctuation and case) - there is no predictive or fuzzy logic applied in order to translate. This means results stay fast and accurate.


If the English phrase is not found in the dictionary then it will be returned as the result.


The Hint is used in cases where an English phrase is ambiguous - "Bark" for example may refer to bark of a tree or the sound a dog makes. In this case supplying the Hint as "dog" or "tree" helps resolve ambiguity. Hints are not case sensitive and by convention are always one word. Not all phrases have a hint 9most will not) as these are only required where a phrase can have different English meanings.


By convention Flowcode uses Americanised English, so "color" not "colour".


Examples

Calling in a calculation

  • Declare a variable 'result' of type STRING
  • Add to a calculation icon:
    result = ::Language.Translate("text", "hint")

No additional examples