yackle / CLImageEditor

MIT License
2.22k stars 574 forks source link

Localize Done button on navigation bar #90

Closed vvit closed 9 years ago

vvit commented 9 years ago

I think changing Done button title can also be useful. What do you think? Thanks.

yackle commented 9 years ago

That would be nice! Please wait to become ready.

yackle commented 9 years ago

I had just an idea. I think the following modification is better for compatibility of Localizable.strings.

    NSString *doneBtnTitle = [CLImageEditorTheme localizedString:@"CLImageEditor_DoneBtnTitle" withDefault:@""];

    if(doneBtnTitle.length>0){
        self.navigationItem.rightBarButtonItem = [[UIBarButtonItem alloc] initWithTitle:doneBtnTitle style:UIBarButtonItemStyleDone target:self action:@selector(pushedFinishBtn:)];
    }
    else{
        self.navigationItem.rightBarButtonItem = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemDone target:self action:@selector(pushedFinishBtn:)];
    }

How about you?

vvit commented 9 years ago

Sounds good to me, thx!

On 28 січ. 2015, at 09:45, Sho Yakushiji notifications@github.com wrote:

I had just an idea. I think the following modification is better for compatibility of Localizable.strings.

NSString *doneBtnTitle = [CLImageEditorTheme localizedString:@"CLImageEditor_DoneBtnTitle" withDefault:@""];

if(doneBtnTitle.length>0){
    self.navigationItem.rightBarButtonItem = [[UIBarButtonItem alloc] initWithTitle:doneBtnTitle style:UIBarButtonItemStyleDone target:self action:@selector(pushedFinishBtn:)];
}
else{
    self.navigationItem.rightBarButtonItem = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemDone target:self action:@selector(pushedFinishBtn:)];
}

How about you?

— Reply to this email directly or view it on GitHub.

yackle commented 9 years ago

merged, and modified 5d80b853f3206560c70cb014a625380be09298bd

Thanks!

vvit commented 9 years ago

@yackle thx, but you forgot to remove "CLImageEditor_DoneBtnTitle" = "Done"; from CLImageEditor.bundle/Resources/en.lproj/Localizable.strings to make it work as expected :)

yackle commented 9 years ago

it is probably fixed, please check it.