Difference between revisions of "API Language.Translate"

From Flowcode Help
Jump to navigationJump to search
(XML import API auto-gen)
(XML import)
 
(14 intermediate revisions by 2 users not shown)
Line 1: Line 1:
<sidebar>API contents</sidebar>
+
<sidebar>API Contents</sidebar>
 
Takes English text and optional hint and converts to the current language
 
Takes English text and optional hint and converts to the current language
  
 +
<div style="width:25%; float:right" class="toc">
 +
====Class hierarchy====
 +
[[API Language|Language]]
 +
:[[API Language|Translate]]
 +
</div>
 +
__TOC__
  
===Parameters===
+
==Parameters==
''[[Variable types|STRING]] Text''
+
[[Variable Types|STRING]] ''Text''
 
:The English text to translate to the Flowcode language
 
:The English text to translate to the Flowcode language
  
''[[Variable types|STRING]] Hint''
+
[[Variable Types|STRING]] ''Hint''
 
:A contextual single word hint to help the translation
 
:A contextual single word hint to help the translation
 
:''The default value for this parameter is: '''''""'''
 
:''The default value for this parameter is: '''''""'''
  
===Return value===
 
[[Variable types|STRING]]
 
  
No additional information
+
==Return value==
 +
[[Variable Types|STRING]]
  
===Detailed description===
+
The converted string in UTF8 format for the selected Flowcode language pack. ''Text'' if no conversion exists.
''No additional information''
 
  
===Examples===
+
 
====Calling in a calculation====
+
==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
 
* Declare a variable 'result' of type STRING
* Add to a calculation icon: result = ::Language.Translate("text", "hint")
+
* Add to a calculation icon: <pre class="brush:[cpp]">result = ::Language.Translate("text", "hint")</pre>
 +
 
 +
''<span style="color:red;">No additional examples</span>''

Latest revision as of 15:57, 16 January 2014

<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