Discussion Forums  >  Plugins, Customizing, Source Code

Replies: 14    Views: 445

Jelope
Lost but trying
Profile
Posts: 64
Reg: Jul 29, 2013
copenhagen
9,040
08/30/13 03:51 AM (12 years ago)

Add another text instead of edit in the Edit button

Hey Could some of you maybe explain how I can change the text in the notepad_feature. I want my app in danish, so the button "Edit" should be "Skriv" And the button "Done" should be "Gem" I did read how to change the "back" button, and that works fine. Thank you very much :) Jette
 
SmugWimp
Smugger than thou...
Profile
Posts: 6316
Reg: Nov 07, 2012
Tamuning, GU
81,410
like
08/30/13 04:39 AM (12 years ago)
Genuinely, I don't know. Looking at the code, it is populated by inherent system values UIBarButtonSystemItemDone on line 156-ish and UIBarButtonSystemItemEdit around line 173-ish What you could try to do, is on line 158 try this instruction: [rightNavButton setTitle:@"Gem"]; and on line 175 [rightNavButton setTitle:@"Skriv"]; and that 'may' work for you. Basically just put those right before the line that says "rightnavbutton release". both of these need to be added, nothing needs to be directly edited. If it doesn't work, then merely remove the code you added. Mark (GoNorthWest) might weigh in on this, as he is the author, but it's sleep time over there, so it might be a bit before he logs on. Cheers! -- Smug And there is the option of just creating an entire Danish language file for the app, which should be documented here: http://whitebuffalomobile.com/Localization/localization.html
 
Jelope
Lost but trying
Profile
Posts: 64
Reg: Jul 29, 2013
copenhagen
9,040
like
08/30/13 05:03 AM (12 years ago)
WOW that looks nice, I did not know that was possible. Mayby I have to use a week, on the that idea :) I think I should look for your solution in notepad.feature.m? isn't that right? Here is what it says from line 149 til line 179 //start edit notes... -(void)startEdit{ [BT_debugger showIt:self theMessage:@"startEdit"]; //setup "done" button... UIBarButtonItem *rightNavButton = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemDone target:self action:@selector(endEdit)]; [self.navigationItem setRightBarButtonItem:rightNavButton]; [rightNavButton release]; //show keyboard, make editable... [self.textViewNotes setEditable:true]; [self.textViewNotes becomeFirstResponder]; } //end edit notes... -(void)endEdit{ [BT_debugger showIt:self theMessage:@"endEdit"]; //setup "edit" button... UIBarButtonItem *rightNavButton = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemEdit target:self action:@selector(startEdit)]; [self.navigationItem setRightBarButtonItem:rightNavButton]; [rightNavButton release]; //hide keyboard, not editable anymore... [self.textViewNotes resignFirstResponder]; [self.textViewNotes setEditable:false];
 
SmugWimp
Smugger than thou...
Profile
Posts: 6316
Reg: Nov 07, 2012
Tamuning, GU
81,410
like
08/30/13 05:07 AM (12 years ago)
I'm hoping it will work, but I haven't tested it and don't have a project with the notepad feature ready to roll. But It 'should' look like your above code, with those two instructions put in like this: //setup "done" button... UIBarButtonItem *rightNavButton = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemDone target:self action:@selector(endEdit)]; [self.navigationItem setRightBarButtonItem:rightNavButton]; [rightNavButton setTitle:@"Gem"]; // <--- Add this line [rightNavButton release]; and then later in the code... //setup "edit" button... UIBarButtonItem *rightNavButton = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemEdit target:self action:@selector(startEdit)]; [self.navigationItem setRightBarButtonItem:rightNavButton]; [rightNavButton setTitle:@"Skriv"]; // <--- Add this line also [rightNavButton release]; It shouldn't take much, and you'll find out soon whether it will work or not... Hope it does, but again, haven't tried it. Cheers! -- Smug
 
Jelope
Lost but trying
Profile
Posts: 64
Reg: Jul 29, 2013
copenhagen
9,040
like
08/30/13 05:25 AM (12 years ago)
Hmm thanks but it do not work. The god thing is, that it did not break thing either. I did a project clean, and I did reset the simulator. But it still says Edit and Done
 
SmugWimp
Smugger than thou...
Profile
Posts: 6316
Reg: Nov 07, 2012
Tamuning, GU
81,410
like
08/30/13 05:31 AM (12 years ago)
Rats. Well, I was hoping... I'm reloading my self-hosted, so I'll snoop around a little and see what I can come up with, if anything. Worst case, in a couple of hours someone who actually knows about it can assist :) Cheers! -- Smug
 
Kittsy
buzztouch Evangelist
Profile
Posts: 2251
Reg: Feb 22, 2012
Liverpool
31,360
like
08/30/13 05:37 AM (12 years ago)
They are system buttions and are automatically localised to whatever the app is. when opened on a danish phone it will be in the right language. test it by changing your localisation in teh iphones settings. Think about it the iphone is worldwiode they are not going to create there ui elements in only english
 
Kittsy
buzztouch Evangelist
Profile
Posts: 2251
Reg: Feb 22, 2012
Liverpool
31,360
like
08/30/13 05:38 AM (12 years ago)
io io bloody sausage fingers
 
Jelope
Lost but trying
Profile
Posts: 64
Reg: Jul 29, 2013
copenhagen
9,040
like
08/30/13 05:45 AM (12 years ago)
I did change the "Back" bottun to "Hjem", and it did show "hjem" in the simulator. What you are saying is, that by doing the trick from Smugwimp, it should work in real life in Denmark :)
 
SmugWimp
Smugger than thou...
Profile
Posts: 6316
Reg: Nov 07, 2012
Tamuning, GU
81,410
like
08/30/13 05:49 AM (12 years ago)
 
Kittsy
buzztouch Evangelist
Profile
Posts: 2251
Reg: Feb 22, 2012
Liverpool
31,360
like
08/30/13 05:50 AM (12 years ago)
yeah the back button isn't a system icon its a custom nav bar item note: the system in the name UIBarButtonSystemItemDone UIBarButtonSystemItemEdit You can test this out yourself and change the language your phone is set to Danish and everything will change, that is either localized or native ios UI. The code smug has give you is how to change title text of any buttons, labels , headers. But system buttons do not have the properties to edit.
 
Kittsy
buzztouch Evangelist
Profile
Posts: 2251
Reg: Feb 22, 2012
Liverpool
31,360
like
08/30/13 05:53 AM (12 years ago)
@smug that will work but as I've said is unnessecary and will require to write the full localisation list for danish, which should be done but not neccessary for the system right nav buttons
 
Jelope
Lost but trying
Profile
Posts: 64
Reg: Jul 29, 2013
copenhagen
9,040
like
08/30/13 06:07 AM (12 years ago)
Super - Because it is al ready in appstore, and when we download it in Denmark, it says "done" and "edit" But I will oploadet it again, and hope it will be okay after I wrote [rightNavButton setTitle:@"Gem"]; and [rightNavButton setTitle:@"Skriv"]; as "smug told me.
 
Jelope
Lost but trying
Profile
Posts: 64
Reg: Jul 29, 2013
copenhagen
9,040
like
09/12/13 02:08 AM (12 years ago)
Hey my app is just approved again. But it did not help actually it got a little bit worse. On iphone 5 it now have a unwanted "home"-buttom on the top in right side. In some of the pages. There is something wrong, in the app store it says that the language is english but in the meta-data and uploads it says DANISH (default language) and choose another language "Danish" What is wrong ....
 
Jelope
Lost but trying
Profile
Posts: 64
Reg: Jul 29, 2013
copenhagen
9,040
like
09/12/13 03:07 AM (12 years ago)
I did manage to change the localization in x-code. I thing it might work. But the buttom done og edit do not change into danish on the simulator
 

Login + Screen Name Required to Post

pointerLogin to participate so you can start earning points. Once you're logged in (and have a screen name entered in your profile), you can subscribe to topics, follow users, and start learning how to make apps like the pros.