Working on my first image here and wondering how I can configure instaDMG to create the image in French? If I was doing this by hand I’d boot of the Installer CD and choose French at the prompt but I want it to be fully automated if possible. Any ideas?
Never mind, I just answered my own question – for anyone else looking it’s pretty easy. The InstaDMG script has a line that states:
# Default ISO code for default install language. Script default is English.
ISO_CODE=”en”
Change the “en” to “fr” or the iso code of the language you want.
Hmmm, I seem to have jumped to the conclusion too quickly that this would work… I’m having a difficult time building an image that is fully in French…
I’ve tried both of the following:
• In instadmg.bash, I’ve edited the ISO_CODE=”en” line to be “fr”
• My understanding of InstaUp2Date is that I can have a ISO Langage Code line near the top of my “master” catalog file, so I have something like:
MasterImageName.catalog
[code]Output Volume Name = Macintosh HD
Output File Name = ImageName
ISO Language Code = fr
Base OS Disk:
Apple Updates:
include-file: Apple-BaseOS.catalog #(This would be my “vanilla” file, with 10.5.5 and all other updates
System Settings:
Admin User createUser-admin.pkg hash
Clear Reg clearReg.pkg hash
etc[/code]
I’ve also deleted the BaseImage in the Cache folder after making these changes, but unfortunately I’m still getting an image in English. Am I missing something here?
another fellow asking the same question is going about it differently:
[url]https://www.afp548.com/forum/viewtopic.php?showtopic=22427&lastpost=true#22445[/url]
Did you find a way to do this? I’m looking to do the same thing, can’t find any information on how to change localization.
Im having some trouble here too. I can’t manage to set the keyboard-layout to Swedish.
This file do i have to set: /Library/Preferences/com.apple.HIToolbox.plist:
[i]defaults read /Library/Preferences/com.apple.HIToolbox{
AppleDateResID = {
smRoman = 7;
};
AppleDefaultAsciiInputSource = {
InputSourceKind = “Keyboard Layout”;
“KeyboardLayout ID” = 7;
“KeyboardLayout Name” = “Swedish – Pro”;
};
AppleEnabledInputSources = (
{
InputSourceKind = “Keyboard Layout”;
“KeyboardLayout ID” = 7;
“KeyboardLayout Name” = “Swedish – Pro”;
}
);
AppleItlbDate = {
smRoman = 16383;
};
AppleItlbNumber = {
smRoman = 16383;
};
AppleNumberResID = {
smRoman = 7;
};
AppleSelectedInputSources = (
{
InputSourceKind = “Keyboard Layout”;
“KeyboardLayout ID” = 7;
}
);
AppleTimeResID = {
smRoman = 7;
};
}
[/i]
But how do i set:
[i] AppleSelectedInputSources = (
{
InputSourceKind = “Keyboard Layout”;
“KeyboardLayout ID” = 7;
“KeyboardLayout Name” = “Swedish – Pro”;
}
[/i]
Does anyone know? Please share..
: )
p
It’s an array of dicts (with a single dict as an array entry). Defaults will choke–try PlistBuddy instead.
– Patrick
A few more specifics.
Apple (and others) can write plists that defaults is not powerful enough to edit. This is where PlistBuddy (mind the capitalization) comes in. Installed by default at /usr/libexec/PlistBuddy on Leopard (older OSes are BYOPB ), you can use PlistBuddy to do all sorts of tricks that would blow defaults’ mind. However, the syntax is a bit…abstract. In your case the commands would be as follows if run from a payload-free InstaDMG CustomPKG:[code]#!/bin/bash
#A few variables for readability
PBPath=$3/usr/libexec/PlistBuddy
HIToolBoxPlist=$3/Library/Preferences/com.apple.HIToolbox.plist
#Create the AppleSelectedInputSources array
$PBPath -c “Add :AppleSelectedInputSources array” $HIToolBoxPlist
#Create a dict at index 0 of the array
$PBPath -c “Add :AppleSelectedInputSources:0 dict” $HIToolBoxPlist
#In the dict at index 0, create keys of various types and then set their values
$PBPath -c “Add :AppleSelectedInputSources:0:InputSourceKind string” $HIToolBoxPlist
$PBPath -c “Set :AppleSelectedInputSources:0:InputSourceKind \”Keyboard Layout\”” $HIToolBoxPlist
$PBPath -c “Add :AppleSelectedInputSources:0:\”KeyboardLayout ID\” integer” $HIToolBoxPlist
$PBPath -c “Set :AppleSelectedInputSources:0:\”KeyboardLayout ID\” 7″ $HIToolBoxPlist
$PBPath -c “Add :AppleSelectedInputSources:0:\”KeyboardLayout Name\” string” $HIToolBoxPlist
$PBPath -c “Set :AppleSelectedInputSources:0:\”KeyboardLayout Name\” \”KeyboardLayout Name\”” $HIToolBoxPlist[/code]YMMV with the above–it seems to be ok. If anyone has any suggestions for a collection of PlistBuddy examples, I’d be interested.
– Patrick
for the record, here’s the ‘regionalise as British’ part of my customising postflight script that sets up the default user setup in the ‘international’ preference panes. (timezone is set on firstboot with systemsetup)
i found i needed both AppleEnabledInputSources and AppleSelectedInputSources to get it to work.
[code]# ‘regionalise’ as British
/usr/libexec/PlistBuddy -c “Add AppleEnabledInputSources array” “$3″/Library/Preferences/com.apple.HIToolbox.plist
/usr/libexec/PlistBuddy -c “Add AppleEnabledInputSources:0 dict ” “$3″/Library/Preferences/com.apple.HIToolbox.plist
/usr/libexec/PlistBuddy -c “Add AppleEnabledInputSources:0:\”KeyboardLayout ID\” integer 2″ “$3″/Library/Preferences/com.apple.HIToolbox.plist
/usr/libexec/PlistBuddy -c “Add AppleEnabledInputSources:0:\”KeyboardLayout Name\” string British” “$3″/Library/Preferences/com.apple.HIToolbox.plist
/usr/libexec/PlistBuddy -c “Add AppleSelectedInputSources array” “$3″/Library/Preferences/com.apple.HIToolbox.plist
/usr/libexec/PlistBuddy -c “Add AppleSelectedInputSources:0 dict ” “$3″/Library/Preferences/com.apple.HIToolbox.plist
/usr/libexec/PlistBuddy -c “Add AppleSelectedInputSources:0:\”KeyboardLayout ID\” integer 2″ “$3″/Library/Preferences/com.apple.HIToolbox.plist
/usr/libexec/PlistBuddy -c “Add AppleSelectedInputSources:0:\”KeyboardLayout Name\” string British” “$3″/Library/Preferences/com.apple.HIToolbox.plist
/usr/libexec/PlistBuddy -c “Add AppleDateResID:smRoman array” “$3″/Library/Preferences/com.apple.HIToolbox.plist
/usr/libexec/PlistBuddy -c “Add AppleDateResID:smRoman:0 integer 2” “$3″/Library/Preferences/com.apple.HIToolbox.plist
/usr/libexec/PlistBuddy -c “Add AppleTimeResID:smRoman array” “$3″/Library/Preferences/com.apple.HIToolbox.plist
/usr/libexec/PlistBuddy -c “Add AppleTimeResID:smRoman:0 integer 2” “$3″/Library/Preferences/com.apple.HIToolbox.plist
/usr/libexec/PlistBuddy -c “Add AppleNumberResID:smRoman array” “$3″/Library/Preferences/com.apple.HIToolbox.plist
/usr/libexec/PlistBuddy -c “Add AppleNumberResID:smRoman:0 integer2” “$3″/Library/Preferences/com.apple.HIToolbox.plist
/usr/libexec/PlistBuddy -c “Add AppleLocale string en_GB” “$3″/Library/Preferences/.GlobalPreferences.plist
/usr/libexec/PlistBuddy -c “Add Country string GB” “$3″/Library/Preferences/.GlobalPreferences.plist
/usr/libexec/PlistBuddy -c “Add AppleLanguages:0 string en_GB” “$3″/Library/Preferences/.GlobalPreferences.plist
[/code]
How do I know the ID of my keyboard layout? I want to set it to Norwegian. Thanks!
Great!
Many thanks for the example guys.
Tron:
Do this in terminal; defaults read /Library/Preferences/com.apple.HIToolbox
You will see all info regarding this.
[QUOTE][u]Quote by: Giobbi[/u][p]Great!
Many thanks for the example guys.
Tron:
Do this in terminal; defaults read /Library/Preferences/com.apple.HIToolbox
You will see all info regarding this.[/p][/QUOTE]
That didn’t exist, but found it in ~/Library/Preferences/ByHost 🙂
Ah, sorry. Was just going to put upp this too:
defaults read ~/Library/Preferences/.GlobalPreferences
p
I’ve now successfully regionalized our image based on alantrewartha’s recipe. Thanks ALOT!
Wish there was a wiki somewhere with a compilation of image customization tips. There’s so much stuff you can do with OSX that’s not documented.
Hey trondah:
Could you post ur config here? Im having trouble with my Swedish setup.
: )
thx
p