I’m trying to put together a Multilingual Text Calculator using just plain Javascript (not JQuery) as this is to help with revision on a past paper for uni. I’ve had a good go at it and created a version that does work based on two languages – English and French, however not without its flaws.
How would I go about creating a two dimensional array for each language? So for example if I wanted to do:
myEnglishArray = ["one", 1];
or
myEnglishArray = ["one", "1"];
I don’t even know if thats correct or not but basically I need to go from 1 to 10 in English and the same with french and map each number in textual sense (i.e. “one”) to the number in integer sense. I could of course convert a number within a string (i.e “1”) using parseInt();
Any help would be great here!
Here you just have to create 1 variable to contain 3 information at a time (number, English, Spanish). And also, you can easily add more languages after Spanish too!
DEMO: http://jsfiddle.net/DerekL/5fhTw/