Setting system language with javascript

Solved

Hello there, 

I'm trying to set the system language of a device with javascript. As you can see in the js documentation, there is already an example script for it. I tried the example but I'm getting following error message:

Custom log (Set locale failed with status code NOT_SUPPORTED)

I used following example script in the js documentation:

https://www.soti.net/mc/help/javascriptapi/en/mobicontrol.intl.Locale.html

var locale = new mobicontrol.intl.Locale("en", "CA");
try {
    mobicontrol.intl.setLocale(locale);
    mobicontrol.log.info('Locale set.');
} catch (err) {
    mobicontrol.log.error('Set locale failed with status code ' + err.statusCode);
}

 

MobiControl version: 15.5.1.1010

Agent Version: 15.4.2.1025

2 years ago
Android Scripting
ANSWERS
RC
Raymond Chan Diamond Contributor
2 years ago

The fact that a script command is documented in MobiControl Javascript Reference Manual does not mean it will work for all device models and enrollment modes, as it often depends on availability of AE plug-in and implementation support in the OEM device firmware. Support may also change with device firmware versions due to new limitations imposed by Google's Android kernel/system architecture/implementations.  So, be always prepared to do tests on your script before each deployments and firmware upgrdaes on each of your device model/firmware used.

Solution
RS
Rafael Schäfer
2 years ago

I get the same and we are also using latest ae agent/plugin and are on Mobicontrol 15.6.3.

Maybe this is supported to Windows devices or so only? But can't find any kind of information that there's some kind of limitation.

Must this be done via javascript? You could look for the OEM-Config app from the manufacturer of your device (maybe in combination with custom attribute if multiple locales are used) if it does provide this functionality.