Skip to content

Commit

Permalink
Internatinalization of strings displayed on the title bar and buttons.
Browse files Browse the repository at this point in the history
Spanish and english translations included.
  • Loading branch information
zetxek committed Apr 6, 2012
1 parent 78c67f5 commit 85b7218
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 4 deletions.
13 changes: 9 additions & 4 deletions FGallery/Classes/FGalleryViewController.m
Expand Up @@ -445,10 +445,15 @@ - (void)layoutViews

- (void)setUseThumbnailView:(BOOL)useThumbnailView
{

UIBarButtonItem *newBackButton = [[UIBarButtonItem alloc] initWithTitle: NSLocalizedString(@"Back", @"") style: UIBarButtonItemStyleBordered target: nil action: nil];
[[self navigationItem] setBackBarButtonItem: newBackButton];


_useThumbnailView = useThumbnailView;
if( self.navigationController ) {
if (_useThumbnailView) {
UIBarButtonItem *btn = [[[UIBarButtonItem alloc] initWithTitle:@"See All" style:UIBarButtonItemStylePlain target:self action:@selector(handleSeeAllTouch:)] autorelease];
UIBarButtonItem *btn = [[[UIBarButtonItem alloc] initWithTitle:NSLocalizedString(@"See all", @"") style:UIBarButtonItemStylePlain target:self action:@selector(handleSeeAllTouch:)] autorelease];
[self.navigationItem setRightBarButtonItem:btn animated:YES];
}
else {
Expand Down Expand Up @@ -649,7 +654,7 @@ - (void)updateScrollSize

- (void)updateTitle
{
[self setTitle:[NSString stringWithFormat:@"%i of %i", _currentIndex+1, [_photoSource numberOfPhotosForPhotoGallery:self]]];
[self setTitle:[NSString stringWithFormat:@"%i %@ %i", _currentIndex+1, NSLocalizedString(@"of", @"") , [_photoSource numberOfPhotosForPhotoGallery:self]]];
}


Expand Down Expand Up @@ -760,7 +765,7 @@ - (void)showThumbnailViewWithAnimation:(BOOL)animation
_isThumbViewShowing = YES;

[self arrangeThumbs];
[self.navigationItem.rightBarButtonItem setTitle:@"Done"];
[self.navigationItem.rightBarButtonItem setTitle:NSLocalizedString(@"Close", @"")];

if (animation) {
// do curl animation
Expand All @@ -779,7 +784,7 @@ - (void)showThumbnailViewWithAnimation:(BOOL)animation
- (void)hideThumbnailViewWithAnimation:(BOOL)animation
{
_isThumbViewShowing = NO;
[self.navigationItem.rightBarButtonItem setTitle:@"See All"];
[self.navigationItem.rightBarButtonItem setTitle:NSLocalizedString(@"See all", @"")];

if (animation) {
// do curl animation
Expand Down
9 changes: 9 additions & 0 deletions FGallery/en.lproj/Localizable.strings
@@ -0,0 +1,9 @@
/*
FGalleryStrings.strings
Created by Zadia Software on 06/04/12.
*/

"Close" = "Close";
"See all" = "See all";
"Back" = "Back";
"of" = "of";
9 changes: 9 additions & 0 deletions FGallery/es.lproj/Localizable.strings
@@ -0,0 +1,9 @@
/*
FGalleryStrings.strings
Created by Zadia Software on 06/04/12.
*/

"Close" = "Cerrar";
"See all" = "Ver todas";
"Back" = "Volver";
"of" = "de";

0 comments on commit 85b7218

Please sign in to comment.