From 3d9aceafbbf0c2dcd99f38f75b50ee5fec0055f8 Mon Sep 17 00:00:00 2001 From: Zhigang Fang Date: Sun, 4 Sep 2016 15:39:05 +0800 Subject: [PATCH] Loading resource file from main bundle This workaround the issue where file are not file, because their are in a different bundle when using frameworks. --- src/I18NextCache.m | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/I18NextCache.m b/src/I18NextCache.m index 707f775..05644dc 100644 --- a/src/I18NextCache.m +++ b/src/I18NextCache.m @@ -36,7 +36,7 @@ for (id l in langs) { if ([l isKindOfClass:[NSString class]]) { NSString* lang = l; - NSString* path = [[NSBundle bundleForClass:[self class]] pathForResource:lang ofType:@"lproj"]; + NSString* path = [[NSBundle mainBundle] pathForResource:lang ofType:@"lproj"]; NSString* langFile = [path stringByAppendingPathComponent:filename]; if (langFile) { [langsToRead addObject:lang];