Jump to content

Help with translator code.


Julie Indi
 Share

Recommended Posts

I've managed to find a code to create a basic one-word translator for a language I created, but I'm trying to figure out a way to translate paragraphs .. is there any way that I can do this, using a simple translation code? I tried searching on Google and even looking at source code for translation sites, and I'm confused. I'm not that great with JavaScript; I can manipulate it to my liking, but I can't code it .. help? ^_^; Thanks in advance.

Link to comment
Share on other sites

Help? x_X;;This is the code I have currently, I just need to know how to change it from one word at a time to paragraphs, without having exact paragraphs --

<script language="JavaScript"><!--;function asd(word){document.f1.sWord.value= word}function translate(){var e= document.f1.eWord.value;e= new String(e);e= e.toLowerCase();switch (e)

.. . . please? @_@

Link to comment
Share on other sites

  • 2 weeks later...

I'm slightly confused on what you're looking for. Is it, say you've got a paragraph:"Some text in here needs to be translated"and all the words would be individually converted to the new language? If so, the simple way to do it would be a myArray = theString.split(/ /gi)then pass all the values of myArray through your function.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...