> -----Original Message-----
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED]]On Behalf Of Glenn Carr
> Sent: Tuesday, June 04, 2002 4:36 PM
> To: [EMAIL PROTECTED]
> Subject: RE: [DQSD-Users] googletrans
> Sensitivity: Personal
> 
> 
> The parse is bailing on the ampersand (&) in the comment.  Change the
> ampersand to ' and ' (or whatever).  Also, the <input> tags 
> aren't closed.
> Change them to <input ... /> and it will parse.

OK

> 
> An easy way to check this is to open the .XML file in IE.  It 
> will usually
> show any problems and where they problem is.

Great tip, thank you Glenn ! Now googletrans.xml is fully functional (see attached 
file).

Now I'd like to have "hello world en-fr" to use it, but this requires to play with 
tranlate.js. Right ?

MLL

> 
> 
> -----Original Message-----
> From: MLL [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, June 04, 2002 8:27 AM
> To: [EMAIL PROTECTED]
> Subject: [DQSD-Users] googletrans
> Sensitivity: Personal
> 
> 
> Hi,
> 
> Attached is googletrans.xml, a search made just the same way 
> as freetrans,
> but that uses google translations.
> 
> Upon loading it, QSB gives this pop-up error box : "Unable to 
> load search
> from searches\googletrans.xml: no white space allowed there"
> 
> Could somebody dive into googletrans.xml and tell me what's 
> wrong (I have no
> clue) ?
> 
> TIA
> 
> MLL
> 
> _______________________________________________________________
> 
> Don't miss the 2002 Sprint PCS Application Developer's Conference
> August 25-28 in Las Vegas -- http://devcon.sprintpcs.com/adp/index.cfm
> 
> _______________________________________________
> Dqsd-users mailing list
> [EMAIL PROTECTED]
> https://lists.sourceforge.net/lists/listinfo/dqsd-users
> http://sourceforge.net/mailarchive/forum.php?forum_id=8601
> 
<search function="googletrans">
	<name>Google.com Language Translation</name>
	<description>
		Translate text or webpages from one language to another.<br/>
		<a class="helpboxDescLabels">Switches:</a><br />
		<table class="helpboxDescTable">
			<tr><td>/from:en</td><td>/to:de</td><td> - </td><td>English to German</td></tr>
			<tr><td>/from:en</td><td>/to:es</td><td> - </td><td>English to Spanish</td></tr>
			<tr><td>/from:en</td><td>/to:fr</td><td> - </td><td>English to French</td></tr>
			<tr><td>/from:en</td><td>/to:it</td><td> - </td><td>English to Italian</td></tr>
			<tr><td>/from:en</td><td>/to:pt</td><td> - </td><td>English to Portuguese</td></tr>
			<tr><td>/from:de</td><td>/to:en</td><td> - </td><td>German to English</td></tr>
			<tr><td>/from:de</td><td>/to:fr</td><td> - </td><td>German to French</td></tr>
			<tr><td>/from:es</td><td>/to:en</td><td> - </td><td>Spanish to English</td></tr>
			<tr><td>/from:es</td><td>/to:fr</td><td> - </td><td>Spanish to French</td></tr>
			<tr><td>/from:fr</td><td>/to:en</td><td> - </td><td>French to English</td></tr>
			<tr><td>/from:fr</td><td>/to:de</td><td> - </td><td>French to German</td></tr>
			<tr><td>/from:fr</td><td>/to:es</td><td> - </td><td>French to Spanish</td></tr>
			<tr><td>/from:it</td><td>/to:en</td><td> - </td><td>Italian to English</td></tr>
			<tr><td>/from:pt</td><td>/to:en</td><td> - </td><td>Portuguese to English</td></tr>
		</table>
		<div class="helpboxDescLabels">Examples:</div>
		<table class="helpboxDescTable">
			<tr><td>googletrans /from:en /to:es hello how are you</td></tr>
			<tr><td>googletrans /from:en /to:es http://www.whitehouse.gov</td></tr>
		</table>
	</description>
	<category>Reference</category>
	<link>http://www.google.com/language_tools</link>
	<contributor>MLL, inspired by Neel Doshi &amp; Greg Mitchell's freetrans.xml</contributor>
	
	<form name="googletransfTEXT"
		action="http://translate.google.com/translate_t";
		method="post">
		<input type="hidden" name="text" />
		<input type="hidden" name="langpair" />
	</form>


	<form name="googletransfURL"
		action="http://translate.google.com/translate";>
		<input type="hidden" name="u" />
		<input type="hidden" name="langpair" />
	</form>

	
	<script><![CDATA[
		function googletrans(q)
		{
			if(nullArgs("googletrans", q))
				return false;
			else
			{
				var func_name = "googletrans";
				var switch_list = new Array("from", "to");
				var args = parseArgs(q, switch_list);
		
				// check if the required switches are set
				for (var j = 0; j < switch_list.length; j++)
				{
					if ( typeof args.switch_val[ switch_list[j] ] == "undefined" || args.switch_val[ switch_list[j] ] == "" )
					{
						alert(func_name + ":  /" + switch_list[j] + " switch must be entered.  Type '" + func_name + " ?' to see instructions");
						return false;
					}
				}
		

				// Determine if the string is a url or not
				var strURL = isURL(args.q);
				if (strURL)
				{
					googletransfURL.u.value = strURL;
					googletransfURL.langpair.value = args.switch_val["from"] + "|" + args.switch_val["to"];
					submitForm(googletransfURL);
				}
				else
				{
					googletransfTEXT.text.value = args.q;
					googletransfTEXT.langpair.value = args.switch_val["from"] + "|" + args.switch_val["to"];
					submitForm(googletransfTEXT);
				}
				return true;
			}
		}
	]]></script>
</search>

Reply via email to