Posted on 05-19-2016 12:14 AM
Hello Community,
I want to create a self service feature to change the language and keyboard layout in english.
What is best way to do this?
Many Thanks for help
Christian
Solved! Go to Solution.
Posted on 05-21-2016 05:54 PM
Hello,
I create a solution. I change the language and create with Composor a .dmg from my Global Perferences and deploy it with the Self Service.
Many Thanks for help!
Chris
Posted on 05-19-2016 06:36 AM
I haven't tested, but it should go something like this.
1) Create a script called ChangeLanguage
#!/bin/sh
/usr/sbin/languagesetup -langspec $4
defaults write NSGlobalDomain AppleLocale $4
2) Create a policy (call it set to French for example) that runs that script. In parameter 4, put in the language code. What's the code to use? I've no idea, hopefully you do. I used 'FR' and it worked. I expect it's the standard two character code used for languages (en, ja, fr, de, es, it, nl, sv, nb, da, fi, pt, zh-Hans, zh-Hant, ko)
I haven't tested any of that, but it should get you started. You may need to specify the region when setting the AppleLocale (so use parameter 5 with the language/region code available at https://developer.apple.com/library/ios/documentation/MacOSX/Conceptual/BPInternational/LanguageandLocaleIDs/LanguageandLocaleIDs.html). You may also need to specify the path fo the defaults command (defaults write /Users/$currentUser/Library/Preferences/.GlobalPreferences.plist)
edit: users should expect to logout/in before seeing any change.
Posted on 05-20-2016 12:07 AM
@thoule Many Thanks for help! I test your script with the language code for english. Casper SUite run the code without error but after restart I don't see changes.
Posted on 05-20-2016 02:34 AM
We normally set languages via configuration profiles like this one: https://github.com/amsysuk/public_config_profiles/blob/master/LocalisetoUK.mobileconfig
You could offer these in self service.
Posted on 05-21-2016 05:54 PM
Hello,
I create a solution. I change the language and create with Composor a .dmg from my Global Perferences and deploy it with the Self Service.
Many Thanks for help!
Chris
Posted on 05-22-2016 11:46 PM
@c.knipping : this is probably no good idea. There are many other things that are set in .GlobalPreferences. for example, mouse speed, Force Touch Trackpad options and many more. Maybe your users are not very happy when their settings are getting overwritten...