Localization of Mac Applications

Discussion in 'Mac Programming' started by satyam90, Dec 11, 2007.

  1. macrumors regular

    satyam90

    Joined:
    Jul 30, 2007
    Location:
    Bangalore, India
    #1
    Hi,

    I have created a application for storage and backup. I used English as native language and developed it. Now I want to make my application Internationalize by adding localization to my application. Everything is fine. But I am able to create localization only in 3 other languages apart from English. The other 3 languages are Japanese, French and German.

    Procedure I am following is :
    1. Select the "nib" and open the of the project (File->GetInfo)
    2. Select "General" tab, and click "Add Localization" button on the bottom left.
    3. Select the language from the list and click Add.

    That's it.

    I want to know How to add other languages like Spanish, Italian etc languages for localizing my application.

    Regards,
    Satya.
     
  2. Moderator emeritus

    kainjow

    Joined:
    Jun 15, 2000
    #2
    If you don't see the language you want, you can just type it in directly I believe.
     
  3. thread starter macrumors regular

    satyam90

    Joined:
    Jul 30, 2007
    Location:
    Bangalore, India
    #3
    What about some language names in Chinese, Japanese or Korean (i don't know exactly what language it is).......I observed the names of different languages in preferences of mac.
     
  4. macrumors 6502

    Joined:
    Sep 19, 2002
    Location:
    Auburn, AL
    #4
    You can use the language codes to identiify localisations:

    es = General Spanish
    es_ES = Castilian Spanish
    es_MX = Mexican Spanish
    en = General English
    en_US = American English
    en_UK = British English
    zh_CN = Simplified (China) Chinese
    zh_TW = Traditional (Taiwan) Chinese

    You can google the hundreds of other codes.
     
  5. thread starter macrumors regular

    satyam90

    Joined:
    Jul 30, 2007
    Location:
    Bangalore, India
    #5
    As said in previous comment, I am using the language codes and localized my application. For testing purpose I changed my Mac books language to French. In my project I have a directory "fr.lproj" which is related to French language.
    I am running my application from Terminal/Console.
    I observed the following error:

    CFPropertyListCreateFromXMLData(): plist parse failed; the data is not proper UTF-8. The file name for this data could be: /Users/johnny/Library/Preferences/com.rogueamoeba.audio_hijack_server.hermes.plist
    The parser will retry as in 10.2, but the problem should be corrected in the plist.


    After few seconds one more error message displayed.

    CFPropertyListCreateFromXMLData(): plist parse failed; the data is not proper UTF-8. The file name for this data could be:
    /Users/johnny/satyam/freshcode/exe/Applications/iFolder 3.app/Contents/Resources/fr.lproj/iFolderWindow.nib/keyedobjects.nib
    The parser will retry as in 10.2, but the problem should be corrected in the plist.



    I am not understanding what I have to change in plist file?
     
  6. thread starter macrumors regular

    satyam90

    Joined:
    Jul 30, 2007
    Location:
    Bangalore, India
    #6
    I found out the error.
    All the localization files generated must be in UTF-8 format, where are my files are in some other format.

    In Windows simple chinese is denoted as zh-CN, but on Mac it is zh_CN, why there is a change in language codes between windows and Mac.
     
  7. Moderator emeritus

    kainjow

    Joined:
    Jun 15, 2000
    #7
    Strings files should be in UTF-16 actually. See Strings Files.
     
  8. thread starter macrumors regular

    satyam90

    Joined:
    Jul 30, 2007
    Location:
    Bangalore, India
    #8
    They didn't mention the OSX version where I have to use UTF-16
    Do I have to use UTF-16 irrespective of Mac OSX version ie whether it is Tiger or Leapord.
     
  9. Moderator emeritus

    kainjow

    Joined:
    Jun 15, 2000
    #9
    It's a good idea to because the link above says "Strings files encoded using UTF-8 are not guaranteed to work. When in doubt, encode the file using UTF-16."
     
  10. macrumors 68040

    lee1210

    Joined:
    Jan 10, 2005
    Location:
    Dallas, TX
    #10
    The last update on the page kainjow linked was last updated 2005-09-08. As such, it certainly applies to tiger. It also seems that there is a difference here between "have to" and "should". You should use UTF-16, as the document states that UTF-8 is not guaranteed to work. That doesn't mean it's guaranteed not to, but it would be wise to heed the advice in the document and use UTF-16.

    -Lee
     
  11. macrumors 68040

    plinden

    Joined:
    Apr 8, 2004
    #11
    The format zh_CN is the POSIX standard used in *nix - Windows is the one out.
     
  12. thread starter macrumors regular

    satyam90

    Joined:
    Jul 30, 2007
    Location:
    Bangalore, India
    #12
    Thanks for your updates so that I can change my file format.
    How on Mac, How can I change the file format? Which Application I can use to save the files in UTF-16 format?

    Also, on 10.4.11 NSLocale's localIdentifier for simple chines is returning zh_Hans and Taiwan chinese it is zh_Hant
    What are these language codes irrespective of zh_CN and zh_TW?
     
  13. macrumors member

    Joined:
    Jan 31, 2005
    Location:
    Sweden
    #13
    XCode can save files in UTF-16 (use View->Text->File encoding).
     

Share This Page