ChangeLocale

Metreos.ApplicationControl.ChangeLocale

Summary

Changes the current locale of the script instance.

Usage

All script instances operate within the context of a locale, as specified in mceadmin for the executing application partition of the application. ChangeLocale allows a developer to programmatically change this starting locale after the script instance has begun executing.

By changing the locale of the script and setting ResetStrings to true, global variables initialized by localizable strings defined in the locale table will update their values to reflect the string values corresponding to the new locale. Also, if using the Prompt fields in Play or VoiceRecognition to specify audio files, the audio file that correlates to the new locale will be played instead after the change. If there is no value specified in the Localization Editor in the Application Designer for a particular locale of a string, then the global variable that initializes from that localized string will have an empty string value after the ChangeLocale action completes (and if ResetStrings is set to true). If an audio file does not exist for the current locale, the Play command will play nothing and will complete immediately.

Remarks

If global variables are initialized with strings from the locale table, one must set ResetStrings to true in order to have those global variables update their values when the ChangeLocale action is used.

The sessionData object has a System.Globalization.CultureInfo Culture property. It represents the current locale of the script, and is updated accordingly by ChangeLocale.

The list of valid locales for the Locale action parameter are the set of locales returned by the System.Globalization.CultureTypes.SpecificCultures array. Valid values for Locale are shown for convenience in the Locale Name column in the following table:
Locale NameFriendly Name
af-ZAAfrikaans (South Africa)
ar-AEArabic (U.A.E.)
ar-BHArabic (Bahrain)
ar-DZArabic (Algeria)
ar-EGArabic (Egypt)
ar-IQArabic (Iraq)
ar-JOArabic (Jordan)
ar-KWArabic (Kuwait)
ar-LBArabic (Lebanon)
ar-LYArabic (Libya)
ar-MAArabic (Morocco)
ar-OMArabic (Oman)
ar-QAArabic (Qatar)
ar-SAArabic (Saudi Arabia)
ar-SYArabic (Syria)
ar-TNArabic (Tunisia)
ar-YEArabic (Yemen)
az-AZ-CyrlAzeri (Cyrillic, Azerbaijan)
az-AZ-LatnAzeri (Latin, Azerbaijan)
be-BYBelarusian (Belarus)
bg-BGBulgarian (Bulgaria)
bs-BA-LatnBosnian (Bosnia and Herzegovina)
ca-ESCatalan (Catalan)
cs-CZCzech (Czech Republic)
cy-GBWelsh (United Kingdom)
da-DKDanish (Denmark)
de-ATGerman (Austria)
de-CHGerman (Switzerland)
de-DEGerman (Germany)
de-LIGerman (Liechtenstein)
de-LUGerman (Luxembourg)
div-MVDivehi (Maldives)
el-GRGreek (Greece)
en-AUEnglish (Australia)
en-BZEnglish (Belize)
en-CAEnglish (Canada)
en-CBEnglish (Caribbean)
en-GBEnglish (United Kingdom)
en-IEEnglish (Ireland)
en-JMEnglish (Jamaica)
en-NZEnglish (New Zealand)
en-PHEnglish (Republic of the Philippines)
en-TTEnglish (Trinidad and Tobago)
en-USEnglish (United States)
en-ZAEnglish (South Africa)
en-ZWEnglish (Zimbabwe)
es-ARSpanish (Argentina)
es-BOSpanish (Bolivia)
es-CLSpanish (Chile)
es-COSpanish (Colombia)
es-CRSpanish (Costa Rica)
es-DOSpanish (Dominican Republic)
es-ECSpanish (Ecuador)
es-ESSpanish (Spain)
es-GTSpanish (Guatemala)
es-HNSpanish (Honduras)
es-MXSpanish (Mexico)
es-NISpanish (Nicaragua)
es-PASpanish (Panama)
es-PESpanish (Peru)
es-PRSpanish (Puerto Rico)
es-PYSpanish (Paraguay)
es-SVSpanish (El Salvador)
es-UYSpanish (Uruguay)
es-VESpanish (Venezuela)
et-EEEstonian (Estonia)
eu-ESBasque (Basque)
fa-IRPersian (Iran)
fi-FIFinnish (Finland)
fo-FOFaroese (Faroe Islands)
fr-BEFrench (Belgium)
fr-CAFrench (Canada)
fr-CHFrench (Switzerland)
fr-FRFrench (France)
fr-LUFrench (Luxembourg)
fr-MCFrench (Principality of Monaco)
gl-ESGalician (Galician)
gu-INGujarati (India)
he-ILHebrew (Israel)
hi-INHindi (India)
hr-BACroatian (Bosnia and Herzegovina)
hr-HRCroatian (Croatia)
hu-HUHungarian (Hungary)
hy-AMArmenian (Armenia)
id-IDIndonesian (Indonesia)
is-ISIcelandic (Iceland)
it-CHItalian (Switzerland)
it-ITItalian (Italy)
ja-JPJapanese (Japan)
ka-GEGeorgian (Georgia)
kk-KZKazakh (Kazakhstan)
kn-INKannada (India)
kok-INKonkani (India)
ko-KRKorean (Korea)
ky-KGKyrgyz (Kyrgyzstan)
lt-LTLithuanian (Lithuania)
lv-LVLatvian (Latvia)
mi-NZMaori (New Zealand)
mk-MKMacedonian (Former Yugoslav Republic of Macedonia)
mn-MNMongolian (Cyrillic, Mongolia)
mr-INMarathi (India)
ms-BNMalay (Brunei Darussalam)
ms-MYMalay (Malaysia)
mt-MTMaltese (Malta)
nb-NONorwegian, Bokm†l (Norway)
nl-BEDutch (Belgium)
nl-NLDutch (Netherlands)
nn-NONorwegian, Nynorsk (Norway)
ns-ZANorthern Sotho (South Africa)
pa-INPunjabi (India)
pl-PLPolish (Poland)
pt-BRPortuguese (Brazil)
pt-PTPortuguese (Portugal)
quz-BOQuechua (Bolivia)
quz-ECQuechua (Ecuador)
quz-PEQuechua (Peru)
ro-RORomanian (Romania)
ru-RURussian (Russia)
sa-INSanskrit (India)
se-FISami (Northern) (Finland)
se-NOSami (Northern) (Norway)
se-SESami (Northern) (Sweden)
sk-SKSlovak (Slovakia)
sl-SISlovenian (Slovenia)
sma-NOSami (Southern) (Norway)
sma-SESami (Southern) (Sweden)
smj-NOSami (Lule) (Norway)
smj-SESami (Lule) (Sweden)
smn-FISami (Inari) (Finland)
sms-FISami (Skolt) (Finland)
sq-ALAlbanian (Albania)
sr-BA-CyrlSerbian (Cyrillic) (Bosnia and Herzegovina)
sr-BA-LatnSerbian (Latin) (Bosnia and Herzegovina)
sr-SP-CyrlSerbian (Cyrillic, Serbia and Montenegro)
sr-SP-LatnSerbian (Latin, Serbia and Montenegro)
sv-FISwedish (Finland)
sv-SESwedish (Sweden)
sw-KEKiswahili (Kenya)
syr-SYSyriac (Syria)
ta-INTamil (India)
te-INTelugu (India)
th-THThai (Thailand)
tn-ZATswana (South Africa)
tr-TRTurkish (Turkey)
tt-RUTatar (Russia)
uk-UAUkrainian (Ukraine)
ur-PKUrdu (Islamic Republic of Pakistan)
uz-UZ-CyrlUzbek (Cyrillic, Uzbekistan)
uz-UZ-LatnUzbek (Latin, Uzbekistan)
vi-VNVietnamese (Vietnam)
xh-ZAXhosa (South Africa)
zh-CNChinese (People's Republic of China)
zh-HKChinese (Hong Kong S.A.R.)
zh-MOChinese (Macao S.A.R.)
zh-SGChinese (Singapore)
zh-TWChinese (Taiwan)
zu-ZAZulu (South Africa)

Action Parameters
Parameter Name.NET TypeDefaultDescription
Locale *System.StringThe region-specific RFC-1766 locale you wish to change to. This value must be a valid argument for the .NET CultureInfo constructor. Refer to the table in the description above for possible values. You must have at least one or more localizable strings or one ore more audio files defined for the new locale in order for the action to succeed.
ResetStringsSystem.BooleanIf true, any global variable which was initialized by a localizable string will be reinitialized to the value appropriate for the new locale. If you have set such an locale-initialized global variable to a new value since the script started, it will be overriden by the localalizable string value for the new locale.

No Result Data

No Defined Branch Conditions