Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!

10.4: Thin out Universal apps and non-English languages Apps
I've written a quick Automator (I love Automator) workflow that uses an embedded bash script to clean up the crud on my hard disk, focusing on Universal applications.

This Automator workflow does two things:
  • Removes the PowerPC code from Universal binary applications.
  • Removes all non-Enlgish language files.
To remove the Universal binary, the workflow makes a duplicate of the program in question, stripping the PowerPC code and renaming the program with _Intel at the end. Once the workflow is done, you can then make sure the modified application works as expected before deleting the original. But please, read the Read Me before proceeding with the workflow!

Here's the program (792KB) [macosxhints mirror]. The basic code used in the workflow is this:
$ /usr/bin/ditto --rsrc --arch i386 "$SFnameO" "$SFnameI"
$ find "$SFnameI" -depth -name "*.lproj" -not -name \
  "English.lproj" -print -exec rm -rf '{}' ;
[robg adds: I tested this, and it works as described -- and the results can be dramatic. GarageBand, for instance, shrinks from 100MB to 32MB, and seems to work just fine. But if you are going to use this (or any other such space-saving application), please make sure you have a good backup. As noted in the author's Read Me, you may find some apps that break in some way when modified in this manner, and that might not happen until after you've decided all is fine and trashed the original.

For a normal desktop machine, with large and easily expanded hard drive space, I'm not sure programs such as this are worth the (minor) risk. But on a laptop, where every MB counts, it can make a big difference. On my MacBook, I ran it on only GarageBand, iDVD, iMovie, iPhoto, iTunes, and iWeb, and freed up 482MB of drive space. Note that there are other apps that do this, and we've covered similar scripts here in the past.]
    •    
  • Currently 1.00 / 5
  • 1
  • 2
  • 3
  • 4
  • 5
  (3 votes cast)
 
[28,175 views]  

10.4: Thin out Universal apps and non-English languages | 15 comments | Create New Account
Click here to return to the '10.4: Thin out Universal apps and non-English languages' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
10.4: Thin out Universal apps and non-English languages
Authored by: mindsnare1349 on Jun 13, '06 09:00:00AM

does it really only touch UB? what about PPC-apps, are they touched in any way?



[ Reply to This | # ]
10.4: Thin out Universal apps and non-English languages
Authored by: demmons65 on Jun 13, '06 09:02:11AM

While I applaud the ingenuity of being able to remove unused Intel (or PPC) code from an application, I have chosen to leave my apps as they are.

Why?

Well, I have a number of Macs in my household. Some PPC, some Intel. And being able to move an app across the network from one machine to the other while not thinking "What architecture is this app built for?" is worth more than the drive space savings I might realize.

---
d a v e

http://www.hostwerks.com/~dave/



[ Reply to This | # ]
10.4: Thin out Universal apps and non-English languages
Authored by: jcbeckman on Jun 13, '06 09:19:37AM

Another warning - even if the app runs OK, you may be in trouble in the future. I stripped languages other than English out of all my apps at one point. Months later, fixes for some of the Adobe Creative Suite 2 programs came out - and wouldn't install, because they got bad checksums from the stripped apps. I couldn't reinstall, because the installer kept seeing some remnant of the original install (I tried to follow the "manual uninstall" but I must have missed something, because the Installer insisted the programs still existed). I had to install CS 2 on another machine and copy all the files over to my main system before I could run the updaters.



[ Reply to This | # ]
10.4: Thin out Universal apps and non-English languages
Authored by: greenergrad on Jun 13, '06 09:21:43AM

What happens when Apple releases a software update for apps that have been modified with this workflow? As much as I'd like to reclaim some of my drive space, I do enjoy the automated updates.

---
--
greenergrad



[ Reply to This | # ]
10.4: Thin out Universal apps and non-English languages
Authored by: pub3abn on Jun 13, '06 09:31:26AM

How about changing that second bullet point to say "non-English language files"? The spelling there is itself presently "non-English".



[ Reply to This | # ]
10.4: Thin out Universal apps and non-English languages
Authored by: fracai on Jun 13, '06 10:03:58AM

find "$SFnameI" -depth -name "*.lproj" -not -name \
"English.lproj" -print -exec rm -rf '{}' ;

should really be:

find "$SFnameI" -depth -name "*.lproj" -not -iname \
"en*.lproj" -print -exec rm -rf '{}' ;

English localizations can be named English.lproj or en.lproj and you don't want to remove the en.lproj if that's what is used, which the first command will.

---
i am jack's amusing sig file



[ Reply to This | # ]
10.4: Thin out Universal apps and non-English languages
Authored by: gidds on Jun 13, '06 03:08:55PM

Not just that. As well as English.lproj and en.lproj, I also have one called en_GB.lproj. (I'm British, you see.) Some apps may have en_AU, en_CA, en_IE, en_NZ, and/or en_US for other areas.

When I wrote a script to get rid of all unneeded language files, I ended up keeping any .lproj file that started with 'En' or 'en'.

---
Andy/



[ Reply to This | # ]
10.4: Thin out Universal apps and non-English languages
Authored by: fracai on Jun 14, '06 09:25:18AM

good point. I haven't seen one labeled en_GB, etc before.

the en*.lproj should handle this as it matches anything that starts with en (regardless of case).

---
i am jack's amusing sig file



[ Reply to This | # ]
10.4: Thin out Universal apps and non-English languages
Authored by: itistoday on Jun 13, '06 10:57:39AM

If you've a PPC processor just rename "--arch i386" to "--arch ppc"



[ Reply to This | # ]
10.4: Thin out Universal apps and non-English languages
Authored by: fitzage on Jun 13, '06 11:10:25AM

That was a lot of work for only saving less than 2 GB (and I had about 250 applications).

Part of what I saved was just deleting some old apps as I went through.



[ Reply to This | # ]
10.4: Thin out Universal apps and non-English languages
Authored by: codingismy11to7 on Jun 13, '06 11:34:34AM
I've been using Monolingual to do this for some time. It's free & open source.

http://monolingual.sf.net

[ Reply to This | # ]
10.4: Thin out Universal apps and non-English languages
Authored by: scmckenzie on Jun 13, '06 01:35:20PM

Thanks for the comments, all of them. I'd like to respond to some of the comments.

Regarding PPC apps. It will copy them and remove the language files, they still run, ditto will just ditto them sans arch messing.

Apps on multiple computers; I was running out of space on my laptop, I'm not running this on my G5. I agree, and don't see the point of doing this on a server.

Adobe CS2 & Software Updates; When is Adobe not a headache!? As far as software updates go I haven't had a problem so far. The updates are applied and everything is back to normal and fat again. I have to run the script again over the replaced files. Things like Aspyr updates, that's another story.

en*; Thanks for that, consistency is too much to ask for I guess.

Monolingual; It lets you do some major damage :) I like it! I don't know, there's got to be a compromise between the total safety of my stupid script and the total mayhem of Monolingual.



[ Reply to This | # ]
Adobe problems with missing files
Authored by: tshehan on Jun 13, '06 02:44:26PM

I have used Youpi optimizer over time to get rid of other languages. Recently I downloaded the newest version and when it 'went to work' a window came up warning me that Adobe Reader wouldn't work properly if I deleted its language files (I was leaving English only).



[ Reply to This | # ]
Breaks World of Warcraft
Authored by: Beorn on Jun 14, '06 09:02:43AM

I just saw a forum thread on the World of Warcraft website, and apparently changing the WoW application with this hint will break the program and prevent you from being able to login. Just an FYI.

---
~ Beorn



[ Reply to This | # ]
Great way to get to know Console.app
Authored by: seveniam on Jun 14, '06 03:25:31PM

(Monolingual's) architecture removal breaks Macs. If you don't mind watching Console.app to see what's causing applications to crash on startup, then using Pacifist to reinstall random system files until the applications actually start up again, feel free to use these space-saving techniques. This has been part of my daily routine since running Monolingual to save a gig or two of space on my MacBook Pro.



[ Reply to This | # ]