开发者

iPhone language setting

开发者 https://www.devze.com 2022-12-13 09:49 出处:网络
I am junior in iPhone game development. I am using Cocos2D for this game I am currently building. I ha开发者_如何学JAVAve completed the game however my client wants to have 1 more version of this game

I am junior in iPhone game development. I am using Cocos2D for this game I am currently building. I ha开发者_如何学JAVAve completed the game however my client wants to have 1 more version of this game, all the functionality is the same except the language. He wants the game will be switched to the French version if the iPhone language is set to French. I just need to replace the buttons, the text inside the game with French. But I am not quite sure about the language setting in iPhone, how can I switch the whole thing into a different version accordingly to the language setting, anyone knows where i can start? Please give me a hand, I really appreciate any helps.

Thanks a lot


Here is my code. Could you should me how to localize to these codes

[MenuItemFont setFontSize:16];
    [MenuItemFont setFontName:@"Helvetica"];

    MenuItem *backToMenu = [MenuItemImage itemFromNormalImage:@"back_to_mainmenu.png" selectedImage:@"back_to_mainmenu_PUSH.png" target: self selector:@selector(backToMenuScene:)];

    MenuItem *playAgain = [MenuItemImage itemFromNormalImage:@"Eplay_again.png" selectedImage:@"Eplay_again_PUSH.png" target:self selector:@selector(playAgainGame:)];

    MenuItem *uploadOnFaceBook = [MenuItemImage itemFromNormalImage:@"Eupload_on_facebook.png" selectedImage:@"Eupload_on_facebook_PUSH.png" target:self  selector:@selector(uploadOnFaceBookFunction:)];

    Menu *menu = [Menu menuWithItems:backToMenu, playAgain, uploadOnFaceBook,nil];
    menu.position = CGPointZero;

    backToMenu.position = ccp (400,40);
    playAgain.position = ccp (240,40);
    uploadOnFaceBook.position = ccp (80,40);

    [self addChild:menu z:1];   


You have to localize your app with Localizable.strings file where you put all your string properties for each language. For more see: http://developer.apple.com/iPhone/library/documentation/MacOSX/Conceptual/BPInternational/Articles/LocalizingInterfaces.html

0

精彩评论

暂无评论...
验证码 换一张
取 消