localizedDescription not localized #61

Closed
caramdache opened this Issue Feb 13, 2014 · 2 comments

Projects

None yet

3 participants

@caramdache

Another localization issue... localizedDescription is not localized currently.

An easy solution is to define the ERR macro as follows, but this generate compiler warnings [-Wformat-security] as the compiler can no longer check whether all arguments have really been filed in:

#define ERR(_c,_f,...) [NSError errorWithDomain:DDMathParserErrorDomain code:(_c) userInfo:@{ NSLocalizedDescriptionKey: [NSString stringWithFormat:(NSLocalizedString(_f, nil)), ##__VA_ARGS__]}]

A better solution seems to be to create a function using NS_FORMAT_FUNCTION(f,a), as described in:

http://stackoverflow.com/questions/18449176/objective-c-format-string-is-not-a-string-literal-potentially-insecure-warn

BTW let me know if you wish the French localization.

@JanX2

If you do the French localization I will do German. :)

@davedelong
Owner

Duplicate of #59. Thanks!

@davedelong davedelong closed this Feb 14, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment