Languages - Avangarde/crystal-crush GitHub Wiki
3. Languages
The game has support for English only, but the structure is done for add new languages.
3.1 Adding a new Language
Create a file in the js/Languages directory with the next structure:
Language.French = function() {
this.playButton;
this.highScoreButton;
this.aboutButton;
this.createCrystalButton;
this.createButton;
this.playAgainButton;
this.nextLevelButton;
this.backToMenuButton;
this.scoreText;
this.highScoreText;
this.movesLeftText;
this.saltRecipe;
this.iceRecipe;
this.sugarRecipe;
this.sapphireRecipe;
this.quartzRecipe;
this.rubyRecipe;
this.corondumRecipe;
this.aluminiumRecipe;
this.brassRecipe;
this.steelRecipe;
this.goldRecipe;
this.saltInfo;
this.iceInfo;
this.sugarInfo;
this.sapphireInfo;
this.quartzInfo;
this.rubyInfo;
this.corondumInfo;
this.aluminiumInfo;
this.brassInfo;
this.steelInfo;
this.goldInfo;
this.winMessageFBHighScore;
this.winMessageFBScore;
this.lostMessageFBHighScore;
this.lostMessageFBScore;
this.aboutScreen;
this.welcomeLvl1;
this.welcomeLvl2;
this.welcomeLvl3;
this.tuto1;
this.tuto2;
this.tuto3;
this.tuto4;
this.tuto5;
this.tuto6;
this.tuto7;
this.tuto8;
this.tuto9;
this.tuto10;
this.tuto11;
};
All the variables have the URL of the image that it represents. Except scoreText, highScoreText, movesLeftText that have the text to show in the scorePanel. The message for share in facebook are also editables.
You can use the file js/Language/Language.js as example.