App in different languages

Discussion in 'iOS Programming' started by iphonejudy, Jan 6, 2010.

  1. iphonejudy macrumors 6502

    iphonejudy

    Joined:
    Sep 12, 2008
    #1
    I created an app in english.I want all the users to work with my app.
    I want to convert it in a different languages(chinese,french etc..)

    Is it possible?if So how?
     
  2. robbieduncan Moderator emeritus

    robbieduncan

    Joined:
    Jul 24, 2002
    Location:
    London
    #2
    Yes, use the standard localization features provided by Cocoa Touch.

    As usual it's all covered in the documentation. Read it before asking questions...
     
  3. iphonejudy thread starter macrumors 6502

    iphonejudy

    Joined:
    Sep 12, 2008
  4. robbieduncan Moderator emeritus

    robbieduncan

    Joined:
    Jul 24, 2002
    Location:
    London
    #4
    If you want your application to display in French (or whatever) you need to read all of the document I linked to and then translate your app: changing the setting on the phone only tells the app which localization you'd like to use: it is still up to the developer to provide that localization. The phone won't translate between languages for you.
     
  5. pravara15 macrumors newbie

    Joined:
    May 14, 2009
    #5
    localization in iphone app.

    Hi,

    I want to distribute my application in different languages.
    i have gone through the localization document provided by apple.
    I am able to translate the app in all the languages i want, but for that i need to change the settings of iphone device. is there any way, by which, i can set the language culture on app load, specific to my application only.

    or, if by default my application is in English, now i want to set the language as french, without changing the device settings.

    Please help me ASAP.
     
  6. robbieduncan Moderator emeritus

    robbieduncan

    Joined:
    Jul 24, 2002
    Location:
    London
    #6
    As far as I know there is no way to tell the phone to run one app in a different language than the rest of the phone. The setting is all or nothing. If you upload the app to the device with only the localization you want to test then it would run in that language I would have thought.
     
  7. amorya macrumors 6502

    Joined:
    Jun 17, 2007
    #7
    There is, but it involves method swizzling on NSBundle to override preferredLocalizationsFromArray.

    You could also do it by any time you encounter a view controller, doing initWithNibName:bundle: and passing in the bundle you want to use. Keep track of the language preference yourself, and then write something to replace NSLocalizedString().

    If it's only for testing, it's so completely not worth the effort! Just change the language in prefs :)

    Amoryas
     

Share This Page