Search code examples
cocoaxcode4

XCode 4, Adding localization


I have just moved to xcode4 and boy am i confused! :)

For one, in the screenshot, you could see the localizable strings, a couple of the file names changed to "null", i am wondering why and if it would effect the final product?

And also, i could'nt figure out for the life of me, how do i add another localization. Previously in xcode3.x i had to right click on "Localizable Strings" and add a language, where do i do it now? enter image description here

Update: I have found where to add locations, but again, previously i was able to type a language the way i wanted, for instance, i want to add spanish, i could do that by just adding a language with name spanish, but now i am forced to choose from a predefined list of languages. And also, the ((null)) bugs me


Solution

  • The languages will be read from NSGlobalDomain's AppleLanguages. Try to add your own identifier to that list.

    % defaults read NSGlobalDomain AppleLanguages
    ("en_GB", en, fr, de, ...)
    % defaults write NSGlobalDomain AppleLanguages "(HongKong, "en_GB", en, fr, de, ...)"
    % defaults read NSGlobalDomain AppleLanguages
    (HongKong, "en_GB", en, fr, de, ...)