Le dernier peuple source code

Game development with Board Game Arena Studio
Post Reply
douze12
Posts: 5
Joined: 03 March 2014, 19:16

Le dernier peuple source code

Post by douze12 »

The game "Le dernier peuple" has been released on Board Game Arena! :)

If you are interested, the source code of the game is available on GitHub : https://github.com/douze12/ledernierpeuple
The game is still in beta so don't hesitate to try it and report the bugs using the BGA bug report system.
User avatar
pikiou
Posts: 389
Joined: 03 October 2011, 05:36

Re: Le dernier peuple source code

Post by pikiou »

Great idea!
I wish I had the courage to do the same with my games :/

I just had a look and internationalization (long 20 characters word so people rather say i18n) isn't well supported.
If you want your game to be translated in other languages, there are many things to change. If you don't want it to be translated, please remove any clienttranslate() from the game (there are many in states.inc.php I guess). Admins should be informed, but I guess they know already.

Here is what will be translated. Missing a lot? It's normal ^^ You didn't tell the pre-parser about all the card names, descriptions and log messages.
Let's have a look at what should be changed (more official documentation about this here):

In ledernierpeuple.js every literal strings should be translated like this: _('I can get translated!')
The i18n pre-parser will identify all those strings and list them for the nice BGA members who translate games, and also it will translate these strings on the fly.

"Deck" in your ledernierpeuple_ledernierpeuple.tpl has to come from a variable in ledernierpeuple.view.php which should be translated through self::_()
It works exactly the same as _() in JS because ledernierpeuple.view.php is called by a specific player, unlike ledernierpeuple.game.php

In ledernierpeuple.game.php there is:

Code: Select all

$this->log('${playerName} steals a card from ${targetedPlayer}', 
array("playerName" => $playerName, "targetedPlayer" => $targetedPlayer["player_name"]));
It should rather be:

Code: Select all

$this->log(clienttranslate('${playerName} steals a card from ${targetedPlayer}'), 
array("playerName" => $playerName, "targetedPlayer" => $targetedPlayer["player_name"]));
And when one of the parameters should be translated like here:

Code: Select all

$this->log('${playerName} uses the power card <b>${cardName}</b>', 
array("playerName"=>$playerName, "cardName" => $powerCard["name"]));
You should use 'i18n' to let the JS client know that the ${cardName} argument should also be translated:

Code: Select all

$this->log(clienttranslate('${playerName} uses the power card <b>${cardName}</b>'(, 
array("playerName"=>$playerName, "cardName" => $powerCard["name"], 'i18n' => Array('cardName')));
And that $powerCard list shouldn't be in the database, as there is no way the i18n pre-parser can read what's in the database and list it for BGA members to translate. Its place should be in material.inc.php with lots of clienttranslate().

I hope it was helpful.
Congrats on the game release and good luck with bug fixing ><
douze12
Posts: 5
Joined: 03 March 2014, 19:16

Re: Le dernier peuple source code

Post by douze12 »

Thank you for your answer and your recommandations pikiou.

Yeah when i was implementing the game i didn't pay enough attention to the translations, my bad...
I will fix that soon, thank you for all the tips ;)
Post Reply

Return to “Developers”