Jump to content

API Language.Translate

From Flowcode Help
Revision as of 14:07, 13 July 2026 by SteveT (talk | contribs) (Text replacement - "class="wikitable" style="width:60%; background-color:#FFFFFF;"" to "class="mtx-class-macrotable wikitable"")
Translate
Takes English text and optional hint and converts to the current language 
- STRING Text
The English text to translate to the Flowcode language 
- STRING Hint
A contextual single word hint to help the translation 
- 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")