I found that I needed to think of a better way to localize my NIBs. I was looking to potentially create some new panes and didn’t want to have to go back through each language’s NIB file and hand tweak those. I Googled around and came across Will Shipley’s excellent article “Lost In Translations”
I will not repeat what he’s written there however I found that his instructions lacked one thing that I already had and needed an additional step for: I needed to grab any of the translations that I already had done and pull them out to a MainMenu.strings file. That was actually easy enough to do with ibtool however the files that are generated come out like
/* Class = "NSTextFieldCell"; title = "Aufgabe:"; ObjectID = "741"; */
"741.title" = "Aufgabe:";
As a reminder I needed to end up with a MainMenu.strings file (in each .lproj) that looked more like this:
"Task:" = "Aufgabe:";
So what I did was modify the mainMenuStringAdapater.m file so that it stores the ObjectID and key text from the English (in my case) MainMenu.strings file, then loads the language-to-be-translated’s-MainMenu.strings file Â (passed as parameters) and saves a resultant file out with the corrected MainMenu.Strings file for that language, without the objectIDs as keys.
You should definitely look over the resultant file and confirm that it did what it was supposed to. Additionally It should also dump out a file telling you how many lines were in each MainMenu.strings file and if there were any ObjectIDs in the foreign file that were not accounted for from the English file (and therefore need to be handled in the fixed version).
This was a quick and dirty job and I’m sure there are leaks and such, but I figured it might do someone else some good so I’m sticking it up here.