Localizable.strings Not Working

    The iPhone offers good localization support the same way Mac OS X does. For strings, developers use a file called “Localizable.strings”. It’s a bit tricky, though. The syntax of the file is strict; any small error will cause it to stop working without warning. Unfortunately, the compiler (which doesn’t touch the file at all) can’t give any warnings or errors when a mistake is present in the file. So check your Localizable.strings closely.

    Another strange thing is that the file MUST be UTF-16 encoded. In many cases, Xcode by default creates the file with UTF-8 encoding. Change the encoding to UTF-16 in Xcode by using ‘View’ –> ‘Text’ –> ‘File Encoding’.

    Thanks to Cagan for the tip.

    A few more iPhone-related notes:

    • The default root password for SSH (OpenSSH) on my iPhone was “alpine”, not “dottie”. Maybe because I’m on 2.1. #
    • If you’re using .htaccess for password protection, it gives no warning if the specified .htpasswd file is missing. #

    Tags: , , , , ,

    1. Cortis Clark’s avatar

      If you are manually editing the localizable.strings files its easy to forget to add the semicolon add the end of the line. This happened to me, and because of my other build settings, the compiler didn’t warn me about it, but none of the localized strings worked. This might be a good tip to add to this page.

      Reply