简体   繁体   中英

Xcode 6 – OS X Localization not working

I'm trying to localize Main.storyboard , localization doesn't work.

I have files:

Main.storyboard |--Main.storyboard (Base) |--Main.strings (Russian) |--Main.strings (English)

In russian .strings file I wrote something like

/* Class = "NSButtonCell"; title = "rus-example"; ObjectID = "0XB-XT-cHW"; */
"0XB-XT-cHW.title" = "rus-example";

In Main.strings (English) (for the same button):

/* Class = "NSButtonCell"; title = "en-example"; ObjectID = "0XB-XT-cHW"; */
"0XB-XT-cHW.title" = "en-example";

When I run the app on English OS, I get the same result, when on Russian.

I turned on "Show non-localized strings" feature in Xcode, it shows all strings as non-localized.

How can I enable localization?

A little late, but maybe someone else will come across this post: I had the same problem for my german localisation. Running

plutil Main_iPhone.strings

did the trick for me. It showed up the following output:

Main_iPhone.strings: Unexpected character / at line 2

Even if this was a misleading error (the localisation file starts with a comment, that's ok), it pointed me in the right direction: there was something wrong with the localisation file itself.

Long story short: missing quotation mark or rather semicolon, but unfortunately you don't see this error within Xcode.

However, just run the plutil command on your localisation string files and check the output.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM