# Usage: update_adium_from_bundle SOURCE_BUNDLE_PATH LANGUAGE_NAME REPO_LOCATION # ~/bin/update_adium_from_bundle Desktop/Adium_French.app French ~/adium # This script does not cover new localizations initially; they must first be added via Xcode # Copy all nibs and other files in the current directory to a given destination # Removes other copies of present in the target location first if [ "${file##*.}" = "nib" ] ; then ToNAME=`echo "$file" | sed
's/.nib$/.xib/g'` if [ "$file" = "AITwitterAccountView.nib" ] ; then ToPATH="$REPO/Plugins/Twitter Plugin/Resources/$DEST_LANG" elif [ "$file" = "WebKitPreferencesView.nib" ] ; then ToPATH="$REPO/Plugins/WebKit Message View/Resources/$DEST_LANG" ibtool
--export-strings-file
"$file.str" "$file" ibtool
--import-strings-file
"$file.str" "$ToPATH/$ToNAME" --write
"$ToPATH/$ToNAME" rm
-rf
"$1/$file" || true #first parameter to update_language is the language echo "+++++ Updating $LANG" silent_pushd
"$SOURCE/Contents" loc_copy
"$REPO/Resources/$DEST_LANG" if [ -e
"Emoticons" ] ; then silent_pushd
Default.AdiumEmoticonset
if [ -e
"Resources/$LANG" ] ; then silent_pushd
Resources/
$LANG cp
InfoPlist.strings
"$REPO/Resources/Emoticons/Default.AdiumEmoticonSet/Resources/$DEST_LANG" echo "No Emoticons found for $LANG" if [ -e
"Scripts" ] ; then silent_pushd
"System Statistics.AdiumScripts" if [ -e
"Resources/$LANG" ] ; then silent_pushd
Resources/
$LANG cp
InfoPlist.strings
"$REPO/Resources/Scripts/System Statistics.AdiumScripts/Resources/$DEST_LANG" echo "No Scripts found for $LANG" if [ -e
"Adium.framework/Versions/A/Resources/$LANG" ] ; then silent_pushd
Adium.framework/Versions/A/Resources/
$LANG loc_copy
"$REPO/Frameworks/Adium Framework/Resources/$DEST_LANG" echo "AIUtilities.framework" if [ -e
"AIUtilities.framework/Versions/A/Resources/$LANG" ] ; then silent_pushd
AIUtilities.framework/Versions/A/Resources/
$LANG loc_copy
"$REPO/Frameworks/AIUtilities Framework/Resources/$DEST_LANG" echo "AdiumLibpurple.framework" if [ -e
"AdiumLibpurple.framework/Versions/A/Resources/$LANG" ] ; then silent_pushd
AdiumLibpurple.framework/Versions/A/Resources/
$LANG loc_copy
"$REPO/Plugins/Purple Service/Resources/$DEST_LANG" if [ -e
"Library/Spotlight" ] ; then silent_pushd
Library/Spotlight
if [ -e
"AdiumSpotlightImporter.mdimporter/Contents/Resources/$LANG" ] ; then silent_pushd
AdiumSpotlightImporter.mdimporter/Contents/Resources/
$LANG loc_copy
"$REPO/Other/Adium Spotlight Importer/$DEST_LANG" if [ "$SOURCE" = "" -o
!
-d
"$SOURCE" -o
"$REPO" = "" -o
!
-d
"$REPO" ] ; then echo 'Usage: '$0' SOURCE_BUNDLE_PATH LANGUAGE_NAME REPO_LOCATION' echo 'e.g. '$0' ~/Desktop/Adium.app/ de ~/adium/' if [ "$2" = "all" ] ; then