Re: [PhoneGap] Change InAppBrowser Done button

5,665 views
Skip to first unread message

Shazron

unread,
Feb 4, 2013, 10:34:40 PM2/4/13
to phonegap
This is an iOS built-in button. If your app supports multiple languages (an iOS Xcode thing, look it up), that text will change automatically.


On Mon, Feb 4, 2013 at 9:05 AM, Ricardo Quirós <qui...@uji.es> wrote:
Hi,

I'm developing an app that uses InAppBrowser plugin and I need to change the "Done" text shown by default in the location bar to a Spanish word (and perhaps to other languages). Is there any way of doing this?

Thanks in advance,

--
-- You received this message because you are subscribed to the Google
Groups "phonegap" group.
To post to this group, send email to phon...@googlegroups.com
To unsubscribe from this group, send email to
phonegap+u...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/phonegap?hl=en?hl=en
 
For more info on PhoneGap or to download the code go to www.phonegap.com
 
To compile in the cloud, check out build.phonegap.com
---
You received this message because you are subscribed to the Google Groups "phonegap" group.
To unsubscribe from this group and stop receiving emails from it, send an email to phonegap+u...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Ricardo Quirós

unread,
Feb 6, 2013, 6:17:38 AM2/6/13
to phon...@googlegroups.com
Hi, Shazron. Thank you for your response. I don´t think the text in the button is an OS feature (at least in Android). I've been looking at the inAppBrowser source code (https://github.com/apache/cordova-android/blob/master/framework/src/org/apache/cordova/InAppBrowser.java) and it appears hard-coded at line 394:

close.setText("Done");

Perhaps I can recompile cordova to get the cordova-2.3.0.jar (but I don't know exactly if this can be done, and how), but I hope that this can be solved with another easier solution.

Thanks in advance,

Shazron

unread,
Feb 6, 2013, 6:29:06 AM2/6/13
to phonegap
Right. That would be something that a Cordova Android dev would have to look at, please file an enhancement request: https://issues.apache.org/jira/browse/CB

Simon MacDonald

unread,
Feb 6, 2013, 12:46:53 PM2/6/13
to phonegap
That's why I wanted to use icons. Unfortunately, they have their own
problems when it comes to Android.

Simon Mac Donald
http://hi.im/simonmacdonald

Ricardo Quirós

unread,
Feb 20, 2013, 5:00:40 AM2/20/13
to phon...@googlegroups.com
Hi everybody! At last I've builded the cordova android source code with some modifications and now my app shows a single button (without the address textbox and the back/forward buttons) with a Spanish "Cerrar" text. I've also filled an enhancement request asking for this plugin configuration in new versions. 

Thank you all for your support,


Ricardo Quiros

WebSteve

unread,
Feb 20, 2013, 11:50:37 AM2/20/13
to phon...@googlegroups.com
How about sharing your modifications?

Ricardo Quirós

unread,
Feb 21, 2013, 4:00:54 AM2/21/13
to phon...@googlegroups.com
How about sharing your modifications?


Yes, of course!

I've downloaded the source code from:


For building the cordova.jar, I've followed the instructions from this post (the title says cordova 2.2.0, but works for current version of source code):


Before building, open in eclipse the file "InAppBrowser.java", located in the folder "src/org.apache.cordova" and do the following modifications:

1) Change the text "Done" in line 410: close.setText("Done");

2) If you want to hide some component in the location toolbar, comment some of the lines between 457 and 459. I only want the "Done" button to show, so I've commented lines 457 & 458:

    toolbar.addView(actionButtonContainer);
 toolbar.addView(edittext);

Hope this helps! Best regards,

Ricardo Quiros

WebSteve

unread,
Feb 21, 2013, 10:47:03 AM2/21/13
to phon...@googlegroups.com
I don't see any such file in src/. I looked in all the files in src/ and found none containing anything near 410 lines of code. So where's the inappbrowser.java file if it's not there?

Steve

Simon MacDonald

unread,
Feb 22, 2013, 2:03:13 PM2/22/13
to phonegap
Someone should create a JIRA issue to have the done button be localized or configurable:




--

Ricardo Quirós

unread,
Feb 23, 2013, 5:48:19 AM2/23/13
to phon...@googlegroups.com

I don't see any such file in src/. I looked in all the files in src/ and found none containing anything near 410 lines of code. So where's the inappbrowser.java file if it's not there?

Hi, Steve. You must follow the steps in "http://www.mono-software.com/blog/post/Mono/216/Building-Cordova-2-2-0/", but don't download cordova-2.2.0-incubating-src.zip, download last source zip file from "https://github.com/apache/cordova-android". I don't know why, but incubator version doesn't include InAppBrowser.java. After importing source code in eclipse, you must have the InAppBrowser.java file inside "src/org.apache.cordova" folder. If you browse from "https://github.com/apache/cordova-android" following the links:

    framework > src > org > apache > cordova 


Best regards,

Ricardo.

Ricardo Quirós

unread,
Feb 23, 2013, 5:50:19 AM2/23/13
to phon...@googlegroups.com

Someone should create a JIRA issue to have the done button be localized or configurable:

I've done. I've filled an enhancement request asking for this plugin configuration in new versions. 

Best regards,

Ricardo.

WebSteve

unread,
Jul 2, 2013, 10:55:29 AM7/2/13
to phon...@googlegroups.com
I changed the Done text to another text through the IAB API. See my instructions here:
http://iphonedevlog.wordpress.com/2013/06/27/implementing-inappbrowser-into-a-cordova-phonegap-project/
Reply all
Reply to author
Forward
0 new messages