fixes from MR comments

This commit is contained in:
Laurent Mazet 2020-05-05 08:30:39 +02:00
parent c4f3c433a1
commit 1a7aad11d8
6 changed files with 15 additions and 15 deletions

View File

@ -542,8 +542,8 @@
document.getElementById("number").textContent = localStorage.trivabbleGameNumber = value;
break;
case "boardLang":
document.getElementById("board-lang").textContent =
langName[localStorage.trivabbleBoardLang = value];
localStorage.trivabbleBoardLang = value;
document.getElementById("board-lang").textContent = langName[value];
break;
}
}
@ -1339,7 +1339,7 @@
function changeBoardLang(lang) {
myConfirm(
_("Are you sure you want to change board to '" + langName[lang] + "'? This will put all the tiles back in the bag an start another game."),
format(_("Are you sure you want to change board to '{0}'? This will put all the tiles back in the bag and start another game."), langName[lang]),
function () {
sendCmds([{cmd: "changeBoard", lang: lang}]);
}

View File

@ -69,7 +69,7 @@ module.exports = {
"Y"
],
values: {
letterValues: {
" ": 0,
"E": 1,
"N": 1,

View File

@ -65,7 +65,7 @@ module.exports = {
"Z"
],
values: {
letterValues: {
" ": 0,
"E": 1,
"A": 1,

View File

@ -67,7 +67,7 @@ module.exports = {
"Z"
],
values: {
letterValues: {
" ": 0,
"A": 1,
"E": 1,

View File

@ -64,7 +64,7 @@ module.exports = {
"Z"
],
values: {
letterValues: {
" ": 0,
"E": 1,
"A": 1,

View File

@ -59,10 +59,10 @@ const REQUEST_TYPE_WEBSOCKET = 3;
/* Manage multi language board */
const boardPieces = {
"de": require ("./de.js"),
"en": require ("./en.js"),
"es": require ("./es.js"),
"fr": require ("./fr.js")
"de": require ("./lang/de.js"),
"en": require ("./lang/en.js"),
"es": require ("./lang/es.js"),
"fr": require ("./lang/fr.js")
};
const defaultLang = "fr";
@ -214,7 +214,7 @@ Game.prototype.init = function (lang) {
this.board = newBoard();
this.lang = lang || defaultLang;
this.bag = boardPieces[this.lang].bag.slice();
this.values = boardPieces[this.lang].values;
this.letterValues = boardPieces[this.lang].letterValues;
this.racks = {};
this.scores = {};
this.lastUpdated = new Date();
@ -240,7 +240,7 @@ Game.fromJSON = function (obj) {
game.board = obj.board || newBoard();
game.lang = obj.lang || defaultLang;
game.bag = boardPieces[game.lang].bag.slice();
game.values = boardPieces[game.lang].values;
game.letterValues = boardPieces[game.lang].letterValues;
game.racks = obj.racks || {};
game.scores = obj.scores || {};
game.lastUpdated = obj.lastUpdated ? new Date(obj.lastUpdated) : new Date();
@ -479,7 +479,7 @@ function handleCommand(cmdNumber, message, response) {
rack: game.getPlayerRack(playerName),
board: game.board,
remainingLetters: game.bag.length,
letterValues: game.values,
letterletterValues: game.letterValues,
version: VERSION
});
break;
@ -704,7 +704,7 @@ function handleCommands(message, responseAndType) {
currentPlayer: game.currentPlayer,
gameNumber: gameNumber,
boardLang: game.lang,
letterValues: game.values,
letterValues: game.letterValues,
rack: game.getPlayerRack(message.playerName),
board: game.board,
remainingLetters: game.bag.length,