system.vision.getLocale
This function replaces system.util.getLocale. Any scripts containing Vision Client scoped functions that were replaced with system.vision syntax will still work to maintain backwards compatibility.
This function is used in Python Scripting.
Descriptionβ
Returns the current string representing the user's Locale, such as 'en' for English.
Client Permission Restrictionsβ
This scripting function has no Client Permission restrictions.
Syntaxβ
system.vision.getLocale()
Parametersβ
Nothing
Returnsβ
String - String representing the user's Locale, such as 'en' for English.
When the locale includes a region, this string uses the legacy underscore form (such as en_US) rather than a BCP-47 language tag (such as en-US). Replace the underscore with a hyphen if you need to pass the value somewhere that expects a language tag. See Locale Formats and Language Tags.
Scopeβ
Vision Client
Code Examplesβ
# print a test if they are using English
locale = system.vision.getLocale()
if locale == "en":
print "Using English"