I have a JSON resource resource.json in the my / MyApp / Resources / folder. I want this resource to be localized, so I chose to localize it in Swedish and English in Xcode. Now I have 2 folders:
/MyApp/Resources/sv.lproj/resource.json
and
/MyApp/Resources/en.lproj/resource.json
So far so good. But whenever I try to use this resource with:
NSString *jsonPath = [[NSBundle mainBundle] pathForResource:@"resource" ofType:@"json"]; NSString *jsonString = [NSString stringWithContentsOfFile:jsonPath encoding:NSUTF8StringEncoding error:&error];
jsonString will always contain the English version of the resource. I tried switching languages ββboth in the simulator and on the device to no avail.
I am not sure how to fix this problem ...
source share