-
Notifications
You must be signed in to change notification settings - Fork 291
Localization: Add support for plist-based .strings files
#504
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
|
@rfm this is also supported in recent MacOS versions |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Am I missing something? My impression is that all one needs to do to achieve the objective is:
First call +propertyListFromData:mutabilityOption:format:errorDescription: to try to parse the file.
Then, if it failed to parse, use the current code.
If it parsed but produced the wrong information, log an error because the file is wrong.
If it parsed and produced the right information, use it.
If that's sufficient, it's a smaller/simpler change and limited to just NSBundle.m
How can I verify this using |
|
I'm not sure the order in which you get error information is much of a problem, but while looking at this I realised that there already existed a private function for getting strings table content (and NSBundle wasn't using it for some reason), so I tweaked that to call +propertyListFromData:mutabilityOption:format:errorDescription: after failing with the standard strings file parsing and simplified (removed quite a bit of code) NSBundle by using it. I also added a tiny testcase for it. Does it meet your needs? |
|
But
Something like |
It seems to me that, at this point (we have determined that the file exists and have loaded it in) there is only one possible error: the content of the file cannot be parsed as a property list (ie it's not valid format in some way). Certainly there's no obvious correct set of additional error information we can/should provide. |
No description provided.