3

I have looked around at various answers here but can't figure out what's going on.

My iPhone is in French. I have just one target. I went on the project settings and said "Add Localization" and added French.

I made sure to

  • clean/rebuild my app several times
  • check that build log shows up the files copy
  • remove app from my phone
  • run both on phone (8.1) and on the simulator with French
  • check that checkboxes are ticked on target/project settings

End result : Storyboard is localized but programmable strings are not (the NSLocalizedString("xxx", nil) shows xxx instead of yyy)

Any idea ? Here are some screenshots of my configuration

build log project files fr/localized.strings file settings

Thanks

Thomas
  • 8,306
  • 8
  • 53
  • 92

1 Answers1

2

Found the reason you're having this problem here:

Note: Localizable.strings is the default filename iOS uses for localized text. Resist the urge to name the file something else, otherwise you will have to type the name of your .strings file every time you reference a localized string.

If you want to use a different .strings file for localization, you need to use the method:

- (NSString *)localizedStringForKey:(NSString *)key
                              value:(NSString *)value
                              table:(NSString *)tableName

and specify Localized.strings as the third (tableName) parameter.

Lord Zsolt
  • 6,492
  • 9
  • 46
  • 76
  • you are the best ! seriously I don't remember where Localized.strings came from. I think Xcode added it but maybe I had this file before in my project... any way thanks – Thomas Feb 11 '15 at 13:53
  • No problem. I've never used this feature so it was something new to me as well :) – Lord Zsolt Feb 11 '15 at 13:58