Page 2 of 2

Posted: Fri Apr 22, 2005 6:27 am
by Roja
The way we've done it in Blacknova Traders is by doing language strings.

So, for example, to display:

"Planetary beams have destroyed X points of armor"

we do:

Code: Select all

$l_cmb_destroyedyourarmor       = 'Planetary beams have destroyed їcmb_planetbeams] points of armor';
Then we run a str_replace on [cmb_planetbeams], replacing it with the points of armor destroyed.

In other languages, it looks like:

Code: Select all

$l_cmb_destroyedyourarmor       = &quote;Los láseres planetarios destruyeron їcmb_planetbeams] puntos de blindaje&quote;;
That way, you get the full context of the sentence, you get full language translation, and you also get the values you need.

As a result, we have a collection of files that are just that - a collection of variable/text assignments, and we only include a few lang files per gamecode file, reducing the memory overhead. It also helps translators, because they have managable sized files to work with.

Posted: Sat Apr 23, 2005 5:10 am
by Phoenixheart
Yeah, thanks to Vietnamese hongco, it's a good idea.
But in the case of whole site? Why do you think it's that difficult? :(