5/14/2009

Localization research

I've figured out how to do localization for the game before, but I wanted it so users (or me) can switch the language on the fly instead of going to the iPhone Settings.
完璧にlocalizationをする方法をサーチ。iPhoneの設定でやるより自分のアプリ内でやりたいしね〜。ほぼ自分のため。iPhone自体は英語で使いたくて、ゲームは日本語でしたいのです。

Some helpful links:

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

http://www.bdunagan.com/2009/03/15/ibtool-localization-made-easy/

http://developer.apple.com/documentation/MacOSX/Conceptual/BPInternational/Articles/InternatAndLocaliz.html#//apple_ref/doc/uid/20000277


To get what language the user is using:
ユーザーが何語を使ってるか:


NSArray *languages = [[NSUserDefaults standardUserDefaults] objectForKey:@"AppleLanguages"];
NSString *currentLanguage = [languages objectAtIndex:0];
NSLog(@"Current Locale: %@", [[NSLocale currentLocale] localeIdentifier]);
NSLog(@"Current language: %@", currentLanguage);
NSLog(@"Welcome Text: %@", NSLocalizedString(@"TitleKey", @""));

No comments:

Post a Comment