Permalink
Browse files

Adds a simple local code convertion method.

  • Loading branch information...
1 parent 30356e4 commit 006dec871f43f9e9b5c026823c2de524cfe4189f @zonble committed Mar 1, 2010
@@ -320,6 +320,11 @@ extern NSString *const OPRemoveUserFromCliqueAction;
}
+ (ObjectivePlurk *)sharedInstance;
+
+//- (NSArray *)qualifiers;
+//- (NSArray *)langCodes;
+- (NSString *)langCodeFromLocalIdentifier:(NSString *)locale;
+
- (void)cancelAllRequest;
- (void)cancelAllRequestWithDelegate:(id)delegate;
- (BOOL)resume;
@@ -68,7 +68,6 @@ - (id)init
if (self != nil) {
_request = [[LFHTTPRequest alloc] init];
_request.delegate = self;
-// _request.timeoutInterval = 60.0;
_queue = [[NSMutableArray alloc] init];
_dateFormatter = [[NSDateFormatter alloc] init];
[_dateFormatter setTimeZone:[NSTimeZone timeZoneForSecondsFromGMT:0]];
@@ -80,6 +79,103 @@ - (id)init
return self;
}
+//- (NSArray *)qualifiers
+//{
+// return _qualifiers;
+//}
+//- (NSArray *)langCodes
+//{
+// return _langCodes;
+//}
+- (NSString *)langCodeFromLocalIdentifier:(NSString *)locale
+{
+ if ([locale isEqualToString:@"Dutch"] || [locale isEqualToString:@"nl"]) {
+ return @"ne";
+ }
+ if ([locale isEqualToString:@"English"] || [locale isEqualToString:@"en"]) {
+ return @"en";
+ }
+ if ([locale isEqualToString:@"French"] || [locale isEqualToString:@"fr"]) {
+ return @"fr";
+ }
+ if ([locale isEqualToString:@"German"] || [locale isEqualToString:@"de"]) {
+ return @"de";
+ }
+ if ([locale isEqualToString:@"Italian"] || [locale isEqualToString:@"it"]) {
+ return @"it";
+ }
+ if ([locale isEqualToString:@"Japanese"] || [locale isEqualToString:@"ja"]) {
+ return @"ja";
+ }
+ if ([locale isEqualToString:@"Spanish"] || [locale isEqualToString:@"es"]) {
+ return @"es";
+ }
+ if ([locale isEqualToString:@"da"]) {
+ return @"dk";
+ }
+ if ([locale isEqualToString:@"fi"]) {
+ return @"fi";
+ }
+ if ([locale isEqualToString:@"ko"]) {
+ return @"en"; //Korean, not supported.
+ }
+ if ([locale isEqualToString:@"no"] || [locale isEqualToString:@"nb"]) {
+ return @"nb";
+ }
+ if ([locale isEqualToString:@"pl"]) {
+ return @"pl";
+ }
+ if ([locale isEqualToString:@"pt"]) {
+ return @"pt_BR";
+ }
+ if ([locale isEqualToString:@"pt-PT"]) {
+ return @"pt_BR";
+ }
+ if ([locale isEqualToString:@"ru"]) {
+ return @"ru";
+ }
+ if ([locale isEqualToString:@"sv"]) {
+ return @"sv";
+ }
+ if ([locale isEqualToString:@"zh-Hans"] || [locale isEqualToString:@"zh_CN"]) {
+ return @"cn";
+ }
+ if ([locale isEqualToString:@"zh-Hant"] || [locale isEqualToString:@"zh_TW"]) {
+ return @"tr_ch";
+ }
+ if ([locale isEqualToString:@"tr"]) {
+ return @"tr";
+ }
+ if ([locale isEqualToString:@"uk"]) {
+ return @"uk";
+ }
+ if ([locale isEqualToString:@"ar"]) {
+ return @"ar";
+ }
+ if ([locale isEqualToString:@"hr"]) {
+ return @"hr";
+ }
+ if ([locale isEqualToString:@"el"]) {
+ return @"el";
+ }
+ if ([locale isEqualToString:@"he"]) {
+ return @"he";
+ }
+ if ([locale isEqualToString:@"ro"]) {
+ return @"ro";
+ }
+ if ([locale isEqualToString:@"sk"]) {
+ return @"sk";
+ }
+ if ([locale isEqualToString:@"th"]) {
+ return @"th";
+ }
+// if ([locale isEqualToString:@"cs"]) {
+// return @"cs";
+// }
+ return @"en";
+}
+
- (BOOL)shouldWaitUntilDone
{
return [_request shouldWaitUntilDone];
@@ -22,7 +22,7 @@
isa = PBXContainerItemProxy;
containerPortal = D4FFA0F310D039C400D10A53 /* ObjectivePlurk.xcodeproj */;
proxyType = 2;
- remoteGlobalIDString = D4FFA25B10D0451B00D10A53 /* ObjectivePlurkTest.octest */;
+ remoteGlobalIDString = D4FFA25B10D0451B00D10A53;
remoteInfo = ObjectivePlurkTest;
};
D4FFA0F710D039C400D10A53 /* PBXContainerItemProxy */ = {

0 comments on commit 006dec8

Please sign in to comment.