0

アプリケーション言語と NSLocalizeStrings を接続する方法を誰かが知っているのではないかと思います。たとえば、私のアプリは fr、ru、ro にありますが、ユーザー デバイスは en にあり、ユーザーがアプリをオンにすると en になりますが、アプリの設定にはroまたはfr。NSLocalizedString でアプリの言語を渡すにはどうすればよいですか。ありがとう。

UIAlertView *finishQuiz = [[UIAlertView alloc] initWithTitle:NSLocalizedString(@"Finished Quiz",@"Quiz finished")
                                                     message:NSLocalizedString(@"You answered to all quiestions. If you win you will be informed by e-mail" ,@"Information")
                                                    delegate:self 
                                           cancelButtonTitle:NSLocalizedString(@"Le menu principale",@"MainMenu")
                                           otherButtonTitles:nil, nil];
4

1 に答える 1

1

あなたはそうしない。Localizable.stringsアプリケーションは、システム言語に従って適切なローカライズの下で を探します。ユーザーがフランス語をシステム言語として設定している場合、アプリケーションはを使用しfr.lproj\Localizable.stringsたときにその文字列をロードしますNSLocalizedString(...)

したがってNSLocalizedString(@"SomeTest", @"This is a test description");、この行を次からロードしますfr.lproj\Localizable.string

// Localizable.string (Francais)
"SomeTest" = "Un test";

詳細については、Localizing String Resourcesを参照してください。

于 2012-05-04T14:11:33.010 に答える