diff options
author | Jay Freeman (saurik) <saurik@saurik.com> | 2011-02-28 12:22:25 -0800 |
---|---|---|
committer | Jay Freeman (saurik) <saurik@saurik.com> | 2011-03-07 02:41:29 -0800 |
commit | 948db68010420426891800511bbb8cf01f812449 (patch) | |
tree | 211659ec5a2139bb802d8da27674c87d85bd9d87 /MobileCydia.mm | |
parent | 85d5d4521cfbaaafe089428b44fdb73e1c5c8358 (diff) |
Expose languages and locales to JavaScript.
Diffstat (limited to 'MobileCydia.mm')
-rw-r--r-- | MobileCydia.mm | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/MobileCydia.mm b/MobileCydia.mm index 641cb8d..5719549 100644 --- a/MobileCydia.mm +++ b/MobileCydia.mm @@ -4174,6 +4174,10 @@ static NSMutableSet *Diversions_; return @"getKernelString"; else if (selector == @selector(getInstalledPackages)) return @"getInstalledPackages"; + else if (selector == @selector(getLocaleIdentifier)) + return @"getLocaleIdentifier"; + else if (selector == @selector(getPreferredLanguages)) + return @"getPreferredLanguages"; else if (selector == @selector(getPackageById:)) return @"getPackageById"; else if (selector == @selector(getSessionValue:)) @@ -4329,6 +4333,14 @@ static NSMutableSet *Diversions_; return (Package *) [NSNull null]; } +- (NSString *) getLocaleIdentifier { + return Locale_ == NULL ? (NSString *) [NSNull null] : (NSString *) CFLocaleGetIdentifier(Locale_); +} + +- (NSArray *) getPreferredLanguages { + return Languages_; +} + - (NSArray *) statfs:(NSString *)path { struct statfs stat; |