System and User Language

anverhousseini
Contributor II
Contributor II

Hi

I created a OS X vanilla image with the AutoDMG tool on a mac with user and system language in german. Then I copied the image on a MacBook and run the setup assistant to create an admin user and enroll the device with DEP. I selected german as language during the setup assistant . After the setup assistant the user language on the admin is german. Everything good so far.

I have a policy to create some user. These users now have english as user language. Anybody an idea why this happened? Or how do I change the user language with a command for specific users? I know that the language setup is in

~/Library/Preferences/.GlobalPreferences.plist

Thanks!
Best

3 REPLIES 3

mjsanders
New Contributor III

there are two things:
-there is languagesetup, which will run at a normal install, and I guess it saves its data in /Library/Preferences/.GolbalPreferences.plist. (or in the Library folder of the root user, as written on macenterprise link below) AutoDMG does not run this tool, so this file is not there, so english is default.

I think you can do two things: edit these files, or make a script to run languagesetup again.

See these links, I think they will solve your issue (if I understand you correctly)
macenterprise group read the post from Rolf Kocherhans on 28-10-14:

Hello all problem solved ! It has nothing to do with AutoDMG or some other imaging procedure, Apple must have changed something in the way they make the images. The default values (for language and keyboard layout) are stored in the .GlobalPreferences plist of the root user ! The solution is: 1. make the vanilla created by AutoDMG or any other procedure writable 2. execute this two default writes sudo defaults write /Volumes/Macintosh HD/var/root/Library/Preferences/.GlobalPreferences AppleLanguages "(de, en)" sudo defaults write /Volumes/Macintosh HD/var/root/Library/Preferences/.GlobalPreferences AppleLocale -string de_CH 3. make the vanilla read only compressed again 4. renew the checksum (asr imagescan) done !

examples how to use languagesetup from krypted

ciprianim
New Contributor

Hello - I solved the same Problem with mojave.

  1. Copy "Install macOS Mojave.app" to a new folder
  2. Make an image from previous folder
  3. Mount the DMG
  4. Start AutoDMG and drop the installer fom the DMG to it

Step 1-4 is because of a bug in macOS installer

  1. Mount the image read/write with the shadow option hdiutil attach osx-10.14-18A391.apfs.dmg -shadow osx.shadow Mountpoint is "/Volumes/Macintosh HD 1" Make necessary changes
  2. modify "/Volumes/Macintosh HD 1/private/var/root/Library/Preferences/.GlobalPreferences.plist"
    NOT with "defaults write" but with vo or another editor because its an XML File
    Here's my file:

    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
    <plist version="1.0">
    <dict> <key>AppleKeyboardUIMode</key> <integer>3</integer> <key>AppleLocale</key> <string>de_DE</string>
    </dict>
    </plist>

  3. Modify /Library/Preferences/.GlobalPreferences.plist
    defaults write "/Volumes/Macintosh HD 1/Library/Preferences/.GlobalPreferences.plist" AppleLanguages "(de, en)"

  4. Convert the DMG back to read only embedding the changes from the shadow file. hdiutil convert osx-10.14-18A391.apfs.dmg -format UDRW -o new.dmg -shadow osx.shadow
  5. Create the VM using vfuse (I use a teplate to crate it). vfuse -t vfuse-template10-14.json Here's my template: { "source_dmg": "/Users/user/Jamf/Jamf/new.dmg", "output_dir": "/Users/user/Jamf/vms", "output_name": "macos-10-14-jamf", "cache": false, "hw_version": 12, "mem_size": 4096, "disk_type": 0, "bridged": false, "mac_address": "", "enable3d": true, "vnc_port": 5901, "vnc_passwd": "", "hw_model": "MacBookAir7,2", "serial_number": "XXXXXXXXXXXX", "snapshot": true, "snapshot_name": "base-snapshot", "shared_folder": "/Users/user/Documents", "packer_template": "" }
  6. macOS Installer comes in german.

Look
Valued Contributor III

I have used previously in a setup script:

#!/bin/bash
defaults write /Library/Preferences/.GlobalPreferences.plist AppleLocale "en_NZ"
defaults write /Library/Preferences/.GlobalPreferences.plist Country "NZ"

No idea if it still works as I went to a deployment only model a couple of years ago, but unless Apple has changed something it should, adjust language and country to suit (they do have to match exactly as required so you may need to query a correct machine).