iOS Question Google translate

John Woodsmall

Active Member
Licensed User
Longtime User
i can run this from my web page: www.astrocye.com/astromatch/general_info_with_google.html

but inside of the safari browser (httputils) it only shows the text not the translat part.

B4X:
<html>
<head>
<meta name="google-translate-customization" content="14f0ba9cf27b646c-a6eeed4bafe9bbe8-gba060b3ed69876fb-11"></meta>
</head>
<body bgcolor=#FFFFFF>
<center><table border=0 WIDTH=468 HEIGHT=60><tr><td>
<div id="google_translate_element"></div>
<script type="text/javascript">
function googleTranslateElementInit() {
  new google.translate.TranslateElement({pageLanguage: 'en', layout: google.translate.TranslateElement.InlineLayout.SIMPLE, gaTrack: true, gaId: 'UA-35172899-1'}, 'google_translate_element');
}
</script>
<script type="text/javascript" src="//translate.google.com/translate_a/element.js?cb=googleTranslateElementInit">
</script><BR>
</td></tr></table></center>
<div align=center><center><table cellpadding=0 cellspacing=5
border=0 align=center>
<font size= 5>
General Info <br/><br/>
To determine the compatibility of two Persons, Astromatch® requires two birthdays.  You
may enter the birthdays by VOICE or MANUALLY.
<br/><br/>
IF VOICE, simply “TAP the GOLD Text Line To Enter 1st Person By VOICE” (above Person 1) and follow
simple instructions on next screen to SPEAK BIRTHDAY for 1st Person.  Next, tap  GOLD text line above Person 2 and repeat procedure.  Then, tap RESULTS button.
<br/><br/>
If MANUALLY, First tap the “Tap to Enter 1st Person” window. A pull-down screen will appear.  Select the Person’s birthday by scrolling through the Months, Days and Years.  Once you have the correct birth month, day and year positioned in the magnified line, tap the “OK Birthday” button.  Do the same for Person 2 (“Tap to Enter 2nd Person”). 
<br/></br>
When you have checked to see if the two Persons’ birthdays are properly entered in the birthday boxes, tap the “Results” button.  Scores generated by the world’s most powerful astrological compatibility engines for Love, Friendship and Business will be delivered by voice, and also displayed graphically.
</font>
</table>
</html>

any ideas?
 
Last edited:
Upvote 0

John Woodsmall

Active Member
Licensed User
Longtime User
This is the call that I make to the html (above). What should it be?

[code|
WebView3.LoadUrl("file://" & File.Combine(File.DirAssets, "general_info_1.html"))

[/code]
 
Upvote 0

John Woodsmall

Active Member
Licensed User
Longtime User
ok did that ; same results:
B4X:
WebView3.LoadUrl("file:https://" & File.Combine(File.DirAssets, "general_info_With_Google.html"))
[code/]
 
Upvote 0

JanPRO

Well-Known Member
Licensed User
Longtime User
Hi,

Erel means the src of the javascript in your html code, try this:

B4X:
WebView.LoadHtml($"
<html>
<head>
<meta name="google-translate-customization" content="14f0ba9cf27b646c-a6eeed4bafe9bbe8-gba060b3ed69876fb-11"></meta>
</head>
<body bgcolor=#FFFFFF>
<center><table border=0 WIDTH=468 HEIGHT=60><tr><td>
<div id="google_translate_element"></div>
<script type="text/javascript">
function googleTranslateElementInit() {
  new google.translate.TranslateElement({pageLanguage: 'en', layout: google.translate.TranslateElement.InlineLayout.SIMPLE, gaTrack: true, gaId: 'UA-35172899-1'}, 'google_translate_element');
}
</script>
<script type="text/javascript" src="https://translate.google.com/translate_a/element.js?cb=googleTranslateElementInit">
</script><BR>
</td></tr></table></center>
<div align=center><center><table cellpadding=0 cellspacing=5
border=0 align=center>
<font size= 5>
General Info <br/><br/>
To determine the compatibility of two Persons, Astromatch® requires two birthdays.  You
may enter the birthdays by VOICE or MANUALLY.
<br/><br/>
IF VOICE, simply “TAP the GOLD Text Line To Enter 1st Person By VOICE” (above Person 1) and follow
simple instructions on next screen to SPEAK BIRTHDAY for 1st Person.  Next, tap  GOLD text line above Person 2 and repeat procedure.  Then, tap RESULTS button.
<br/><br/>
If MANUALLY, First tap the “Tap to Enter 1st Person” window. A pull-down screen will appear.  Select the Person’s birthday by scrolling through the Months, Days and Years.  Once you have the correct birth month, day and year positioned in the magnified line, tap the “OK Birthday” button.  Do the same for Person 2 (“Tap to Enter 2nd Person”).
<br/></br>
When you have checked to see if the two Persons’ birthdays are properly entered in the birthday boxes, tap the “Results” button.  Scores generated by the world’s most powerful astrological compatibility engines for Love, Friendship and Business will be delivered by voice, and also displayed graphically.
</font>
</table>
</html>
    "$)

Jan
 
Upvote 0

John Woodsmall

Active Member
Licensed User
Longtime User
That works great! thanks!
one more thing. Only a part of the list of languages are showing.
try to scroll, it scrolls the text below, but not the list of languages?

any ideas?
 
Upvote 0

John Woodsmall

Active Member
Licensed User
Longtime User
Is there anyway to do the same thing for the face and words in the app?
That is to change the app words like you can change the web page words into another language with google?

(this maybe pie-in-the-sky).
 
Upvote 0
Top