-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathLocalization.m
More file actions
20 lines (15 loc) · 802 Bytes
/
Localization.m
File metadata and controls
20 lines (15 loc) · 802 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#import <Foundation/Foundation.h>
#import <rootless.h>
NSDictionary *localizationDictionary(void) {
static NSDictionary *bundleDictionary = nil;
static dispatch_once_t onceToken;
dispatch_once(&onceToken, ^{
NSString *const genericPath = ROOT_PATH_NS(@"/Library/PreferenceBundles/BoldersRebornPrefs.bundle/Localization/LANG.lproj/Localization.strings");
NSString *filePath = [genericPath stringByReplacingOccurrencesOfString:@"LANG" withString:NSLocale.currentLocale.languageCode];
if (![[NSFileManager defaultManager] fileExistsAtPath:filePath]) {
filePath = ROOT_PATH_NS(@"/Library/PreferenceBundles/BoldersRebornPrefs.bundle/Localization/en.lproj/Localization.strings");
}
bundleDictionary = [NSDictionary dictionaryWithContentsOfFile:filePath];
});
return bundleDictionary;
}