Asihttprequest localizedDescription总是用英文
即时通讯使用Asihttprequest为我的HTTP请求,我的应用程序将汉德3语言:阿拉伯语,法语和英语,但Asihttprequest错误localizedDescription返回总是英文说明。 是Asihttprequest请求使用默认的ios系统本地化描述? 如果是的话我怎么能本地化错误? 谢谢。
我不确定你要求什么,但你可以试试这个。
在ASIHttpRequest.m文件中, Initialize
方法使用NSLocalizedString(@"REQUESTTIMEOUT_KEY", @"The request timed out")
而不是@"The request timed out"
。
有"REQUESTTIMEOUT_KEY" = "EngVersion:The request timed out";
在相应的localizable.strings文件中。
示例代码:
ASIRequestTimedOutError = [[NSError alloc] initWithDomain:NetworkRequestErrorDomain code:ASIRequestTimedOutErrorType userInfo:[NSDictionary dictionaryWithObjectsAndKeys:NSLocalizedString(@"REQUESTTIMEOUT_KEY", @"The request timed out"),NSLocalizedDescriptionKey,nil]];