Posted By

neoline on 11/17/11


Tagged

c iphone objective


Versions (?)

Who likes this?

2 people have marked this snippet as a favorite

Tintenklecks
cnathan


Localized Language Tutorial


 / Published in: Objective C
 

URL: http://www.iphonesdkarticles.com/2008/11/localizing-iphone-apps.html

How to add multiple Language localization to an App.

  1. - (void)applicationDidFinishLaunching:(UIApplication *)application {
  2.  
  3. NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
  4. NSArray *languages = [defaults objectForKey:@"AppleLanguages"];
  5. NSString *currentLanguage = [languages objectAtIndex:0];
  6.  
  7. NSLog(@"Current Locale: %@", [[NSLocale currentLocale] localeIdentifier]);
  8. NSLog(@"Current language: %@", currentLanguage);
  9. NSLog(@"Welcome Text: %@", NSLocalizedString(@"WelcomeKey", @""));
  10.  
  11. // Override point for customization after application launch
  12. [window makeKeyAndVisible];
  13. }

Report this snippet  

You need to login to post a comment.