XCode 5/iOS 7 - localization not working in simulator

独自空忆成欢 提交于 2019-11-27 21:53:10

Maybe you have run the app at some time where the file Localizable.strings already existed but has not been localized yet. If this is the case, this unlocalized file still resides in the resources folder in the application bundle in the simulator (when you build an run a new version of your app in the simulator or in the device, unused files will not be deleted). This can lead to problems.

Try to delete the app completely from the simulator and build an run again.

Rajal

If you are using xcode 6.1.1 and iOS sdk 8.1,try this workaround.

It seems localization does not work with xCode 6.1 and 8.1 simulator. Workaround: Go to "edit schemes" >> "Run" (side bar) >> "Options" tab >> "Application Language" Select the language you wish to run the app on the simulator. I got this workaround from Workaround by natanavra Thanks to him.

However I read on developer forum,that it is working in 6.2 beta version of Xcode. Hope it do.

I have experienced similar issues (IB localization in my case) on device. So general answer would be

Device - Uninstall app and clean project by Shift+CMD+K

Simulator - Go iOS simulator > Reset Content and Settings and clean project by Shift+CMD+K

These problems are really annoying. Along with poor ability to update localized strings is localization one of the biggest drawback of iOS development.

Another problem that could cause localization not work is the encoding of the strings file. Localizable.strings's encoding must be UTF-16. The default encoding of text file in xcode is UTF-8, that cause me spending a whole day to check why the localization not work.

Mehul Thakkar

In Xcode 6.0 and later, Localization not work by changing language in Simulator not working.

You have to edit scheme before running your application.

Go to Edit Scheme -> Run -> Options, change language here.

Now, Run Your Application. It will Work.

For more details, check this answer : Changing language on iOS 8.1 simulator does not work

My problem for this was an incorrectly encoded character in the localization file.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!