I found the answer to my question, and since it is related to this question, I share it so that it can help if someone needs it.
A file containing error codes and localized descriptions is located in /System/Library/Frameworks/Foundation.Framework/Resources/en.lproj/FoundationErrors.strings Copy this file and paste it in another location (so as not to spoil the source file). Now run the command in the terminal to convert the binary file to a text file: plutil -convert xml1 FoundationErrors.strings Now drag the file into the Xcode project and right-click and select Open as... Property list . Now you have the keys and descriptions. You can translate (if the desired language is not available in the localization) or configure them the way you want and save it with the desired Persian.strings name in my case.
Now add this code to the method in which you want to use it:
//persian error messages file full path NSString * persianErrorsListFile = [[[NSBundle mainBundle] bundlePath] stringByAppendingPathComponent:@"Persian.strings"]; //Load file as dictionary NSDictionary * persianErrorsList = [[NSDictionary alloc] initWithContentsOfFile:persianErrorsListFile]; NSString *errorKey = [NSString stringWithFormat:@"Err%ld", (long)errorCode]; NSString *errorMessage = persianErrorsList[errorKey];
Neeku source share