OS X Localization Best Practices?

dgreening
Valued Contributor II

I have been struggling with localizing our Yosemite Macs at imaging time, and I am wondering if anyone knows of a good source of information on how to properly apply localization settings to a Mac without using the Setup Assistant.

Right now I am having some success placing localized versions of .GlobalPreferences.plist, com.apple.HIToolbox.plist, and com.apple.systemuiserver.plist into the proper user template for a particular local, such as Germany, and also placing the same files (minus .Globalpreferences.plist) into /Library/Preferences. I am also placing all three files into our local admin user directory as well as using FUT (I have tried this both on and off) as well as FEU.

I can reliably get the primary language, date, number settings, and keyboard settings to stick, however, I cannot for the life of me get the "Region:" settings to stick for new users. Our local admin account has the region set correctly, but any new accounts I add default back to United States (English) for "Region:". Would this be getting set automatically via Location Services? I am not too sure on that, as I have had our techs in Germany image locally at their office and they see the same thing.

I can't find a way to accomplish this task via a Config Profile either... I really need to be able to sort this out. Ever since Yosemite came out I have had nothing but trouble with reliable, complete localization.

Thoughts?

10 REPLIES 10

htse
Contributor III

There's a good chance I'm trying to hit this with a hammer rather than a scalpel, but if I remember correctly, the option you chosen during Setup Assistant sets the option for the root user as well, and if you change the setting for the root user afterwards it will use it will dictate that setting for successively created users as well as the login window.

dgreening
Valued Contributor II

This is for a never-booted image created using AutoDMG, so Setup Assistant will be playing no part in this.

davidacland
Honored Contributor II

Hi, I've written a couple of blogs that cover localization at the start (just need to switch to the region you need from the UK).

As a shell script: http://www.amsys.co.uk/2015/blog/creating-first-boot-script/#.VTbYZlKkqJI

Or with configuration profiles: http://www.amsys.co.uk/2015/blog/creating-config-profiles-instead-first-boot-script/#.VTbY51KkqJI

Hope this helps!

htse
Contributor III

I apologize, I realized that the information I was using hasn't really been tested realistically since 10.6, maybe earlier, so obviously when i tried it out it didn't work.

But in looking into it, I found https://support.apple.com/en-is/HT202036, and from what I was able to tried it interactively, OS X seems to take the Primary Language of the user that creates the account for the .localized template.

@davidacland I didn't know about the sysadminctl command in 10.10, I'll be sure to add that to my repertoire!

dgreening
Valued Contributor II

David,

I found your script blog post yesterday. I have been reading through it, and it looks like a lot of great information. I am going to try the User Template option again, as I want to avoid having to scope the localization to clients based on location, as all of our location groups are network subnet based, and we don't want to have to create static groups to avoid having the localization change on someone when they visit the US but are based in Germany. We need to set it and forget it at imaging time.

I also found some older information here, though most of it still seems applicable to Yosemite: https://macmule.com/2011/03/02/setting-user-os-language-post-install-from-casper/

marcusbjerknes
New Contributor II

Would it be possible for JAMF to create a way for us to fully localize OS X during or after imaging?

I want to be able to localize to Swedish (keyboard layout and region) and haven't found any good solution to this point. There is the PlistBuddy route, but I'm not good at scripting which I realize more and more is a major disadvantage. But why on earth should we need to create workarounds ourselves? This must be JAMF's responsibility to fix. Or at least show us how to do it.

davidacland
Honored Contributor II

Hi @marcusbjerknes

There's a feature request here that is similar: https://jamfnation.jamfsoftware.com/featureRequest.html?id=1406

We use config profiles to localise the Macs (links earlier in this post) which work great.

marcusbjerknes
New Contributor II

Hi @davidacland

I checked the link you posted but that post is 2,5 years old by now. I figure such a feature is not prioritized by JAMF. Well well, I would very much appreciate if you or someone else could explain in more detail in how to use a plist to set localization with a config profile. I've tried using the plists shown below in using your tip above but with no result on the target machine.

10bf7a87e04c4dcea3f1a48f4e049879
242bb3040c1f430682c007e2683ee81a

davidacland
Honored Contributor II

HI @marcusbjerknes

In our case we turn these plists into config profiles using mcxtoprofile. Here's a link to our British localisation config profile: https://github.com/amsysuk/public_config_profiles/blob/master/First_Boot_Profiles/LocalisetoUK.mobil...

The contents is similar, to the above, but with extra configprofile xml code:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
    <key>PayloadContent</key>
    <array>
        <dict>
            <key>PayloadContent</key>
            <dict>
                <key>com.apple.HIToolbox</key>
                <dict>
                    <key>Set-Once</key>
                    <array>
                        <dict>
                            <key>mcx_preference_settings</key>
                            <dict>
                                <key>AppleCurrentKeyboardLayoutInputSourceID</key>
                                <string>com.apple.keylayout.British</string>
                                <key>AppleDateResID</key>
                                <dict>
                                    <key>smRoman</key>
                                    <integer>2</integer>
                                </dict>
                                <key>AppleDefaultAsciiInputSource</key>
                                <dict>
                                    <key>InputSourceKind</key>
                                    <string>Keyboard Layout</string>
                                    <key>KeyboardLayout ID</key>
                                    <integer>2</integer>
                                    <key>KeyboardLayout Name</key>
                                    <string>British</string>
                                </dict>
                                <key>AppleEnabledInputSources</key>
                                <array>
                                    <dict>
                                        <key>InputSourceKind</key>
                                        <string>Keyboard Layout</string>
                                        <key>KeyboardLayout ID</key>
                                        <integer>2</integer>
                                        <key>KeyboardLayout Name</key>
                                        <string>British</string>
                                    </dict>
                                </array>
                                <key>AppleInputSourceHistory</key>
                                <array>
                                    <dict>
                                        <key>InputSourceKind</key>
                                        <string>Keyboard Layout</string>
                                        <key>KeyboardLayout ID</key>
                                        <integer>2</integer>
                                        <key>KeyboardLayout Name</key>
                                        <string>British</string>
                                    </dict>
                                </array>
                                <key>AppleNumberResID</key>
                                <dict>
                                    <key>smRoman</key>
                                    <integer>2</integer>
                                </dict>
                                <key>AppleSelectedInputSources</key>
                                <array>
                                    <dict>
                                        <key>InputSourceKind</key>
                                        <string>Keyboard Layout</string>
                                        <key>KeyboardLayout ID</key>
                                        <integer>2</integer>
                                        <key>KeyboardLayout Name</key>
                                        <string>British</string>
                                    </dict>
                                </array>
                                <key>AppleTimeResID</key>
                                <dict>
                                    <key>smRoman</key>
                                    <integer>2</integer>
                                </dict>
                            </dict>
                        </dict>
                    </array>
                </dict>
            </dict>
            <key>PayloadEnabled</key>
            <true/>
            <key>PayloadIdentifier</key>
            <string>Amsys.dcf942e7-a270-4a42-9d8a-775a3dd608d4.alacarte.customsettings.b0c937b6-a1f3-4361-80a8-1968dd857184</string>
            <key>PayloadType</key>
            <string>com.apple.ManagedClient.preferences</string>
            <key>PayloadUUID</key>
            <string>b0c937b6-a1f3-4361-80a8-1968dd857184</string>
            <key>PayloadVersion</key>
            <integer>1</integer>
        </dict>
        <dict>
            <key>PayloadContent</key>
            <dict>
                <key>.GlobalPreferences</key>
                <dict>
                    <key>Set-Once</key>
                    <array>
                        <dict>
                            <key>mcx_preference_settings</key>
                            <dict>
                                <key>AppleLanguages</key>
                                <array>
                                    <string>English</string>
                                </array>
                                <key>AppleLocale</key>
                                <string>en_GB</string>
                                <key>Country</key>
                                <string>GB</string>
                            </dict>
                        </dict>
                    </array>
                </dict>
            </dict>
            <key>PayloadEnabled</key>
            <true/>
            <key>PayloadIdentifier</key>
            <string>Amsys.dcf942e7-a270-4a42-9d8a-775a3dd608d4.alacarte.customsettings.edd87392-afc4-4421-b5c1-b0362503136f</string>
            <key>PayloadType</key>
            <string>com.apple.ManagedClient.preferences</string>
            <key>PayloadUUID</key>
            <string>edd87392-afc4-4421-b5c1-b0362503136f</string>
            <key>PayloadVersion</key>
            <integer>1</integer>
        </dict>
    </array>
    <key>PayloadDescription</key>
    <string>Included custom settings:
com.apple.HIToolbox
.GlobalPreferences
</string>
    <key>PayloadDisplayName</key>
    <string>Localise to UK</string>
    <key>PayloadIdentifier</key>
    <string>LocalisetoUK</string>
    <key>PayloadOrganization</key>
    <string></string>
    <key>PayloadRemovalDisallowed</key>
    <true/>
    <key>PayloadScope</key>
    <string>System</string>
    <key>PayloadType</key>
    <string>Configuration</string>
    <key>PayloadUUID</key>
    <string>dcf942e7-a270-4a42-9d8a-775a3dd608d4</string>
    <key>PayloadVersion</key>
    <integer>1</integer>
</dict>
</plist>

You can save the file with the ".mobileconfig" extension and upload straight into the JSS.

marcusbjerknes
New Contributor II

Hi,

So I just exchange British settings with Swedish then, I get it. But what about PayloadIdentifier and UUID? Should I modify those as well? In Identifier string your company name Amsys is stated... (hmm, Yoda sentence it became..)