Setting User & OS Language Post Install from Casper

Standard

We need to have different configurations etc based on  the major european languages.

We were orignally looking at setting the OS Language via the custom os install options, but have been advised by JAMF that this does not work.

So we needed a work around to achieve the same.

I’ve got this working by narrowing it down to 4 plists… I’m then editing these for each language needed & making Composer dmg’s of each plist to distribute.

The upside of using this method is that we can use a single config per OS version with smart configs based on it that change the language as required.

Basically, make the changes & copy the below files:

Set OS Keyboard Language:

Change OS Keyboard from input source at login window.

Make a composer DMG of: /Library/Preferences/com.apple.HIToolbox.plist (there are multiple dictionary keys that need to be changed).

Set OS Primary Language:

The below interactive command will give you a  list of languages;

sudo /usr/sbin/languagesetup

The below will set the OS Language to French:

sudo /usr/sbin/languagesetup –langspec French

After change make a composer dmg of: /Library/Preferences/.GlobalPreferences.plist

Terminal commands for the above:

Set language order preference:

/usr/bin/defaults write /Library/Preferences/.GlobalPreferences AppleLanguages "(en, ja, fr, de, es, it, nl, sv, nb, da, fi, pt, zh-Hans, zh-Hant, ko)"

Set locale:

/usr/bin/defaults write /Library/Preferences/.GlobalPreferences AppleLocale "en_GB"

Set Country:

/usr/bin/defaults write /Library/Preferences/.GlobalPreferences Country “en_GB”

Set User Keyboard Language:

Change languages for user text input in system preferences.

Make a composer dmg of: ~/Library/Preferences/ByHost/com.apple.HIToolbox.<UID>.plist

Set to fill user templates & tick update ByHost in remote/policy.

Set User Language:

Run the below command as a logged in user to set the Language Preference order (make changes as required):

/usr/bin/defaults write -g AppleLanguages "(en, ja, fr, de, es, it, nl, sv, nb, da, fi, pt, zh-Hans, zh-Hant, ko)"

Make a composer dmg of: ~/Library/Preferences/.GlobalPreferences.plist

Set to fill user templates.