Thomas
Thomas

Reputation: 8978

XCode - iOS localization not taken into account

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

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

Upvotes: 3

Views: 173

Answers (1)

Lord Zsolt
Lord Zsolt

Reputation: 6557

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.

Upvotes: 2

Related Questions