API Language.Translate

From Flowcode Help
Jump to navigationJump to search
Fc9-comp-macro.png Translate
Takes English text and optional hint and converts to the current language 
Fc9-string-icon.png - STRING Text
The English text to translate to the Flowcode language 
Fc9-string-icon.png - STRING Hint
A contextual single word hint to help the translation 
Fc9-string-icon.png - STRING Return


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")