开发者

Localization does not work in one nib

开发者 https://www.devze.com 2023-04-06 20:41 出处:网络
I have simple app with some nib files. Some of them (with TabBarController or NavigationController) are localized with Xcode. Strings and almost every nib works like a charm when try to change languag

I have simple app with some nib files. Some of them (with TabBarController or NavigationController) are localized with Xcode. Strings and almost every nib works like a charm when try to change language. But there is one nib which do not accept my localized version of itself. I done the localization the same way as the rest. Even try to clean the project and recompile it. But still when launching the app in specific language, everything is translated except this one nib. It's unfortunately the first screen seen by user. When app st开发者_C百科arts it runs this nib as a modal controller and show it on the top of the main TabBarController.

There are 4 custom (custom set in Xcode not by code) buttons in the nib file and in viewDidLoad I only change the font to custom one (I've tried to remove this one also but did not help).

Any ideas what I'm doing wrong? Thx


I've found that after newly localizing a file that wasn't previously localized, in addition to cleaning and rebuilding, I have to delete the app from the simulator or device and do a clean install. This is only for XCode-deployed builds; installing from an ipa doesn't require a clean install.


Are you sure the file has been marked as localized in the language you are missing? Is this file located in the .proj folder?

If both seem to be correct, change something on the xib of this file (eg moving a Btn or so) and recompile then check if you can really see the Btn in the new position. If not, XCode still points to an old version of this file somewhere and does not use the file you think - that happens regularly when renaming files in Xcode.

You have to manually get the file back into Xcode - often deleting the file and then drag it back in helps (but not always). Make sure you have a backup of the project before you do any of this - who knows where Xcode is pointing to....

So far I did not find a singe way to correct this - but once you know which file is the problem, playing around with drag and delete etc will always work.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号