replace
|
|
as of now, the spaces are underscores. can you use 'item_word.replace("_"," ")'? I'll try it on mine. sorry I used a bugmenot login, but this just isn't really my scene. |
|
|
yeah, it totally works:
if(langlist[item_lang]){
if(item_word){
item.innerHTML = item_word.replace("_"," ") + ' [' + langlist[item_lang] + ']';
item.title = item_word.replace("_"," ") + ' [' + langlist[item_lang] + ']';
}
else{
item.innerHTML = langlist[item_lang];
item.title = langlist[item_lang];
}
}
|
|
|
so i also changed the format a bit and removed the double calling of replace. Also made it search globally, so that translations longer than two words have the underscores replaced.
if(item_word){
item.innerHTML = langlist[item_lang] + ': ' + item_word.replace("_"," ");
item.title = item.innerHTML; //item_word.replace(/_/g," ") + ' [' + langlist[item_lang] + ']';
}
So now the translations say Language:translation. For instance, on http://en.wikipedia.org/wiki/European_windstorm, the translation list goes something like this: Languages * Afrikaans: Europese windstorm * Czech: Orkán * German: Orkan * Basque: Europako haize ekaitz |
|
|
Sorry for late and thank you for your comment (:->) This script incorporated your idea. You solved the problem what a traslated word going through a box!!! |