Search

User Manual

GETTING STARTED


MODULES AND PLATFORM


APPENDIX


TUTORIALS & HELPFUL TRICKS


GLOSSARY


STRATEGIC PARTNER LINKS

Sepasoft - MES Modules
Cirrus Link - MQTT Modules

RESOURCES

Inductive University
Ignition Demo Project
Knowledge Base Articles
Forum
IA Support
SDK Documentation
SDK Examples

ALL USER MANUAL VERSIONS

Ignition 8.1
Ignition 7.9
Ignition 7.8

Deprecated Pages

Skip to end of metadata
Go to start of metadata

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


This function accepts keyword arguments.

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

  • Parameters

String term - The term to look up.

String locale - Which locale to translate against. Useful when there are multiple locales defined for a single term. If omitted, the function attempts to use the current locale (as defined by the client, session, or Designer). [Optional] 

Boolean strict - If false, the function will return the passed term (param 1) if it could not find a defined translation for the locale: meaning, if you pass a term that hasn't been configured, the function will just send the term back to you. If true, then the function will return a None when it fails to find a defined translation. Default is false. [Optional] 

  • Returns

String - The translated term.

  • Scope

Vision Client

The following feature is new in Ignition version 8.0.8
Click here to check out the other new features
As of version 8.0.8, the scope of this function was expanded to include the Gateway and Perspective.

Code Examples
# 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
Python - Picking a Local
# This code block demonstrates how to use the locale parameter

# Use the currently detected locale
system.util.translate("Hello")

# Translate to Italian
system.util.translate("Hello", "it")

# Translate to a regional variant - Irish English in this case
system.util.translate("Hello", "en-ie")  
Keywords

system util translate, util.translate

  • No labels