Permalink
Browse files

localization.md sync with GRMustacheLocalization/GRAppDelegate.m

  • Loading branch information...
1 parent e9db8c1 commit f394042066ec899cb88f681ab08b66809dd9ed8c @groue committed Aug 20, 2012
Showing with 18 additions and 5 deletions.
  1. +18 −5 Guides/sample_code/localization.md
@@ -224,19 +224,32 @@ Now the convenient `[GRMustacheHelper helperWithBlock:]` method is not enough. L
* [NSString stringWithFormat:] unfortunately does not accept an array of
* formatArguments to fill the format. Let's support up to 3 arguments:
*/
-
+
NSString *rendering = nil;
switch (self.formatArguments.count) {
case 0:
rendering = localizedFormat;
break;
-
+
case 1:
- rendering = [NSString stringWithFormat:localizedFormat, [self.formatArguments objectAtIndex:0]];
+ rendering = [NSString stringWithFormat:
+ localizedFormat,
+ [self.formatArguments objectAtIndex:0]];
break;
-
+
case 2:
- rendering = [NSString stringWithFormat:localizedFormat, [self.formatArguments objectAtIndex:0], [self.formatArguments objectAtIndex:1]];
+ rendering = [NSString stringWithFormat:
+ localizedFormat,
+ [self.formatArguments objectAtIndex:0],
+ [self.formatArguments objectAtIndex:1]];
+ break;
+
+ case 3:
+ rendering = [NSString stringWithFormat:
+ localizedFormat,
+ [self.formatArguments objectAtIndex:0],
+ [self.formatArguments objectAtIndex:1],
+ [self.formatArguments objectAtIndex:2]];
break;
}

0 comments on commit f394042

Please sign in to comment.