Permalink
Browse files

Added localizable strings.

  • Loading branch information...
1 parent 249a322 commit 6727bc2a969cf3345470e99c52c8038865655b04 @mwaterfall committed Jan 18, 2012
@@ -7,6 +7,7 @@
objects = {
/* Begin PBXBuildFile section */
+ 0E85B24C14C6F40500EA35BF /* Localizable.strings in Resources */ = {isa = PBXBuildFile; fileRef = 0E85B24E14C6F40500EA35BF /* Localizable.strings */; };
4C6F979214AF734900F8389A /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 4C6F979114AF734900F8389A /* UIKit.framework */; };
4C6F979414AF734900F8389A /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 4C6F979314AF734900F8389A /* Foundation.framework */; };
4C6F979614AF734900F8389A /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 4C6F979514AF734900F8389A /* CoreGraphics.framework */; };
@@ -45,6 +46,7 @@
/* End PBXContainerItemProxy section */
/* Begin PBXFileReference section */
+ 0E85B24D14C6F40500EA35BF /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/Localizable.strings; sourceTree = "<group>"; };
4C6F978D14AF734900F8389A /* PhotoBrowserDemo.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = PhotoBrowserDemo.app; sourceTree = BUILT_PRODUCTS_DIR; };
4C6F979114AF734900F8389A /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; };
4C6F979314AF734900F8389A /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; };
@@ -121,6 +123,7 @@
4C6F97A114AF734900F8389A /* AppDelegate.m */,
4C6F97B114AF737E00F8389A /* Menu.h */,
4C6F97B214AF737E00F8389A /* Menu.m */,
+ 0E85B24E14C6F40500EA35BF /* Localizable.strings */,
4C6F97CA14AF75D300F8389A /* Photos */,
4CB08BF314B1FF7300730E9F /* MWPhotoBrowser */,
4C6F979814AF734900F8389A /* Supporting Files */,
@@ -206,6 +209,7 @@
hasScannedForEncodings = 0;
knownRegions = (
en,
+ fr,
);
mainGroup = 4C6F978214AF734800F8389A;
productRefGroup = 4C6F978E14AF734900F8389A /* Products */;
@@ -248,6 +252,7 @@
4C6F97D914AF760500F8389A /* photo4l.jpg in Resources */,
4C6F97DA14AF760500F8389A /* photo4m.jpg in Resources */,
4CD92B1314B20FA2002200C1 /* MWPhotoBrowser.bundle in Resources */,
+ 0E85B24C14C6F40500EA35BF /* Localizable.strings in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@@ -275,6 +280,14 @@
/* End PBXTargetDependency section */
/* Begin PBXVariantGroup section */
+ 0E85B24E14C6F40500EA35BF /* Localizable.strings */ = {
+ isa = PBXVariantGroup;
+ children = (
+ 0E85B24D14C6F40500EA35BF /* en */,
+ );
+ name = Localizable.strings;
+ sourceTree = "<group>";
+ };
4C6F979A14AF734900F8389A /* InfoPlist.strings */ = {
isa = PBXVariantGroup;
children = (
Binary file not shown.
@@ -54,10 +54,9 @@ - (void)setupCaption {
_label.textColor = [UIColor whiteColor];
_label.shadowColor = [UIColor blackColor];
_label.shadowOffset = CGSizeMake(1, 1);
-
- // Caption
+ _label.font = [UIFont systemFontOfSize:17];
if ([_photo respondsToSelector:@selector(caption)]) {
- _label.text = [_photo caption] ? [_photo caption] : @"[No Title]";
+ _label.text = [_photo caption] ? [_photo caption] : @" ";
}
[self addSubview:_label];
@@ -297,7 +297,7 @@ - (void)performLayout {
// Navigation buttons
if ([self.navigationController.viewControllers objectAtIndex:0] == self) {
// We're first on stack so show done button
- UIBarButtonItem *doneButton = [[[UIBarButtonItem alloc] initWithTitle:@"Done" style:UIBarButtonItemStylePlain target:self action:@selector(doneButtonPressed:)] autorelease];
+ UIBarButtonItem *doneButton = [[[UIBarButtonItem alloc] initWithTitle:NSLocalizedString(@"Done", nil) style:UIBarButtonItemStylePlain target:self action:@selector(doneButtonPressed:)] autorelease];
// Set appearance
if ([UIBarButtonItem respondsToSelector:@selector(appearance)]) {
[doneButton setBackgroundImage:nil forState:UIControlStateNormal barMetrics:UIBarMetricsDefault];
@@ -577,7 +577,7 @@ - (MWCaptionView *)captionViewForPhotoAtIndex:(NSUInteger)index {
} else {
id <MWPhoto> photo = [self photoAtIndex:index];
if ([photo respondsToSelector:@selector(caption)]) {
- if ([photo caption]) captionView = [[[MWCaptionView alloc] initWithPhoto:photo] autorelease];
+ if ([photo caption]) captionView = [[[MWCaptionView alloc] initWithPhoto:photo] autorelease];
}
}
captionView.alpha = [self areControlsHidden] ? 0 : 1; // Initial alpha
@@ -860,7 +860,7 @@ - (void)updateNavigation {
// Title
if ([self numberOfPhotos] > 1) {
- self.title = [NSString stringWithFormat:@"%i of %i", _currentPageIndex+1, [self numberOfPhotos]];
+ self.title = [NSString stringWithFormat:@"%i %@ %i", _currentPageIndex+1, NSLocalizedString(@"of", @"Used in the context: 'Showing 1 of 3 items'"), [self numberOfPhotos]];
} else {
self.title = nil;
}
@@ -1003,12 +1003,12 @@ - (void)actionButtonPressed:(id)sender {
// Sheet
if ([MFMailComposeViewController canSendMail]) {
self.actionsSheet = [[[UIActionSheet alloc] initWithTitle:nil delegate:self
- cancelButtonTitle:@"Cancel" destructiveButtonTitle:nil
- otherButtonTitles:@"Save", @"Copy", @"Email", nil] autorelease];
+ cancelButtonTitle:NSLocalizedString(@"Cancel", nil) destructiveButtonTitle:nil
+ otherButtonTitles:NSLocalizedString(@"Save", nil), NSLocalizedString(@"Copy", nil), NSLocalizedString(@"Email", nil), nil] autorelease];
} else {
self.actionsSheet = [[[UIActionSheet alloc] initWithTitle:nil delegate:self
- cancelButtonTitle:@"Cancel" destructiveButtonTitle:nil
- otherButtonTitles:@"Save", @"Copy", nil] autorelease];
+ cancelButtonTitle:NSLocalizedString(@"Cancel", nil) destructiveButtonTitle:nil
+ otherButtonTitles:NSLocalizedString(@"Save", nil), NSLocalizedString(@"Copy", nil), nil] autorelease];
}
_actionsSheet.actionSheetStyle = UIActionSheetStyleBlackTranslucent;
if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad) {
@@ -1083,7 +1083,7 @@ - (void)showProgressHUDCompleteMessage:(NSString *)message {
- (void)savePhoto {
id <MWPhoto> photo = [self photoAtIndex:_currentPageIndex];
if ([photo underlyingImage]) {
- [self showProgressHUDWithMessage:@"Saving..."];
+ [self showProgressHUDWithMessage:[NSString stringWithFormat:@"%@\u2026" , NSLocalizedString(@"Saving", @"Displayed with ellipsis as 'Saving...' when an item is in the process of being saved")]];
[self performSelector:@selector(actuallySavePhoto:) withObject:photo afterDelay:0];
}
}
@@ -1096,14 +1096,14 @@ - (void)actuallySavePhoto:(id<MWPhoto>)photo {
}
- (void)image:(UIImage *)image didFinishSavingWithError:(NSError *)error contextInfo:(void *)contextInfo {
- [self showProgressHUDCompleteMessage:error?@"Failed":@"Saved"];
+ [self showProgressHUDCompleteMessage: error ? NSLocalizedString(@"Failed", @"Informing the user a process has failed") : NSLocalizedString(@"Saved", @"Informing the user an item has been saved")];
[self hideControlsAfterDelay]; // Continue as normal...
}
- (void)copyPhoto {
id <MWPhoto> photo = [self photoAtIndex:_currentPageIndex];
if ([photo underlyingImage]) {
- [self showProgressHUDWithMessage:@"Copying..."];
+ [self showProgressHUDWithMessage:[NSString stringWithFormat:@"%@\u2026" , NSLocalizedString(@"Copying", @"Displayed with ellipsis as 'Copying...' when an item is in the process of being copied")]];
[self performSelector:@selector(actuallyCopyPhoto:) withObject:photo afterDelay:0];
}
}
@@ -1112,15 +1112,15 @@ - (void)actuallyCopyPhoto:(id<MWPhoto>)photo {
if ([photo underlyingImage]) {
[[UIPasteboard generalPasteboard] setData:UIImagePNGRepresentation([photo underlyingImage])
forPasteboardType:@"public.png"];
- [self showProgressHUDCompleteMessage:@"Copied"];
+ [self showProgressHUDCompleteMessage:NSLocalizedString(@"Copied", @"Informing the user an item has finished copying")];
[self hideControlsAfterDelay]; // Continue as normal...
}
}
- (void)emailPhoto {
id <MWPhoto> photo = [self photoAtIndex:_currentPageIndex];
if ([photo underlyingImage]) {
- [self showProgressHUDWithMessage:@"Preparing..."];
+ [self showProgressHUDWithMessage:[NSString stringWithFormat:@"%@\u2026" , NSLocalizedString(@"Preparing", @"Displayed with ellipsis as 'Preparing...' when an item is in the process of being prepared")]];
[self performSelector:@selector(actuallyEmailPhoto:) withObject:photo afterDelay:0];
}
}
@@ -1129,7 +1129,7 @@ - (void)actuallyEmailPhoto:(id<MWPhoto>)photo {
if ([photo underlyingImage]) {
MFMailComposeViewController *emailer = [[MFMailComposeViewController alloc] init];
emailer.mailComposeDelegate = self;
- [emailer setSubject:@"Photo"];
+ [emailer setSubject:NSLocalizedString(@"Photo", nil)];
[emailer addAttachmentData:UIImagePNGRepresentation([photo underlyingImage]) mimeType:@"png" fileName:@"Photo.png"];
if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad) {
emailer.modalPresentationStyle = UIModalPresentationPageSheet;
@@ -1144,7 +1144,9 @@ - (void)actuallyEmailPhoto:(id<MWPhoto>)photo {
- (void)mailComposeController:(MFMailComposeViewController*)controller didFinishWithResult:(MFMailComposeResult)result error:(NSError*)error {
if (result == MFMailComposeResultFailed) {
- UIAlertView *alert = [[[UIAlertView alloc] initWithTitle:@"Email" message:@"Email failed to send. Please try again." delegate:nil cancelButtonTitle:@"Dismiss" otherButtonTitles:nil] autorelease];
+ UIAlertView *alert = [[[UIAlertView alloc] initWithTitle:NSLocalizedString(@"Email", nil)
+ message:NSLocalizedString(@"Email failed to send. Please try again.", nil)
+ delegate:nil cancelButtonTitle:NSLocalizedString(@"Dismiss", nil) otherButtonTitles:nil] autorelease];
[alert show];
}
[self dismissModalViewControllerAnimated:YES];

0 comments on commit 6727bc2

Please sign in to comment.