Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Localization ability for english strings #31

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -684,7 +684,8 @@ - (void)setViewState {
}

if ([self.photoSource numberOfPhotos] > 1) {
self.title = [NSString stringWithFormat:@"%i of %i", _pageIndex+1, [self.photoSource numberOfPhotos]];
NSString *ofStr = NSLocalizedString(@"of", @"num of num");
self.title = [NSString stringWithFormat:@"%i %@ %i", _pageIndex+1, ofStr, [self.photoSource numberOfPhotos]];
} else {
self.title = @"";
}
Expand Down Expand Up @@ -932,7 +933,8 @@ - (void)copyPhoto{
- (void)emailPhoto{

MFMailComposeViewController *mailViewController = [[MFMailComposeViewController alloc] init];
[mailViewController setSubject:@"Shared Photo"];
NSString *subjectStr = NSLocalizedString(@"Shared Photo", @"Shared Photo, email subject");
[mailViewController setSubject:subjectStr];
[mailViewController addAttachmentData:[NSData dataWithData:UIImagePNGRepresentation(((EGOPhotoImageView*)[self.photoViews objectAtIndex:_pageIndex]).imageView.image)] mimeType:@"image/png" fileName:@"Photo.png"];
mailViewController.mailComposeDelegate = self;

Expand All @@ -952,17 +954,19 @@ - (void)mailComposeController:(MFMailComposeViewController*)controller didFinish
[self dismissModalViewControllerAnimated:YES];

NSString *mailError = nil;
NSString *errorStr = NSLocalizedString(@"Failed sending media, please try again...", @"Error message");
NSString *okStr = NSLocalizedString(@"OK", @"OK");

switch (result) {
case MFMailComposeResultSent: ; break;
case MFMailComposeResultFailed: mailError = @"Failed sending media, please try again...";
case MFMailComposeResultFailed: mailError = errorStr;
break;
default:
break;
}

if (mailError != nil) {
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"" message:mailError delegate:nil cancelButtonTitle:@"OK" otherButtonTitles:nil];
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"" message:mailError delegate:nil cancelButtonTitle:okStr otherButtonTitles:nil];
[alert show];
[alert release];
}
Expand All @@ -976,28 +980,33 @@ - (void)mailComposeController:(MFMailComposeViewController*)controller didFinish
- (void)actionButtonHit:(id)sender{

UIActionSheet *actionSheet;

NSString *saveStr = NSLocalizedString(@"Save", @"Save");
NSString *copyStr = NSLocalizedString(@"Copy", @"Copy");
NSString *emailStr = NSLocalizedString(@"Email", @"Email");
NSString *cancelStr = NSLocalizedString(@"Cancel", @"Cancel");

if ([MFMailComposeViewController canSendMail]) {
#if __IPHONE_OS_VERSION_MAX_ALLOWED >= 30200
if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad && !_popover) {
actionSheet = [[UIActionSheet alloc] initWithTitle:@"" delegate:self cancelButtonTitle:nil destructiveButtonTitle:nil otherButtonTitles:@"Save", @"Copy", @"Email", nil];
actionSheet = [[UIActionSheet alloc] initWithTitle:@"" delegate:self cancelButtonTitle:nil destructiveButtonTitle:nil otherButtonTitles:saveStr, copyStr, emailStr, nil];
} else {
actionSheet = [[UIActionSheet alloc] initWithTitle:@"" delegate:self cancelButtonTitle:@"Cancel" destructiveButtonTitle:nil otherButtonTitles:@"Save", @"Copy", @"Email", nil];
actionSheet = [[UIActionSheet alloc] initWithTitle:@"" delegate:self cancelButtonTitle:cancelStr destructiveButtonTitle:nil otherButtonTitles:saveStr, copyStr, emailStr, nil];
}
#else
actionSheet = [[UIActionSheet alloc] initWithTitle:@"" delegate:self cancelButtonTitle:@"Cancel" destructiveButtonTitle:nil otherButtonTitles:@"Save", @"Copy", @"Email", nil];
actionSheet = [[UIActionSheet alloc] initWithTitle:@"" delegate:self cancelButtonTitle:cancelStr destructiveButtonTitle:nil otherButtonTitles:saveStr, copyStr, emailStr, nil];
#endif

} else {

#if __IPHONE_OS_VERSION_MAX_ALLOWED >= 30200
if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad && !_popover) {
actionSheet = [[UIActionSheet alloc] initWithTitle:@"" delegate:self cancelButtonTitle:nil destructiveButtonTitle:nil otherButtonTitles:@"Save", @"Copy", nil];
actionSheet = [[UIActionSheet alloc] initWithTitle:@"" delegate:self cancelButtonTitle:nil destructiveButtonTitle:nil otherButtonTitles:saveStr, copyStr, nil];
} else {
actionSheet = [[UIActionSheet alloc] initWithTitle:@"" delegate:self cancelButtonTitle:@"Cancel" destructiveButtonTitle:nil otherButtonTitles:@"Save", @"Copy", nil];
actionSheet = [[UIActionSheet alloc] initWithTitle:@"" delegate:self cancelButtonTitle:cancelStr destructiveButtonTitle:nil otherButtonTitles:saveStr, copyStr, nil];
}
#else
actionSheet = [[UIActionSheet alloc] initWithTitle:@"" delegate:self cancelButtonTitle:@"Cancel" destructiveButtonTitle:nil otherButtonTitles:@"Save", @"Copy", nil];
actionSheet = [[UIActionSheet alloc] initWithTitle:@"" delegate:self cancelButtonTitle:cancelStr destructiveButtonTitle:nil otherButtonTitles:saveStr, copyStr, nil];
#endif

}
Expand Down