LanguageManager class

So I ended up writing my custom class called LanguageManager, which just holds all the strings that need to be translated and returns the strings.


[LanguageManager translate:@"Start"];

+ (NSString *)translate:(NSString *)aString {
Settings *gameSettings = [Settings getInstance];
if (gameSettings.languageSettings == 0) return aString; // if user setting is English
if (gameSettings.languageSettings == 1){ //if user setting is Japanese
if(aString == @"Start") return @"スタート";
if(aString == @"Continue") return @"コンティニュー";

I wonder if there's any better way...

No comments:

Post a Comment