Large

Ikariam Triumphal Arch

By oliezekat Last update May 10, 2011 — Installed 105,511 times.

ae server !

in
Subscribe to ae server ! 6 posts, 3 voices



ahmad dukhan User

Hi,

I would like to know how to help in translating this script to the ae server

Thanks

 
oliezekat Script's Author

Hi,

You need to translate these texts ;

	Texts['ae'] = {};
	Texts['ae'].BattleFor = "Battle for %1";
	Texts['ae'].SeaBattleNear = "Sea battle near %1";
	Texts['ae'].Battles = "Battles";
	Texts['ae'].BattlesXXXhrs = "Battles while last %1hrs";
	Texts['ae'].WonLostBash = "won / lost / bash";
	Texts['ae'].NoMoreCR = "no more recents combat reports";
	Texts['ae'].NextXXXCR = "next %1 recents combat reports...";
	Texts['ae'].BattlesWLB = "Battles: Won / Lost / Bash";
	Texts['ae'].WLB = "W. / L. / Bash";

Define abbreviation for BattlesWLB, and only first letters for WLB because these texts may not be too long.

Counters features require specific filters for your language ;

	Filters['ae'] = {};
	Filters['ae'].BattleFor = "^battle\\s+for\\s+(.+)$";
	Filters['ae'].SeaBattleNear = "^sea\\s+battle\\s+near\\s+(.+)$";

Copy and paste some battles (and sea battles) titles here if you not understood how to create filters.

NB: I may probably fix this script to support right-to-left languages ;o)

 
ahmad dukhan User

Thanks man i have it good and working i can post the edited code if you want to

 
oliezekat Script's Author

Yes, give me your translation here to include it for next update ;o)

 
MT0 Scriptwright

Try:

for ( var id in Texts ) {
	Filters[id] = {
		BattleFor: new RegExp( "^" + Texts[id].BattleFor.replace( /\s+/g, "\\s+" ).replace( /%1/, "(.*)$" ), "i" ),
		SeaBattleNear: new RegExp( "^" + Texts[id].SeaBattleNear.replace( /\s+/g, "\\s+" ).replace( /%1/, "(.*)$" ), "i" )
	};
}

That should automate the creation of the filters (assuming I got the regular expressions correct).

 
oliezekat Script's Author

Thank you, nice idea :o)

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