{"id":50686,"date":"2020-10-28T03:01:17","date_gmt":"2020-10-27T17:01:17","guid":{"rendered":"http:\/\/www.rjmprogramming.com.au\/ITblog\/?p=50686"},"modified":"2020-10-27T18:16:58","modified_gmt":"2020-10-27T08:16:58","slug":"google-and-mymemory-for-two-translate-share-revisit-tutorial","status":"publish","type":"post","link":"https:\/\/www.rjmprogramming.com.au\/ITblog\/google-and-mymemory-for-two-translate-share-revisit-tutorial\/","title":{"rendered":"Google and MyMemory for Two Translate Share Revisit Tutorial"},"content":{"rendered":"<div style=\"width: 230px\" class=\"wp-caption alignnone\"><a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/YQL\/GoogleTranslate\/google_four_translate.html\"><img decoding=\"async\" style=\"float:left; border: 15px solid pink;\" alt=\"Google and MyMemory for Two Translate Share Revisit Tutorial\" src=\"http:\/\/www.rjmprogramming.com.au\/PHP\/YQL\/GoogleTranslate\/four_voices_mymemory.jpg\" title=\"Google and MyMemory for Two Translate Share Revisit Tutorial\"  \/><\/a><p class=\"wp-caption-text\">Google and MyMemory for Two Translate Share Revisit Tutorial<\/p><\/div>\n<p>The web application of the recent <a title='Google for Two Translate Share Revisit Tutorial' href='#gttsrt'>Google for Two Translate Share Revisit Tutorial<\/a> has undergone another makeover.  This makeover simplifies and adds in today&#8217;s work &#8230;<\/p>\n<ul>\n<li>we compartmentalize language translations &#8230;\n<ol>\n<li><a target=_blank title='MyMemory API ... thanks' href='http:\/\/mymemory.translated.net\/doc\/spec.php'>MyMemory API<\/a> now does all the &#8220;Translate the language&#8221; work (ditching all references to the old YQL ideas) &#8230; via <a target=_blank title='google_four_translate.php' href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/Geographicals\/diff.php?one=http:\/\/www.rjmprogramming.com.au\/PHP\/YQL\/GoogleTranslate\/google_four_translate.php----GETME\">the changed<\/a> <a target=_blank title='google_four_translate.php' href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/YQL\/GoogleTranslate\/google_four_translate.php----GETME\">google_four_translate.php<\/a><\/li>\n<li><a target=_blank title='Google Translate' href='http:\/\/translate.google.com'>Google Translate<\/a> does all the &#8220;Hearing the language&#8221; work<\/li>\n<\/ol>\n<\/li>\n<li>we add more of those great (more dialectic feeling) language choices that the <a target=_blank title='MyMemory API ... thanks' href='http:\/\/mymemory.translated.net\/doc\/spec.php'>MyMemory API<\/a> offers &#8230; via <a target=_blank title='google_four_translate.html' href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/Geographicals\/diff.php?one=http:\/\/www.rjmprogramming.com.au\/PHP\/YQL\/GoogleTranslate\/google_four_translate.html----GETME\">the changed<\/a> <a target=_blank title='google_four_translate.html' href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/YQL\/GoogleTranslate\/google_four_translate.html----GETME\">google_four_translate.html<\/a><\/li>\n<\/ul>\n<p>Maybe you can give a go to the newly arranged <a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/YQL\/GoogleTranslate\/google_four_translate.html\" title=\"Click picture\">live run<\/a> link&#8217;s web application below, to see what we mean here &#8230;<\/p>\n<p><iframe src=\"http:\/\/www.rjmprogramming.com.au\/PHP\/YQL\/GoogleTranslate\/google_four_translate.html\" style=\"width:100%;height:800px;\"><\/iframe><\/p>\n<p><!--p>You can also see this play out at WordPress 4.1.1's <a target=_blank  href='\/\/www.rjmprogramming.com.au\/ITblog\/google-and-mymemory-for-two-translate-share-revisit-tutorial\/'>Google and MyMemory for Two Translate Share Revisit Tutorial<\/a>.<\/p-->\n<hr>\n<p id='gttsrt'>Previous relevant <a target=_blank title='Google for Two Translate Share Revisit Tutorial' href='\/\/www.rjmprogramming.com.au\/ITblog\/google-for-two-translate-share-revisit-tutorial\/'>Google for Two Translate Share Revisit Tutorial<\/a> is shown below.<\/p>\n<div style=\"width: 230px\" class=\"wp-caption alignnone\"><a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/YQL\/GoogleTranslate\/google_four_translate.html\"><img decoding=\"async\" style=\"float:left; border: 15px solid pink;\" alt=\"Google for Two Translate Share Revisit Tutorial\" src=\"http:\/\/www.rjmprogramming.com.au\/PHP\/YQL\/GoogleTranslate\/gfortwo.jpg\" title=\"Google for Two Translate Share Revisit Tutorial\"  \/><\/a><p class=\"wp-caption-text\">Google for Two Translate Share Revisit Tutorial<\/p><\/div>\n<p>It was some time ago, now, we left you, regarding our &#8220;Google for Two Translate Share Tutorial&#8221; project with &#8230;<\/p>\n<blockquote>\n<p><b>Stop Press 26\/5\/2015:<\/b><\/p>\n<p>Translation arrangements needed amendment, and in order to facilitate this we called on, and thank, the tremendous <a target=_blank title='MyMemory API ... thanks' href='http:\/\/mymemory.translated.net\/doc\/spec.php'>MyMemory API<\/a> resource, coupled with more PHP changes as per <a target=_blank title='google_four_translate.php' href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/Geographicals\/diff.php?one=http:\/\/www.rjmprogramming.com.au\/PHP\/YQL\/GoogleTranslate\/google_four_translate.php---GETME\">google_four_translate.php<\/a> link.<\/p>\n<\/blockquote>\n<p> &#8230; springing, again, to mind, a bit, because our recent <a target=_blank title='Italian French Spanish Verb Conjugation Text to Speech Tutorial' href='https:\/\/www.rjmprogramming.com.au\/ITblog\/italian-french-spanish-verb-conjugation-text-to-speech-tutorial\/'>Italian French Spanish Verb Conjugation Text to Speech Tutorial<\/a> also made use of the wonderful <a target=_blank title='MyMemory API ... thanks' href='http:\/\/mymemory.translated.net\/doc\/spec.php'>MyMemory API<\/a> and the stupendous <a target=_blank title='Google Translate' href='http:\/\/translate.google.com'>Google Translate<\/a> services &#8230; thanks.<\/p>\n<p>We&#8217;ve revisited for a number of reasons &#8230;<\/p>\n<ul>\n<li>there was a lot of that old CSS &#8220;sinful&#8221; <i>align=&#8217;center&#8217;<\/i> usage we talked about at <a target=_blank title='W3C XHTML Nu Checker Validation Primer Tutorial' href='https:\/\/www.rjmprogramming.com.au\/ITblog\/w3c-xhtml-nu-checker-validation-primer-tutorial\/'>W3C XHTML Nu Checker Validation Primer Tutorial<\/a> going on which we diligently changed to <i>style=&#8221; width:100%;text-align:center; &#8220;<\/i> for all but the HTML <i>td<\/i> table cells using this syntax, where it was better to say <i>style=&#8221; width:33%;text-align:center; &#8220;<\/i> a bit counterintuitively, we thought, but that way, perhaps because we didn&#8217;t specify anything about their parent HTML <i>tr<\/i> table rows, perhaps<\/li>\n<li>the Google Translate usage was channelling that <a target=_blank title='Old Google Text to Speech service' href='http:\/\/translate.google.com\/translate_tts'>old Text to Speech &#8220;translate_tts&#8221; approach<\/a>, which is better, now, left out of the equation in favour of the traditional <a target=_blank title='Google Translate' href='http:\/\/translate.google.com'>Google Translate<\/a> <a target=_blank title='HTML window.open information from w3schools' href='http:\/\/www.w3schools.com\/jsref\/met_win_open.asp'>popup window<\/a> translation and text to speech capabilities that rely on the user clicking a Google button to hear the Text to Speech translation<\/li>\n<li>we found fewer bad <a target=_blank title='MyMemory API ... thanks' href='http:\/\/mymemory.translated.net\/doc\/spec.php'>MyMemory API<\/a> translations if we looked through the translation ideas offered, rather than just settling, always, for the first one<\/li>\n<li>we&#8217;d forgotten that with non-English words you can have UTF-8 characters involved, and as <a target=_blank title='MyMemory API ... thanks' href='http:\/\/mymemory.translated.net\/doc\/spec.php'>MyMemory API<\/a> returns this as &#8230; English &#8220;yes&#8221; to Italian  &#8230;<br \/>\n<code><br \/>\ns\\u00ed<br \/>\n<\/code><br \/>\n&#8230; so we set to work, with the whole of the wonderful web helping world to arrive <a target=_blank title='Useful link' href='http:\/\/stackoverflow.com\/questions\/2934563\/how-to-decode-unicode-escape-sequences-like-u00ed-to-proper-utf-8-encoded-cha'>here<\/a> to PHP ideas to help, finally resulting in the PHP function &#8230;<br \/>\n<code><br \/>\nfunction unicode2html($str) {  \/\/ thanks to http:\/\/stackoverflow.com\/questions\/2934563\/how-to-decode-unicode-escape-sequences-like-u00ed-to-proper-utf-8-encoded-cha<br \/>\n    $i=65535;<br \/>\n    while($i&gt;0){<br \/>\n        $hex=dechex($i);<br \/>\n        if (strlen($hex) == 3) {<br \/>\n        $str=str_replace(\"\\u0$hex\",\"&amp;#$i;\",$str);<br \/>\n        } else if (strlen($hex) == 2) {<br \/>\n        $str=str_replace(\"\\u00$hex\",\"&amp;#$i;\",$str);<br \/>\n        } else if (strlen($hex) == 1) {<br \/>\n        $str=str_replace(\"\\u000$hex\",\"&amp;#$i;\",$str);<br \/>\n        } else {<br \/>\n        $str=str_replace(\"\\u$hex\",\"&amp;#$i;\",$str);<br \/>\n        }<br \/>\n        $i--;<br \/>\n     }<br \/>\n     return $str;<br \/>\n}<br \/>\n<\/code><br \/>\n&#8230; to arrive at (assuming you&#8217;ve included <i>&lt;meta charset=&#8221;utf-8&#8243;&gt;<\/i> within <i>&lt;head&gt;<\/i> and <i>&lt;\/head&gt;<\/i>) &#8230;<br \/>\n<code><br \/>\ns\u00ec<br \/>\n<\/code>\n<\/ul>\n<p>The HTML and Javascript and CSS supervisory code you could call <a target=_blank title='google_four_translate.php' href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/YQL\/GoogleTranslate\/google_four_translate.html---GETME\">google_four_translate.html<\/a> changed <a target=_blank title='google_four_translate.php' href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/Geographicals\/diff.php?one=http:\/\/www.rjmprogramming.com.au\/PHP\/YQL\/GoogleTranslate\/google_four_translate.html---GETME\">this way<\/a>.<\/p>\n<p>The PHP supervised code you could call <a target=_blank title='google_four_translate.php' href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/YQL\/GoogleTranslate\/google_four_translate.php----GETME\">google_four_translate.php<\/a> changed <a target=_blank title='google_four_translate.php' href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/Geographicals\/diff.php?one=http:\/\/www.rjmprogramming.com.au\/PHP\/YQL\/GoogleTranslate\/google_four_translate.php----GETME\">this way<\/a>.<\/p>\n<p>Aren&#8217;t code revisits such fun?!<\/p>\n<hr>\n<p id='yywjgfrtst'>Previous relevant <a target=_blank title='Yahoo YQL Web JSON Google for Two Translate Share Tutorial' href='https:\/\/www.rjmprogramming.com.au\/ITblog\/yahoo-yql-web-json-google-for-two-translate-share-tutorial\/'>Yahoo YQL Web JSON Google for Two Translate Share Tutorial<\/a> is shown below.<\/p>\n<div style=\"width: 230px\" class=\"wp-caption alignnone\"><a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/YQL\/GoogleTranslate\/google_four_translate.html\"><img decoding=\"async\" style=\"float:left; border: 15px solid pink;\" alt=\"Yahoo YQL Web JSON Google for Two Translate Share Tutorial\" src=\"http:\/\/www.rjmprogramming.com.au\/PHP\/YQL\/GoogleTranslate\/Google_Translate_236_YQL.jpg\" title=\"Yahoo YQL Web JSON Google for Two Translate Share Tutorial\" id=\"iyy\" onmouseover=\" this.src=this.src.replace('_241_','~236~').replace('_236_','~237~').replace('_237_','~238~').replace('_238_','~239~').replace('_239_','~240~').replace('_240_','~241~').replace('~','_').replace('~','_');    \"  \/><\/a><p class=\"wp-caption-text\">Yahoo YQL Web JSON Google for Two Translate Share Tutorial<\/p><\/div>\n<p>Today we continue on with Yahoo Web Services called YQL, building on previous tutorial here at <a target=_blank href='#yywjgfttst' title='Yahoo YQL Web JSON Google for Two Translate Speech Tutorial'>Yahoo YQL Web JSON Google for Two Translate Speech Tutorial<\/a> as shown below.   The name is the way it is because it simplified the API aspects of its functionality for the developer to concentrate on SQL, and I&#8217;m really supportive of this concept.  You don&#8217;t have to output in JSON, as other data forms like XML are acceptable.  Let&#8217;s see what Wikipedia says about YQL below. <\/p>\n<blockquote>\n<p>Yahoo! Query Language (YQL) is an SQL-like query language created by Yahoo! as part of their Developer Network. YQL is designed to retrieve and manipulate data from APIs through a single Web interface, thus allowing mashups that enable developers to create their own applications.[1]<\/p>\n<p>Initially launched in October 2008 with access to Yahoo APIs,[2] February 2009 saw the addition of open data tables from third parties such as Google Reader, the Guardian, and The New York Times.[3] Some of these APIs still require an API key to access them. On April 29th of 2009, Yahoo introduced the capability to execute the tables of data built through YQL using JavaScript run on the company&#8217;s servers for free.[3]<\/p>\n<\/blockquote>\n<p>So this tutorial uses a YQL web service into the data emanating from its links to the Google Translate google.translate database with Yahoo YQL website &#8230; thanks.  You join up with a person talking in another language, share the computer, or tablet, and type your single sentences, one at a time, into your relevant HTML textarea element, get it translated into the other language, which you&#8217;ve first selected from a dropdown, and then the other user has their go &#8230; if you want you can be totally silent (but probably laughing a lot).  We extended the functionality yesterday to allow the users to hear an audio interpretation of their words in a <a target=_blank title='Javascript windows.open method information at w3schools' href='http:\/\/www.w3schools.com\/jsref\/met_win_open.asp'>window.open<\/a> popup window calling on the amazing Google Translate <a target=_blank title='Google Translate Text-to-Speech functionality' href='http:\/\/techcrunch.com\/2009\/12\/14\/the-unofficial-google-text-to-speech-api\/'>Text-to-Speech functionality<\/a>.  Today we further extend functionality by allowing the users to save their conversation session to share with others, optionally, by sending these friends or interested parties an email that will recreate the conversation scenario with a link they activate off the email.<\/p>\n<p>The two big PHP functions of use for this are:<\/p>\n<ul>\n<li><a target=_blank title='file_get_contents' href='http:\/\/us1.php.net\/file_get_contents'>file_get_contents<\/a><\/li>\n<li><a target=_blank title='json_decode' href='http:\/\/php.net\/manual\/en\/function.json-decode.php'>json_decode<\/a> &#8230; when there is a data structure of any complexity, this function is highly recommended<\/li>\n<\/ul>\n<p>Good links for information regarding this tutorial (thanks) are:<\/p>\n<ul>\n<li><a target=_blank href='http:\/\/developer.yahoo.com\/yql\/guide\/two-minute-tutorial.html' title='YQL Two Minute Tutorial'>YQL Two Minute Tutorial<\/a> from Yahoo<\/li>\n<li><a target=_blank href='http:\/\/en.wikipedia.org\/wiki\/Yahoo!_Query_Language' title='Yahoo! Query Language'>Yahoo! Query Language<\/a> from Wikipedia, as per quote above<\/li>\n<li><a target=_blank href='http:\/\/developer.yahoo.com\/yql\/' title='YQL Home Page'>YQL Home Page<\/a> from Yahoo<\/li>\n<li><a target=_blank href='https:\/\/developer.yahoo.com\/yql\/console\/?q=select%20*%20from%20flickr.photos.interestingness%2820%29&#038;env=store:\/\/datatables.org\/alltableswithkeys#h=select+*+from+google.translate+where+q%3D%22what+is+that%22+and+target%3D%22de%22%3B' title='YQL google.translate help'>YQL google.translate help<\/a> from Yahoo<\/li>\n<li><a target=_blank title='YQL JSON Parsing Help' href='http:\/\/developer.yahoo.com\/forum\/YQL\/yql-query-intermittently-returns-no-results\/1374521623593-fa4a3519-10ae-4a17-8fd4-6de45a159d6f'>YQL JSON Parsing Help<\/a> from YQL forum<\/li>\n<\/ul>\n<p>Another tool you should have in your armoury for jobs like this is the online JSON validator <a target=_blank title='JSON validator online' href='http:\/\/jsonlint.com\/'>here<\/a>.  A generic JSON approach to issues could be:<\/p>\n<ol>\n<li>Type the URL you were given into a web browser address bar and have a look at it<\/li>\n<li>Type the URL you were given into http:\/\/jsonlint.com\/ and have it validated<\/li>\n<li>Understand in your own mind what would be different about 1. to make it suitable<\/li>\n<li>Incorporate findings of 3. into massaging of data between file_get_contents and json_decode<\/li>\n<\/ol>\n<p>Here is a link to some downloadable HTML programming source code which you may want to rename to <a target=_blank title='google_four_translate.html' href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/YQL\/GoogleTranslate\/google_four_translate.html--GETME\">google_four_translate.html<\/a> which calls some downloadable PHP programming source code which you may want to rename to <a target=_blank title='google_four_translate.php' href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/YQL\/GoogleTranslate\/google_four_translate.php--GETME\">google_four_translate.php<\/a> (and then there is a <a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/YQL\/GoogleTranslate\/google_four_translate.html\" title=\"Click picture\">live run<\/a>).   For the modifications of today, the HTML changes are presented with <a target=_blank title='google_four_translate.html' href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/Geographicals\/diff.php?one=http:\/\/www.rjmprogramming.com.au\/PHP\/YQL\/GoogleTranslate\/google_four_translate.html--GETME\">google_four_translate.html<\/a> link and the PHP changes are presented with <a target=_blank title='google_four_translate.php' href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/Geographicals\/diff.php?one=http:\/\/www.rjmprogramming.com.au\/PHP\/YQL\/GoogleTranslate\/google_four_translate.php--GETME\">google_four_translate.php<\/a> link.<\/p>\n<p><b>Stop Press 26\/5\/2015:<\/b><\/p>\n<p>Translation arrangements needed amendment, and in order to facilitate this we called on, and thank, the tremendous <a target=_blank title='MyMemory API ... thanks' href='http:\/\/mymemory.translated.net\/doc\/spec.php'>MyMemory API<\/a> resource, coupled with more PHP changes as per <a target=_blank title='google_four_translate.php' href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/Geographicals\/diff.php?one=http:\/\/www.rjmprogramming.com.au\/PHP\/YQL\/GoogleTranslate\/google_four_translate.php---GETME\">google_four_translate.php<\/a> link.<\/p>\n<hr \/>\n<p id='yywjgfttst'>Previous relevant <a target=_blank href='http:\/\/www.rjmprogramming.com.au\/wordpress\/?p=11226' title='Yahoo YQL Web JSON Google for Two Translate Speech Tutorial'>Yahoo YQL Web JSON Google for Two Translate Speech Tutorial<\/a> is shown below.<\/p>\n<div style=\"width: 230px\" class=\"wp-caption alignnone\"><a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/YQL\/GoogleTranslate\/google_four_translate.html\"><img decoding=\"async\" style=\"float:left; border: 15px solid pink;\" alt=\"Yahoo YQL Web JSON Google for Two Translate Speech Tutorial\" src=\"http:\/\/www.rjmprogramming.com.au\/PHP\/YQL\/GoogleTranslate\/Google_Translate__Listen_YQL.jpg\" title=\"Yahoo YQL Web JSON Google for Two Translate Speech Tutorial\"  \/><\/a><p class=\"wp-caption-text\">Yahoo YQL Web JSON Google for Two Translate Speech Tutorial<\/p><\/div>\n<p>Today we continue with  Yahoo Web Services called YQL, building on previous tutorial here at <a target=_blank href=\"#yywsjgfttt\" title=\"Yahoo YQL Web Service JSON Google for Two Translate Tutorial\">Yahoo YQL Web Service JSON Google for Two Translate Tutorial<\/a> as shown below.   The name is the way it is because it simplified the API aspects of its functionality for the developer to concentrate on SQL, and I&#8217;m really supportive of this concept.  You don&#8217;t have to output in JSON, as other data forms like XML are acceptable.  Let&#8217;s see what Wikipedia says about YQL below. <\/p>\n<blockquote>\n<p>Yahoo! Query Language (YQL) is an SQL-like query language created by Yahoo! as part of their Developer Network. YQL is designed to retrieve and manipulate data from APIs through a single Web interface, thus allowing mashups that enable developers to create their own applications.[1]<\/p>\n<p>Initially launched in October 2008 with access to Yahoo APIs,[2] February 2009 saw the addition of open data tables from third parties such as Google Reader, the Guardian, and The New York Times.[3] Some of these APIs still require an API key to access them. On April 29th of 2009, Yahoo introduced the capability to execute the tables of data built through YQL using JavaScript run on the company&#8217;s servers for free.[3]<\/p>\n<\/blockquote>\n<p>So this tutorial uses a YQL web service into the data emanating from its links to the Google Translate google.translate database with Yahoo YQL website &#8230; thanks.  You join up with a person talking in another language, share the computer, or tablet, and type your single sentences, one at a time, into your relevant HTML textarea element, get it translated into the other language, which you&#8217;ve first selected from a dropdown, and then the other user has their go &#8230; if you want you can be totally silent (but probably laughing a lot).  We&#8217;ve extended the functionality today to allow the users to hear an audio interpretation of their words in a <a target=_blank title='Javascript windows.open method information at w3schools' href='http:\/\/www.w3schools.com\/jsref\/met_win_open.asp'>window.open<\/a> popup window calling on the amazing Google Translate <a target=_blank title='Google Translate Text-to-Speech functionality' href='http:\/\/techcrunch.com\/2009\/12\/14\/the-unofficial-google-text-to-speech-api\/'>Text-to-Speech functionality<\/a>.<\/p>\n<p>The two big PHP functions of use for this are:<\/p>\n<ul>\n<li><a target=_blank title='file_get_contents' href='http:\/\/us1.php.net\/file_get_contents'>file_get_contents<\/a><\/li>\n<li><a target=_blank title='json_decode' href='http:\/\/php.net\/manual\/en\/function.json-decode.php'>json_decode<\/a> &#8230; when there is a data structure of any complexity, this function is highly recommended<\/li>\n<\/ul>\n<p>Good links for information regarding this tutorial (thanks) are:<\/p>\n<ul>\n<li><a target=_blank href='http:\/\/developer.yahoo.com\/yql\/guide\/two-minute-tutorial.html' title='YQL Two Minute Tutorial'>YQL Two Minute Tutorial<\/a> from Yahoo<\/li>\n<li><a target=_blank href='http:\/\/en.wikipedia.org\/wiki\/Yahoo!_Query_Language' title='Yahoo! Query Language'>Yahoo! Query Language<\/a> from Wikipedia, as per quote above<\/li>\n<li><a target=_blank href='http:\/\/developer.yahoo.com\/yql\/' title='YQL Home Page'>YQL Home Page<\/a> from Yahoo<\/li>\n<li><a target=_blank href='https:\/\/developer.yahoo.com\/yql\/console\/?q=select%20*%20from%20flickr.photos.interestingness%2820%29&#038;env=store:\/\/datatables.org\/alltableswithkeys#h=select+*+from+google.translate+where+q%3D%22what+is+that%22+and+target%3D%22de%22%3B' title='YQL google.translate help'>YQL google.translate help<\/a> from Yahoo<\/li>\n<li><a target=_blank title='YQL JSON Parsing Help' href='http:\/\/developer.yahoo.com\/forum\/YQL\/yql-query-intermittently-returns-no-results\/1374521623593-fa4a3519-10ae-4a17-8fd4-6de45a159d6f'>YQL JSON Parsing Help<\/a> from YQL forum<\/li>\n<\/ul>\n<p>Another tool you should have in your armoury for jobs like this is the online JSON validator <a target=_blank title='JSON validator online' href='http:\/\/jsonlint.com\/'>here<\/a>.  A generic JSON approach to issues could be:<\/p>\n<ol>\n<li>Type the URL you were given into a web browser address bar and have a look at it<\/li>\n<li>Type the URL you were given into http:\/\/jsonlint.com\/ and have it validated<\/li>\n<li>Understand in your own mind what would be different about 1. to make it suitable<\/li>\n<li>Incorporate findings of 3. into massaging of data between file_get_contents and json_decode<\/li>\n<\/ol>\n<p>Here is a link to some downloadable HTML programming source code which you may want to rename to <a target=_blank title='google_four_translate.html' href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/YQL\/GoogleTranslate\/google_four_translate.html-GETME\">google_four_translate.html<\/a> which calls some downloadable PHP programming source code which you may want to rename to <a target=_blank title='google_four_translate.php' href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/YQL\/GoogleTranslate\/google_four_translate.php-GETME\">google_four_translate.php<\/a> (and then there is a <a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/YQL\/GoogleTranslate\/google_four_translate.html\" title=\"Click picture\">live run<\/a>).   For the modifications of today, only the HTML needed to change, believe it or not, and these changes are presented with <a target=_blank title='google_four_translate.html' href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/Geographicals\/diff.php?one=http:\/\/www.rjmprogramming.com.au\/PHP\/YQL\/GoogleTranslate\/google_four_translate.html-GETME\">google_four_translate.html<\/a> link.<\/p>\n<hr \/>\n<p id=\"yywsjgfttt\">Previous relevant <a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/wordpress\/?p=11215\" title=\"Yahoo YQL Web Service JSON Google for Two Translate Tutorial\">Yahoo YQL Web Service JSON Google for Two Translate Tutorial<\/a> is shown below.<\/p>\n<div style=\"width: 230px\" class=\"wp-caption alignnone\"><a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/YQL\/GoogleTranslate\/google_four_translate.html\"><img decoding=\"async\" style=\"float:left; border: 15px solid pink;\" alt=\"Yahoo YQL Web Service JSON Google for Two Translate Tutorial\" src=\"http:\/\/www.rjmprogramming.com.au\/PHP\/YQL\/GoogleTranslate\/Google_Translate_YQL.jpg\" title=\"Yahoo YQL Web Service JSON Google for Two Translate Tutorial\"  \/><\/a><p class=\"wp-caption-text\">Yahoo YQL Web Service JSON Google for Two Translate Tutorial<\/p><\/div>\n<p>Here is a tutorial that might be re-introducing you to the Yahoo Web Services called YQL, building on previous ones here at this <a href='http:\/\/www.rjmprogramming.com.au\/wordpress\/?tag=YQL' title='Yahoo YQL tutorials here'>blog<\/a>.   The name is the way it is because it simplified the API aspects of its functionality for the developer to concentrate on SQL, and I&#8217;m really supportive of this concept.  You don&#8217;t have to output in JSON, as other data forms like XML are acceptable.  Let&#8217;s see what Wikipedia says about YQL below. <\/p>\n<blockquote>\n<p>Yahoo! Query Language (YQL) is an SQL-like query language created by Yahoo! as part of their Developer Network. YQL is designed to retrieve and manipulate data from APIs through a single Web interface, thus allowing mashups that enable developers to create their own applications.[1]<\/p>\n<p>Initially launched in October 2008 with access to Yahoo APIs,[2] February 2009 saw the addition of open data tables from third parties such as Google Reader, the Guardian, and The New York Times.[3] Some of these APIs still require an API key to access them. On April 29th of 2009, Yahoo introduced the capability to execute the tables of data built through YQL using JavaScript run on the company&#8217;s servers for free.[3]<\/p>\n<\/blockquote>\n<p>So this tutorial uses a YQL web service into the data emanating from its links to the Google Translate google.translate database with Yahoo YQL website &#8230; thanks.  You join up with a person talking in another language, share the computer, or tablet, and type your single sentences, one at a time, into your relevant HTML textarea element, get it translated into the other language, which you&#8217;ve first selected from a dropdown, and then the other user has their go &#8230; if you want you can be totally silent (but probably laughing a lot).<\/p>\n<p>The two big PHP functions of use for this are:<\/p>\n<ul>\n<li><a target=_blank title='file_get_contents' href='http:\/\/us1.php.net\/file_get_contents'>file_get_contents<\/a><\/li>\n<li><a target=_blank title='json_decode' href='http:\/\/php.net\/manual\/en\/function.json-decode.php'>json_decode<\/a> &#8230; when there is a data structure of any complexity, this function is highly recommended &#8230; just not with <a target=_blank title='Just like Mrs Cropley' href='http:\/\/turkeysandwich.wordpress.com\/2009\/05\/12\/yes-its-a-tuna-jello-pie\/'>tuna and jell-o pie<\/a><\/li>\n<\/ul>\n<p>Good links for information regarding this tutorial (thanks) are:<\/p>\n<ul>\n<li><a target=_blank href='http:\/\/developer.yahoo.com\/yql\/guide\/two-minute-tutorial.html' title='YQL Two Minute Tutorial'>YQL Two Minute Tutorial<\/a> from Yahoo<\/li>\n<li><a target=_blank href='http:\/\/en.wikipedia.org\/wiki\/Yahoo!_Query_Language' title='Yahoo! Query Language'>Yahoo! Query Language<\/a> from Wikipedia, as per quote above<\/li>\n<li><a target=_blank href='http:\/\/developer.yahoo.com\/yql\/' title='YQL Home Page'>YQL Home Page<\/a> from Yahoo<\/li>\n<li><a target=_blank href='https:\/\/developer.yahoo.com\/yql\/console\/?q=select%20*%20from%20flickr.photos.interestingness%2820%29&#038;env=store:\/\/datatables.org\/alltableswithkeys#h=select+*+from+google.translate+where+q%3D%22what+is+that%22+and+target%3D%22de%22%3B' title='YQL google.translate help'>YQL google.translate help<\/a> from Yahoo<\/li>\n<li><a target=_blank title='YQL JSON Parsing Help' href='http:\/\/developer.yahoo.com\/forum\/YQL\/yql-query-intermittently-returns-no-results\/1374521623593-fa4a3519-10ae-4a17-8fd4-6de45a159d6f'>YQL JSON Parsing Help<\/a> from YQL forum<\/li>\n<\/ul>\n<p>Another tool you should have in your armoury for jobs like this is the online JSON validator <a target=_blank title='JSON validator online' href='http:\/\/jsonlint.com\/'>here<\/a>.  A generic JSON approach to issues could be:<\/p>\n<ol>\n<li>Type the URL you were given into a web browser address bar and have a look at it<\/li>\n<li>Type the URL you were given into http:\/\/jsonlint.com\/ and have it validated<\/li>\n<li>Understand in your own mind what would be different about 1. to make it suitable<\/li>\n<li>Incorporate findings of 3. into massaging of data between file_get_contents and json_decode<\/li>\n<\/ol>\n<p>Here is a link to some downloadable HTML programming source code which you may want to rename to <a target=_blank title='google_four_translate.html' href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/YQL\/GoogleTranslate\/google_four_translate.html_GETME\">google_four_translate.html<\/a> which calls some downloadable PHP programming source code which you may want to rename to <a target=_blank title='google_four_translate.php' href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/YQL\/GoogleTranslate\/google_four_translate.php_GETME\">google_four_translate.php<\/a> (and then there is a <a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/YQL\/GoogleTranslate\/google_four_translate.html\" title=\"Click picture\">live run<\/a>).<\/p>\n<p>If this was interesting you may be interested in <a title='Click here to see topics in which you might be interested' href='#d11215' onclick='var dv=document.getElementById(\"d11215\"); dv.innerHTML = \"&lt;iframe width=670 height=600 src=\" + \"http:\/\/www.rjmprogramming.com.au\/wordpress\/?tag=JSON\" + \"&gt;&lt;\/iframe&gt;\"; dv.style.display = \"block\";'>this<\/a> too.<\/p>\n<div id='d11215' style='display: none; border-left: 2px solid green; border-top: 2px solid green;'><\/div>\n<hr \/>\n<p>If this was interesting you may be interested in <a title='Click here to see topics in which you might be interested' href='#d11226' onclick='var dv=document.getElementById(\"d11226\"); dv.innerHTML = \"&lt;iframe width=670 height=600 src=\" + \"http:\/\/www.rjmprogramming.com.au\/wordpress\/?tag=speech\" + \"&gt;&lt;\/iframe&gt;\"; dv.style.display = \"block\";'>this<\/a> too.<\/p>\n<div id='d11226' style='display: none; border-left: 2px solid green; border-top: 2px solid green;'><\/div>\n<hr \/>\n<p>If this was interesting you may be interested in <a title='Click here to see topics in which you might be interested' href='#d11240' onclick='var dv=document.getElementById(\"d11240\"); dv.innerHTML = \"&lt;iframe width=670 height=600 src=\" + \"http:\/\/www.rjmprogramming.com.au\/wordpress\/?tag=email\" + \"&gt;&lt;\/iframe&gt;\"; dv.style.display = \"block\";'>this<\/a> too.<\/p>\n<div id='d11240' style='display: none; border-left: 2px solid green; border-top: 2px solid green;'><\/div>\n<hr>\n<p>If this was interesting you may be interested in <a title='Click here to see topics in which you might be interested' href='#d21963' onclick='var dv=document.getElementById(\"d21963\"); dv.innerHTML = \"&lt;iframe width=670 height=600 src=\" + \"http:\/\/www.rjmprogramming.com.au\/wordpress\/?tag=css\" + \"&gt;&lt;\/iframe&gt;\"; dv.style.display = \"block\";'>this<\/a> too.<\/p>\n<div id='d21963' style='display: none; border-left: 2px solid green; border-top: 2px solid green;'><\/div>\n<hr>\n<p>If this was interesting you may be interested in <a title='Click here to see topics in which you might be interested' href='#d50686' onclick='var dv=document.getElementById(\"d50686\"); dv.innerHTML = \"&lt;iframe width=670 height=600 src=\" + \"https:\/\/www.rjmprogramming.com.au\/ITblog\/tag\/mymemory\" + \"&gt;&lt;\/iframe&gt;\"; dv.style.display = \"block\";'>this<\/a> too.<\/p>\n<div id='d50686' style='display: none; border-left: 2px solid green; border-top: 2px solid green;'><\/div>\n","protected":false},"excerpt":{"rendered":"<p>The web application of the recent Google for Two Translate Share Revisit Tutorial has undergone another makeover. This makeover simplifies and adds in today&#8217;s work &#8230; we compartmentalize language translations &#8230; MyMemory API now does all the &#8220;Translate the language&#8221; &hellip; <a href=\"https:\/\/www.rjmprogramming.com.au\/ITblog\/google-and-mymemory-for-two-translate-share-revisit-tutorial\/\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[12,14,37],"tags":[88,2525,429,532,576,587,652,1560,1573,2411,932,997,1300,1301,1319],"class_list":["post-50686","post","type-post","status-publish","format-standard","hentry","category-elearning","category-event-driven-programming","category-tutorials","tag-api","tag-child","tag-file_get_contents","tag-google-translate","tag-html","tag-iframe","tag-javascript","tag-language","tag-mymemory","tag-parent","tag-php","tag-programming","tag-translate","tag-translation","tag-tutorial"],"_links":{"self":[{"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/posts\/50686"}],"collection":[{"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/comments?post=50686"}],"version-history":[{"count":8,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/posts\/50686\/revisions"}],"predecessor-version":[{"id":50694,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/posts\/50686\/revisions\/50694"}],"wp:attachment":[{"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/media?parent=50686"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/categories?post=50686"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/tags?post=50686"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}