0
votes

I find this tool genstrings, but it fails on line: NSLocalizedString(key,comment);

-(NSString*)toLocalizableString:(NSString*)key
               withComment:(NSString*)comment{
    NSString* stringResult = nil;
    if (key){
        stringResult = NSLocalizedString(key, comment);
    }
    NSLog(@"(*) key: <%@> (&) value: <%@> (*)",key,comment);
    return stringResult;
}

Also, steps of localization:

  1. Find all strings and wrap them with NSLocalizedStringFromTable
  2. Extract strings with genstrings
  3. Put localizable files and find translations
  4. well done!

I stuck at first step. How find all strings, that are needed to have translations?

Or i'm wrong?

Thanks for explanation!

2
Do you want to know how to localize strings ?Vineesh TP
do you read my question? i write steps of localization, really. but my trouble is to find all strings and wrap them with NSLocalized... I search for tool, that can automate some work for megaussblurinc

2 Answers

1
votes

I use Ltools to help with this. It's a two step process:

  1. Search for @" in your code, and wrap the appropriate strings in L()
  2. Run L.sh as part of your build process

This will make sure that every string that needs translating has a translation.

1
votes

This is not exactly what you are searching for, but for me it doesn't make sense to translate all strings, e.g. you likely do not want to translate strings (@"") from an NSPredicate.

If you moved all relevant strings to NSLocalizableString / NSLocalizableStringFromTable, then I can recommend Linguan. You just pass in your XCode project and you are ready to start translating.