Home Forums Software InstaDMG Setting default language

Viewing 15 posts - 1 through 15 (of 27 total)
  • Author
    Posts
  • #374163
    jdyck
    Participant

    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?

    #374164
    jdyck
    Participant

    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.

    #374291
    jdyck
    Participant

    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?

    #374331
    knowmad
    Participant

    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]

    #374493
    trondah
    Participant

    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.

    #374505
    Giobbi
    Participant

    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

    #374509
    Patrick Fergus
    Participant

    It’s an array of dicts (with a single dict as an array entry). Defaults will choke–try PlistBuddy instead.

    – Patrick

    #374511
    Patrick Fergus
    Participant

    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

    #374515
    alantrewartha
    Participant

    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]

    #374517
    trondah
    Participant

    How do I know the ID of my keyboard layout? I want to set it to Norwegian. Thanks!

    #374521
    Giobbi
    Participant

    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.

    #374522
    trondah
    Participant

    [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 🙂

    #374523
    Giobbi
    Participant

    Ah, sorry. Was just going to put upp this too:

    defaults read ~/Library/Preferences/.GlobalPreferences

    p

    #374525
    trondah
    Participant

    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.

    #374981
    Giobbi
    Participant

    Hey trondah:

    Could you post ur config here? Im having trouble with my Swedish setup.

    : )

    thx

    p

Viewing 15 posts - 1 through 15 (of 27 total)
  • You must be logged in to reply to this topic.

Comments are closed