RE: [DQSD-Users] googletrans

2002-06-04 Thread MLL



> -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  tags 
> aren't closed.
> Change them to  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
> 



	Google.com Language Translation
	
		Translate text or webpages from one language to another.
		Switches:
		
			/from:en/to:de - English to German
			/from:en/to:es - English to Spanish
			/from:en/to:fr - English to French
			/from:en/to:it - English to Italian
			/from:en/to:pt - English to Portuguese
			/from:de/to:en - German to English
			/from:de/to:fr - German to French
			/from:es/to:en - Spanish to English
			/from:es/to:fr - Spanish to French
			/from:fr/to:en - French to English
			/from:fr/to:de - French to German
			/from:fr/to:es - French to Spanish
			/from:it/to:en - Italian to English
			/from:pt/to:en - Portuguese to English
		
		Examples:
		
			googletrans /from:en /to:es hello how are you
			googletrans /from:en /to:es http://www.whitehouse.gov
		
	
	Reference
	http://www.google.com/language_tools
	MLL, inspired by Neel Doshi & Greg Mitchell's freetrans.xml
	
	http://translate.google.com/translate_t";
		method="post">
		
		
	


	http://translate.google.com/translate";>
		
		
	

	
	<![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;
			}
		}
	]]>




RE: [DQSD-Users] googletrans

2002-06-04 Thread Glenn Carr

The parse is bailing on the ampersand (&) in the comment.  Change the
ampersand to ' and ' (or whatever).  Also, the  tags aren't closed.
Change them to  and it will parse.

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.


-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