Commits

Evan Schoenberg  committed 637ffec

Meh. I learned why this wasn't working. Sharing my knowledge by updating error handling...

  • Participants
  • Parent commits 020ad4b

Comments (0)

Files changed (1)

File GoogleTranslator.m

 					failureReason = NSLocalizedString(@"One or both languages is not supported by Google Language Tools", /*comment*/ @"Error message failure reasons");
 					recoverySuggestion = NSLocalizedString(@"Google Language Tools only works with certain languages. For a current list of them, see <http://translate.google.com/>.", /*comment*/ @"Error message recovery suggestions");
 				}
+			} else if ([[responseDict objectForKey:@"responseDetails"] rangeOfString:@"Quota Exceeded"].location != NSNotFound) {
+				errorDesc = NSLocalizedString(@"Google Translate quota exceeded", nil);
+				failureReason = NSLocalizedString(@"Google Translate is now a paid service; this application's usage is currently restricted.", nil);
+				recoverySuggestion = NSLocalizedString(@"Google Translate is now a paid service; this application's usage is currently restricted. Please see http://code.google.com/apis/language/translate/overview.html",nil);
 			}
 
+
+			NSLog(@"%@", responseDict);
+			
 			//If any of these are missing, fill them in so we have *something* to display here.
 			if (!errorDesc)
 				errorDesc = NSLocalizedString(@"Unknown translation error", /*comment*/ @"Error message error descriptions");