Skip to main content
Solved

Language change via Self Service

  • May 19, 2016
  • 5 replies
  • 60 views

Forum|alt.badge.img+7

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

Best answer by ds_support

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

5 replies

Forum|alt.badge.img+15
  • Contributor
  • May 19, 2016

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.


Forum|alt.badge.img+7
  • Author
  • Contributor
  • May 20, 2016

@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
Forum|alt.badge.img+18
  • Valued Contributor
  • May 20, 2016

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.


Forum|alt.badge.img+7
  • Author
  • Contributor
  • Answer
  • May 22, 2016

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


Forum|alt.badge.img+16
  • Honored Contributor
  • May 23, 2016

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