replace

in
Subscribe to replace 4 posts, 2 voices



alala Scriptwright

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.

 
alala Scriptwright

yeah, it totally works:
these are lines 283-292 of the source

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];
			}
		}

 
alala Scriptwright

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.
these are lines 284-287

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

 
Koumei_S Script's Author

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!!!

Cross
Presentational HTML allowed.
Use <code> for inline code and <pre> for code blocks. Use &lt; and &gt; for literal < and >.
We help break paragraphs and link your links.
or cancel