0

I have an application in the App Store with the string files localized. The thing is I want to submit an update with the string files only in english,but when I install the app from xcode(only with the string files in english) in a device that has already the application installed(from the App Store) I can see the strings in other languages than english.

If I install the app in a device without the application already installed I can only see the strings in english,regardless the selected language on the device.

I know one option is to change the name of the string files,but I was wondering if there is a smarter way of doing this.

Thanks a lot

e1985
  • 6,239
  • 1
  • 24
  • 39
  • Why not delete the old app from the old device and reinstall? Changes to Bundle resources are sometimes not refreshed between builds. – CodaFi Oct 12 '12 at 15:49
  • Because I don't want my users to delete the app before installing the new version...Thanks for the comment anyway. – e1985 Oct 12 '12 at 16:30
  • A (somewhat silly) workaround would be to always set the language to English when your app starts. Read this http://stackoverflow.com/questions/1669645/how-to-force-nslocalizedstring-to-use-a-specific-language/5850101#5850101 or similar questions. – FD_ Oct 12 '12 at 16:41

2 Answers2

0

The problem is likely that your old localised.strings file is still hanging around in a different location. When you add or change languages using localisation, the strings file may be moved to a different folder. When the delta update occurs it obtains the new strings file, but fails to delete the old one because it's in a different location. However that location is higher up the search tree, and so gets found first when the app looks for a string.

One potential solution, though not a nice one, is to rename your localized.strings file to something different, then use the localizedStringFromTable command in all places you previously used localizedString, naming your new file as the table of origin. It's not a pretty fix, but it should work.

Another potential solution if you only need one language is to ensure that the strings file is stored in exactly the same bundle location as the one in the previous version.

Ash
  • 9,064
  • 3
  • 48
  • 59
0

I solved the problem with this line in the file main.m, right before calling to UIApplicationMain():

[[NSUserDefaults standardUserDefaults] setObject:[NSArray arrayWithObject:@"en"] forKey:@"AppleLanguages"];

Basically it forces the app to be available in English only.

e1985
  • 6,239
  • 1
  • 24
  • 39