Skip to main content
Version: 7.9

system.util.translate

This function is used in Python Scripting.

Description

This function allows you to retrieve the global translation of a term from the translation database using the current locale.

Client Permission Restrictions

This scripting function has no Client Permission restrictions.

Syntax - term Parameter only

system.util.translate(term)

Parameters

TypeParameterDescription
StringtermThe term to look up.

Returns

String - The translated term.

Scope

Client

Syntax - term, locale, and strict Parameters

system.util.translate(term, locale, strict)

  • Parameters
    • String term - The term to look up.
    • String locale
    • Boolean strict
  • Returns
    • String - The translated term.
  • Scope
    • Client

Code Examples

Example #1
# This script will take a term written into a Text Field component, translate it using the translation database, and then write it back to the same Text Field.
# it uses the current locale since none is specified.

text = event.source.parent.getComponent('Text Field').text
translation = system.util.translate(text)
event.source.parent.getComponent('Text Field').text = translation