0

I want to extract all the Strings from my codebase and put in an excel sheet. What is the best way to do that? And how can I do that?

To add on it. I am able to search all the strings in my project using the following expression:

@"(any)"

where (any) is the pattern available in Xcode search. I am able to search all the strings. I want to extract all those and put it in a list/excel sheet. How should I do that?

===EDIT===

2nd Part of my question. I have a string @"abc", How can I replace it to NSLocalizedString(@"abc", @"abc", nil) using Find/Replace in Xcode?

g.revolution
  • 11,962
  • 23
  • 81
  • 107
  • are you going to want to re-import those strings into your project (i.e. translation or localization)? – Michael Dautermann Aug 18 '13 at 05:26
  • actually yes, I have to give all these strings to client so that he can translate these strings and 2nd part is I have convert all these strings to NSLocalizedString(@"xxx", @"xxx"). If there is a way I can convert @"abc" to NSLocalizedString(@"abc", @"abc", nil), then i can use genstrings to extract the strings, so I need either solution. – g.revolution Aug 18 '13 at 05:29
  • i googled it and saw people using \1 \2 for the placeholders. but it is now working in my case, maybe I am doing something wrong. – g.revolution Aug 18 '13 at 05:30
  • it is "now" working? or ***not*** working? Also, [see this related question](http://stackoverflow.com/questions/12395449/how-to-use-get-all-nslocalization-using-genstrings-while-preserved-current-trans?rq=1). – Michael Dautermann Aug 18 '13 at 05:33
  • I figured it out. I had selected wrong Find option, I was searching text, I changed it to Regular Expression and @"(.*)" expression worked. and I replaced it with NSLocalizedString(@"\1", @"\1", nil) – g.revolution Aug 18 '13 at 05:39

1 Answers1

2

I figured it out. I had selected wrong Find option, I was searching text, I changed it to Regular Expression and @"(.*)" expression worked. and I replaced it with NSLocalizedString(@"\1", @"\1", nil)

g.revolution
  • 11,962
  • 23
  • 81
  • 107