adium 4785:6799834237f4: Update `make localizable-strings` for 0...

commits at adium.im commits at adium.im
Fri Apr 27 00:46:54 UTC 2012


details:	http://hg.adium.im/adium/rev/6799834237f4
revision:	4785:6799834237f4
branch:		(none)
author:		Frank Dowsett <wixardy at adium.im>
date:		Thu Apr 26 15:28:22 2012 -0400

Update `make localizable-strings` for 01a79023a03b's reorg
Subject: adium 4786:0e51b391797e: Update the update_adium_from_bundle script for the xib changeover in b9ffdf44f4b4. Also made the indenting consistent and added a usage output for invalid arguments.

details:	http://hg.adium.im/adium/rev/0e51b391797e
revision:	4786:0e51b391797e
branch:		(none)
author:		Frank Dowsett <wixardy at adium.im>
date:		Thu Apr 26 20:45:08 2012 -0400

Update the update_adium_from_bundle script for the xib changeover in b9ffdf44f4b4. Also made the indenting consistent and added a usage output for invalid arguments.

diffs (279 lines):

diff -r 0c92a4c051f7 -r 0e51b391797e Makefile
--- a/Makefile	Thu Apr 26 11:57:19 2012 -0400
+++ b/Makefile	Thu Apr 26 20:45:08 2012 -0400
@@ -42,7 +42,7 @@
 	mkdir tmp || true
 	mv "Plugins/Purple Service" tmp
 	genstrings -o Resources/en.lproj -s AILocalizedString Source/*.m Source/*.h Plugins/*/*.h Plugins/*/*.m Plugins/*/*/*.h Plugins/*/*/*.m
-	genstrings -o tmp/Purple\ Service/en.lproj -s AILocalizedString tmp/Purple\ Service/*.h tmp/Purple\ Service/*.m
+	genstrings -o tmp/Purple\ Service/Resources/en.lproj -s AILocalizedString tmp/Purple\ Service/*.h tmp/Purple\ Service/*.m
 	genstrings -o Frameworks/AIUtilities\ Framework/Resources/en.lproj -s AILocalizedString Frameworks/AIUtilities\ Framework/Source/*.h Frameworks/AIUtilities\ Framework/Source/*.m
 	genstrings -o Frameworks/Adium\ Framework/Resources/en.lproj -s AILocalizedString Frameworks/Adium\ Framework/Source/*.m Frameworks/Adium\ Framework/Source/*.h
 	mv "tmp/Purple Service" Plugins
diff -r 0c92a4c051f7 -r 0e51b391797e Utilities/Localization Utility Scripts/update_adium_from_bundle
--- a/Utilities/Localization Utility Scripts/update_adium_from_bundle	Thu Apr 26 11:57:19 2012 -0400
+++ b/Utilities/Localization Utility Scripts/update_adium_from_bundle	Thu Apr 26 20:45:08 2012 -0400
@@ -2,8 +2,8 @@
 ###############
 #
 # Usage: update_adium_from_bundle SOURCE_BUNDLE_PATH LANGUAGE_NAME REPO_LOCATION
-#        for example:
-#            ~/bin/update_adium_from_bundle Desktop/Adium_French.app French ~/adium
+#		for example:
+#			~/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
 ################
@@ -18,20 +18,35 @@
 # Removes other copies of present in the target location first
 loc_copy()
 {
-    for file in * ; do
-		rm -rf "$1/$file" || true
-		cp -R "$file" "$1"
-    done
+	for file in * ; do
+		if [ "${file##*.}" = "nib" ] ; then
+			ToNAME=`echo "$file" | sed 's/.nib$/.xib/g'`
+			ToPATH=$1
+			
+			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"
+			fi
+			
+			ibtool --export-strings-file "$file.str" "$file"
+			ibtool --import-strings-file "$file.str" "$ToPATH/$ToNAME" --write "$ToPATH/$ToNAME"
+			rm "$file.str"
+		else
+			rm -rf "$1/$file" || true
+			cp -R "$file" "$1"
+		fi
+	done
 }
 
 silent_pushd()
 {
-    pushd "$1" >/dev/null
+	pushd "$1" >/dev/null
 }
 
 silent_popd()
 {
-    popd >/dev/null
+	popd >/dev/null
 }
 
 #####
@@ -40,89 +55,85 @@
 
 update_language()
 {
-    #first parameter to update_language is the language
-    LANG=$1.lproj
-    DEST_LANG=$LANG
-    
-    echo "+++++ Updating $LANG"
-
-    silent_pushd "$SOURCE/Contents"
+	#first parameter to update_language is the language
+	LANG=$1.lproj
+	DEST_LANG=$LANG
+	
+	echo "+++++ Updating $LANG"
+	
+	silent_pushd "$SOURCE/Contents"
 	
 	silent_pushd "Resources"
 		# Main resources
-		silent_pushd $LANG
-			loc_copy "$REPO/Resources/$DEST_LANG"
-			# Move the Twitter account view
-			rm -rf "$REPO/Plugins/Twitter Plugin/Resources/$DEST_LANG/AITwitterAccountView.nib"
-			mv "$REPO/Resources/$DEST_LANG/AITwitterAccountView.nib" "$REPO/Plugins/Twitter Plugin/Resources/$DEST_LANG"
-			# Move the WebKit preferences
-			rm -rf "$REPO/Plugins/WebKit Message View/Resources/$DEST_LANG/WebKitPreferencesView.nib"
-			mv "$REPO/Resources/$DEST_LANG/WebKitPreferencesView.nib" "$REPO/Plugins/WebKit Message View/Resources/$DEST_LANG"
-		silent_popd
-    
+		if [ -e "$LANG" ] ; then
+			silent_pushd $LANG
+				loc_copy "$REPO/Resources/$DEST_LANG"
+			silent_popd
+		fi
+		
 		# Emoticons
-       if [ -e  "Emoticons" ] ; then
+		if [ -e "Emoticons" ] ; then
 		echo "Emoticons"
-         silent_pushd Emoticons
+		silent_pushd Emoticons
 			silent_pushd Default.AdiumEmoticonset
-				if [ -e  "Resources/$LANG" ] ; then
-				    silent_pushd Resources/$LANG
-					cp InfoPlist.strings "$REPO/Resources/Emoticons/Default.AdiumEmoticonSet/Resources/$DEST_LANG"
-				    silent_popd
+				if [ -e "Resources/$LANG" ] ; then
+					silent_pushd Resources/$LANG
+						cp InfoPlist.strings "$REPO/Resources/Emoticons/Default.AdiumEmoticonSet/Resources/$DEST_LANG"
+					silent_popd
 				fi
 			silent_popd
-		  silent_popd
-	    else
-	      echo "No Emoticons found for $LANG"
-	    fi
-	
+		silent_popd
+		else
+			echo "No Emoticons found for $LANG"
+		fi
+		
 		# Scripts
-       if [ -e "Scripts" ] ; then
-		 echo "Scripts"
-		 silent_pushd Scripts
+		if [ -e "Scripts" ] ; then
+		echo "Scripts"
+		silent_pushd Scripts
 			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"
-				    silent_popd
+				if [ -e "Resources/$LANG" ] ; then
+					silent_pushd Resources/$LANG
+						cp InfoPlist.strings "$REPO/Resources/Scripts/System Statistics.AdiumScripts/Resources/$DEST_LANG"
+					silent_popd
 				fi
 			silent_popd
-		 silent_popd
-        else
-          echo "No Scripts found for $LANG"
-        fi
+		silent_popd
+		else
+			echo "No Scripts found for $LANG"
+		fi
 	silent_popd
-
+	
 	#back to Contents
-		
+	
 	silent_pushd Frameworks
 		echo "Adium Framework"
-		if [ -e  "Adium.framework/Versions/A/Resources/$LANG" ] ; then
+		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"
 			silent_popd
 		fi
 		
 		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"
-		  silent_popd
-        fi
-
+		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"
+			silent_popd
+		fi
+		
 		echo "AdiumLibpurple.framework"
-		if [ -e  "AdiumLibpurple.framework/Versions/A/Resources/$LANG" ] ; then
-		  silent_pushd AdiumLibpurple.framework/Versions/A/Resources/$LANG
+		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"
-		  silent_popd
+		silent_popd
 		fi
 	silent_popd
-    
+	
 	#back to Contents
-
- 	if [ -e  "Library/Spotlight" ] ; then
- 		silent_pushd Library/Spotlight
-			if [ -e  "AdiumSpotlightImporter.mdimporter/Contents/Resources/$LANG" ] ; then
+	
+	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"
 				silent_popd
@@ -131,35 +142,40 @@
 	fi
 }
 
-if [ "$2" = "all" ]  ; then
+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/'
+	exit 0
+fi
+if [ "$2" = "all" ] ; then
 # fr_CA not included
 
-    for lang in \
-        ca \
-        cs \
-        da \
-        de \
-        en_AU \
-        en_CA \
-        es \
-        fi \
-        fr \
-        is \
-        it \
-        ja \
-        nb \
-        nl \
-        pl \
-        pt_BR \
-        ru \
-        sk_SK \
-        sv \
-        tr \
-        zh_CN \
-        zh_TW \
-    ; do
-        update_language $lang
-    done
+	for lang in \
+		ca \
+		cs \
+		da \
+		de \
+		en_AU \
+		en_CA \
+		es \
+		fi \
+		fr \
+		is \
+		it \
+		ja \
+		nb \
+		nl \
+		pl \
+		pt_BR \
+		ru \
+		sk_SK \
+		sv \
+		tr \
+		zh_CN \
+		zh_TW \
+	; do
+		update_language $lang
+	done
 else
-    update_language $2
+	update_language $2
 fi




More information about the commits mailing list