FRIHOSTFORUMSFAQTOSBLOGSDIRECTORY
You are invited to Log in or Register a Frihost Account!

Translation javascript

 


Manofgames
I'd like a script that can translate letters into a code, and will translate the code into the alphabet

Basicly, the script substitutes the letters.

An example of the script I want is : http://www.jayssite.com/stuff/l33t/l33t_translator.html

I'd also like it to be easy to edit, so I can change the code and the language.

I might be interested in 'donating' if the script is good Very Happy
Mosquito.Tyler
http://www.jayssite.com/l33t2.js is the source for the javascript that that site uses. I think it would be a fairly simple thing to change the alphabet to a code using snippets of this source-code. Personally, I don't feel like making it for you, but perhaps this will help you, or the person willing.
Manofgames
thanks, i knew about that .js doc before, but i was wanting a custom one because if i modded his, i could get in a lot of trouble Smile.

i suppose i could 'negotiate' lol, but id prefer a custom made one to avoide complications.

if someone could do that for me, frih will change hands and that person will be better off.

thanks for the tip.
Mosquito.Tyler
I was driving home today and thinking about the script you requested, and began to find it kind of interesting. I'll give it a shot.
Manofgames
thanks Tyler!
will give good reward if i like it!

just to clarify, it needs to substitute alphabet for code.

thanks again!
sb3700
This is going to be messy code but someone can clean it up.
Code:

var code = [[e,3],[o,0]];
var string = "pole";//use dom or something to take it from a form if you want

for (i=0; i<string.length; i++){
  for (j=0; j<code.length; j++){
    if (string.charAt(i).toLowerCase() == code[j][0].toLowerCase()){
      string = string.substring(0,i)+code[j][1]+string.substring(i+1,string.length-1);
    }
  }
}
alert(string);


That might work, I'll test later.

My brother needs the comp so i don't have time to test right now and it might need some fine-tuning.
sb3700
change the code to:
Code:

var code = [['e',3],['o',0]];
var string = "pole";//use dom or something to take it from a form if you want

for (i=0; i<string.length; i++){
  for (j=0; j<code.length; j++){
    if (string.charAt(i).toLowerCase() == code[j][0].toLowerCase()){
      string = string.substring(0,i)+code[j][1]+string.substring(i+1,string.length);
    }
  }
}


It works.

In the variable code, just keep adding elements of the form as [original ,replace.

Remember to quote letters/characters.

100% free

Post if you want more features or anything.
Manofgames
How does it work / how can I change the 'Key'

Will give you 10FRIH$ for it even though i don't understand it lol.
Mosquito.Tyler
Yeah. I'm stumped, I've been stumbling around with code and haven't found anything that works. I tried the code posted above, but it doesn't seem to do anything either. Perhaps it's the way I'm doing it: With <textarea>'s.
Reply to topic    Frihost Forum Index -> Scripting -> Html, CSS and Javascript

FRIHOST HOME | FAQ | TOS | ABOUT US | CONTACT US | SITE MAP
© 2005-2007 Frihost, forums powered by phpBB.