views:

32

answers:

1

So, Now the time has come to go back over an old iPhone project to localise it and I am confronted by ploughing through an entire project looking for user facing strings. Is there any crafty way of doing this short of searching for @" and checking every instance?

Looking at the Apple localization documentation there does seem to be mention of running a cocoa application from the command line with NSShowNonLocalizedStrings set but I'm not sure if that is applicable to the iPhone. Also it would seem that all this option actually does is print the strings to the console as you come across them in the app, so that means exercising every scenario the app could encounter including error conditions etc. Not ideal.

A: 

Change your Localizable.strings file so that every entry looks like this:

/* Please Login */
"Please Login" = "XXXXX";
/* Error */
"Error" = "XXXXX";

Now use the application and look for any string which is still readable. They're the ones you still need to localize.

nevan
I'm still at the stage where the Localizable.strings file is empty and I am going through the project source code to find user facing strings and replace them with the NSLocalizedString macro. The thing is when you search for @" to find strings you get thousands of results for all strings even NSDictionary keys etc which are obviously no user facing. I was just wondering if there is any tool or strategy for weeding these out.I guess I'll be checking all the strings one by one...
tomj
There's a tool called genstrings, but I think you have to have been using `NSLocalizedString` from the start for it to work. I'd compose a good search to not include `NSDictionary` (and other) stuff, then just work through the strings. It's a good lesson to use `NSLocalizedString` in the future. You might also check some of the applications mentioned here: http://cocoadev.com/index.pl?LocalizationTips
nevan
Thanks for the tips. The Locacalization Suite looks like the missing tool I need to keep all the lang files in sync. Without it the workflow is horrible.
tomj