1

I want to be able to update localized strings file at runtime, but is not possible.

I thought about this: My app uses web service. So I could have a web service that returns a .strings file and the file would be saved on the apps directory.

Now the problem: How can I change the NSLocalizedString to read from my file? Is it possible?

The app is not for apple store, so is not a problem if apple does not approve changing the app language.

Community
  • 1
  • 1
António
  • 975
  • 1
  • 12
  • 31

1 Answers1

3

You can download the data into a bundle in your sandbox and use NSLocalizedStringFromTableInBundle() to get the proper localisation using the built in system.

hypercrypt
  • 15,389
  • 6
  • 48
  • 59
  • How would you write to the bundle? It is not writeable after your app has been deployed. Or did I miss something? – Björn Kaiser Mar 06 '13 at 14:14
  • You seem to be right according to this question http://stackoverflow.com/questions/12358044/can-i-load-a-localizable-strings-file-into-an-ios-app-over-the-air. Haven't tried it but it makes sense. – Björn Kaiser Mar 06 '13 at 14:16
  • A bundle is just a folder really. You would specify the bundle in your sandbox, not the `.app` bundle (main bundle). – hypercrypt Mar 06 '13 at 14:19