tags:

views:

273

answers:

1

Hi,

I am working on one multilanguage project which will download string from server depend on language selected by user. I would like to save this downloaded string into localizable.string file. So how could I do that? I know how genstrings works but I would like to generated *.strings file by code and save it. My code will read this *.strings file for localizable. Anybody know which api i have to use?

thanks in advance Manu

A: 

Typically, localization depends on strings files that are within the app bundle. Since you can not modify the app bundle at run time, you will have to put the strings files you downlaod elsewhere and you will have to modify the usual localization methods to find and use those strings files.

Look at Apple's iPhone samples to see how they do localization and fetching of the strings, and see if you can replace all the local accesses of the localization resources with resources in another directory.

mahboudz
So it mean that I cannot modified Localizable.string file at runtime but same thing achieve by writing new xyz.string file and reading as per requirement?
Manu
Yes, you can't modify anything in your app bundle. But you could make a new strings file in your Documents or Preferences directory and use that, with some modification of the localization code in your app.
mahboudz