Hi there.
I built an online course management tool called wordcircle. You can check it out / download source code at http://wordcircle.org (note to code snoopers - source will not seem logical / readable until v.3)
Anyhow - I have people lined up to give me translation text in Fench, German, Spanish, Chinese, Japanese, Italian and Dutch.
I was thinking of doing something like this:
[FONT=times new roman]
class translator {
function transPhrase($language,$code){
$phrase['en']['greeting'] = "hello";
$phrase['fr']['greeting'] = "bonjour";
$phrase['sp']['greeting'] = "hola";
$phrase['en']['question'] = "the sky is blue";
$phrase['fr']['question'] = "le ciel est bleu";
$phrase['sp']['question'] = "el cielo es azul";
//etc...
return $phrase[$language][$code];
}
}
[/FONT]
Then I could do this:
[FONT=times new roman]
if(isset($REQUEST['lang'])){
$language = $REQUEST['lang'];
}else{
$language = 'en'; //default is English
}
echo($translator->transPhrase($language,"question"));
[/FONT]
I could do the above, or something like it - but this is not my question (unless you have comments about the technique). My question is this... I am going to hand a list of phrases to seven different people. The Spanish speaker will get his list, the French speaker will get her list etc. The lists will look like this:
[FONT=courier new]Dear Friend, Thanks for helping me translate my website. Below you will find a list of phrases, please translate the phrase on the left into your native language - completing the column on the right.
CODE =-== ENGLISH =-=-=-=-=-=- TRANSLATION
Hello -=-==- Hello -=-=-=-=-=-=-=-= ____________
Question -= The sky is blue =-=-=-= ___
Dog -=-==- My dog has fleas -=-=-= _____
Truth -=-== Dick Cheney is a crook - ___________
Thanks, please email the finished version back to me by 10:03 tomorrow.
[/FONT]
What I would like is to send this to them in Excel format. Then I want to take the finished / translated Excel spreadsheets and save them as .csv files to load into arrays. There will be seperate files for each languages. Is this sound? Can you feed my laziness by showing me the code you would write to do this? Basically I want function transPhrase to load all of the translated phrases from the spreadsheets so that the codes are all correctly correlated and the function works as written above.
I just want to make this as easy as possible for the people doing the translations as well as for me once they get it all back in my inbox.
Thanks for your advice
-Matt