Language change via Self Service

ds_support
New Contributor III

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

1 ACCEPTED SOLUTION

ds_support
New Contributor III

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

View solution in original post

5 REPLIES 5

thoule
Valued Contributor II

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.

ds_support
New Contributor III

@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.

davidacland
Honored Contributor II

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.

ds_support
New Contributor III

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

m_entholzner
Valued Contributor

@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...