title: How does localizedStringWithFormat work?
body: <p><strong>Please note</strong></p>
  
  <p>I am not asking about <code>NSLocalizedString()</code> the macro. I am asking about the <code>NSString</code> class function <code>+ (instancetype)localizedStringWithFormat:(NSString *)format, ...</code>.</p>
  
  <p>These are two separate things.</p>
  
  <p><strong>Question</strong></p>
  
  <p>I'm trying to use the <code>NSString</code> class method <code>localizedStringWithFormat</code> but I just can't work out how I'm supposed to use it.</p>
  
  <p>Whatever I try I don't seem to get the words to appear in the translation file using Xcode 6 <code>export for localization</code>. I've tried the top two variations here but nothing.</p>
  
  <p>The example in the docs shows...</p>
  
  <pre><code>NSString *myString = [NSString localizedStringWithFormat:@"%@:  %f", @"Cost", 1234.56];
  </code></pre>
  
  <p>Does this mean I have to separate the translated words from the numbers? i.e. could I not just use...</p>
  
  <pre><code>NSString *myString = [NSString localizedStringWithFormat:@"Cost:  %f", 1234.56];
  </code></pre>
  
  <p>If I can use this then what would the translated phrase be and what would the translation be?</p>
  
  <p>If not then why use this at all? Why not just use...</p>
  
  <pre><code>NSString *myString = [NSString stringWithFormat:@"%@:  %f", NSLocalizedString(@"Cost"), 1234.56];
  </code></pre>
  
  <p>What is the difference with this last one?</p>
  
  <p>Either way, can someone show me how to get the actual words translated in this please.</p>
  
  <p><strong>Update</strong></p>
  
  <p>OK, at the moment I'm using a stupid work around that just seems to be misusing everything lol.</p>
  
  <p>If I do...</p>
  
  <pre><code>NSString *myString = [NSString stringWithFormat:@"%@:  %f", NSLocalizedString(@"Cost"), 1234.56];
  </code></pre>
  
  <p>Then it translated the word "Cost" but doesn't use the correct locale for the numbers.</p>
  
  <p>If I use...</p>
  
  <pre><code>NSString *myString = [NSString localizedStringWithFormat:@"%@:  %f", @"Cost", 1234.56];
  // or
  NSString *myString = [NSString localizedStringWithFormat:@"Cost:  %f", 1234.56];
  </code></pre>
  
  <p>Then Xcode "Export for localization" just ignores it completely and nothing about "Cost" is added to the translation file at all so nothing gets translated.</p>
  
  <p>So, I've resorted to using...</p>
  
  <pre><code>[NSString localizedStringWithFormat:@"%@:  %f", NSLocalizedString(@"Cost", @"Cost context stuff..."), 1234.56];
  </code></pre>
  
  <p>This adds "Cost" to the translation file and converts the number to the correct locale but seems like I'm using a lot of redundant stuff here.</p>