Better version of genstrings

Discussion in 'Mac Programming' started by Eraserhead, Nov 8, 2009.

  1. macrumors G4

    Eraserhead

    Joined:
    Nov 3, 2005
    Location:
    UK
    #1
    Hey guys

    Is there a better version of genstrings that allows you to use the first value of NSLocalizedString only as a key and the second as the value?

    Otherwise I think it'll be easier to write a new tool than to change what I've already written in my project :p.

    Thanks
     
  2. macrumors 603

    Joined:
    Aug 9, 2009
  3. thread starter macrumors G4

    Eraserhead

    Joined:
    Nov 3, 2005
    Location:
    UK
    #3
    So I put my money where my mouth is and coded this solution - and you can download my hard work from Sourceforge at http://www.sourceforge.net/projects/cocoalocalizer/.


    (source)
     
  4. Moderator emeritus

    kainjow

    Joined:
    Jun 15, 2000
    #4
    You should make it a command-line tool, because that is often how genstrings is used and that's how we use it in a large project, where it takes several seconds (10-15) to process all our code (we only run it on Release atm). I don't think genstrings uses any sort of multi-threading, so that could be something to consider for yours as well (easy with NSOperation).

    BTW the download from SF contained a folder with a .app extension, but it was only a normal folder, so it wouldn't open properly.
     
  5. thread starter macrumors G4

    Eraserhead

    Joined:
    Nov 3, 2005
    Location:
    UK
    #5
    Fixed.

    On D&D Manager genstrings takes 7.06 seconds (according to the Unix command time), whereas my code only takes 0.08 seconds (according to the creation of a date at the start/end of my method) which is a huge improvement - I haven't used any threading so far but I'm not sure its needed.

    Doing it as a command line application sounds like a good idea - I'll take a look at doing that.
     
  6. macrumors newbie

    Joined:
    Dec 23, 2011
    #6

Share This Page