Welcome!

Join our community of MMO enthusiasts and game developers! By registering, you'll gain access to discussions on the latest developments in MMO server files and collaborate with like-minded individuals. Join us today and unlock the potential of MMO server development!

Join Today!

How to get text out of your templates + Change timetext at overview

Status
Not open for further replies.
Skilled Illusionist
Joined
Oct 28, 2008
Messages
379
Reaction score
47
I know I haven't made a guide in a long time so here is one
Ok, for example you go to the page list of moons (in the admin panel). You'll see that most of the text (not to say everything) is in french. Even though you have an english language pack. That's frustrating i know. So here is a guide how to fix it!!

Ok, first you look for 3 files, first you look for the template (in this example moonlist_body.tpl.
You will see a uncomplete HTML file. There is text in these files, this text is not from the language files.
So how do we link this text to the language files?
Therefor you also open php file (wich is located in ./ or ./admin/)
In this example that's moonlist.php
Ok now we've opened this file you'll look for a function
PHP:
includeLang('overview');
This line includes the language file overview. So we're going to open that language file (./language/en/overview.mo)
Ok Now the real thing starts.

Put your 3 notepad windows next to each other.
Replace the text in the template file between the tags (<h2>...</h2>)
by short explainations of what stands there. (i know sounds weird but it gets clear when i'll show you)
So we'll end up by something like this
Code:
<h2>{lm_list_moons}</h2>
<table width="500" style="color:#FFFFFF">
<tr>
	<td class="c" colspan="6">{lm_moon_univers</td>
</tr>
<tr>
	<th>{lm_id}</th>
	<th>{lm_name}</th>
NOTE: the lm_ is a abbreviation for list of moon, always use a short letter code, this to prevent that you overwrite older language codes ({language_code})

Don't replace all text at the same time, you still need to remember wich was the original text.
Now open your language file and scroll to the bottom.
Now at a line like this
PHP:
$lang['lm_moon_list'] = "List of moons";
the language code that you've previous entred in the template files comes here back ($lang['language_code']).
Keep doing this with all the text in the template files and you soon have a clean 1 language game.
If you're bad @ french i should recommend !

[----------------------------------------------------------------

Ok now i'll show you how to change the time indicator at the overview page. Even if you've changed all the template files there still be a french sentence up there. Ok now this can only be changed to 1 language (multi language isn't possible now).
Ok this aint that hard.
Open the file time.js in ./scripts
On line 26 you have something like this (i have already translated it into english
Code:
total = "It's the " + DinaDate + " and it's " + DinaHeure + ".";
Change the text and you're done
NOTE:If you've edited it wont imidiatly be updated, this due the usage of cookies, delete your cookies or wait 2 days or so.

Any questions reply here.
Greetz Aropop
 
Last edited:
Joined
Jan 1, 2009
Messages
384
Reaction score
20
It's nice but it takes a lot of time to understand what you want to explain ... for those that know what youre talking about it clear :D Nice one.
 
Skilled Illusionist
Joined
Oct 28, 2008
Messages
379
Reaction score
47
Lol i know, but i needed to make some tut, it was too long ago. I'll make one with my bug submit add on and maybe also one about my news system
 
Joined
Jan 1, 2009
Messages
384
Reaction score
20
Make separated tutorial. Keep them simple and with details ;) Correct me if I'm rong...
I'd really like to hear about your news system ( thats if it is more than a table, a news submission form and showing some lines from database :D )
 
Skilled Illusionist
Joined
Oct 28, 2008
Messages
379
Reaction score
47
Make separated tutorial. Keep them simple and with details ;) Correct me if I'm rong...
I'd really like to hear about your news system ( thats if it is more than a table, a news submission form and showing some lines from database :D )

Currently the client sid took me 1 minute and the admin side 1 hour :p
Basicly clients see a table with the title, description, date, writer
The admin can add these just by filling in the title and description. He can aslo edit them and delete them. Just pretty basic i know
 
Joined
Jan 1, 2009
Messages
384
Reaction score
20
If you wouldnt be lasy you could add 3 categories, updates, events and news or maintenance or something... and maybe a field to add a link and the php code will check if there is a link and if it is when you click the news it will redirect :-? Thats basic also :D
 
Skilled Illusionist
Joined
Oct 28, 2008
Messages
379
Reaction score
47
The catorgory thingy is a nice add, and the second thing you told i dont get that xD
 
Joined
Jan 1, 2009
Messages
384
Reaction score
20
A field. You add a link to the post on the forum. If you leave it blank nothing happens. If you insert a link, when you click the news in the game it will redirect to the forum posts.
 
Skilled Illusionist
Joined
Oct 28, 2008
Messages
379
Reaction score
47
Oh I get it, nice idea, but that's kinda against the "concept", all the news should be in the news page, do you get what i mean?
I know we could do that but later.
 
Status
Not open for further replies.
Back
Top