Jump to content

API Language.Translate: Difference between revisions

From Flowcode Help
No edit summary
m Text replacement - "width="90%" style="background-color:#D8C9D8; color:#4B008D;"" to "width="90%" class="mtx-class-macrohead""
 
(2 intermediate revisions by the same user not shown)
Line 1: Line 1:
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
{| class="mtx-class-macrotable wikitable"
|-
|-
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''Translate'''
| width="90%" class="mtx-class-macrohead" | '''Translate'''
|-
|-
| colspan="2" | Takes English text and optional hint and converts to the current language 
| colspan="2" | Takes English text and optional hint and converts to the current language 

Latest revision as of 14:11, 13 July 2026

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