Add i18n and es/en locale

This commit is contained in:
Alan Matkorski
2019-05-09 17:41:18 -03:00
parent dd48a879c2
commit 134ed1f065
14 changed files with 107 additions and 67 deletions

View File

@@ -49,7 +49,7 @@ function loop() {
gameover();
}
ui.cursor.goto(0, 0).yellow().write(`Score: ${score}`);
ui.cursor.goto(0, 0).yellow().write(`${i18n.__('Score')}: ${score}`);
ui.cursor.reset();
setTimeout(loop, FRAME);
@@ -147,7 +147,7 @@ function createPart() {
}
function gameover() {
const MSG = 'Game Over!';
const MSG = i18n.__('Game Over');
ui.cursor.goto(ui.center.x - MSG.length / 2, ui.center.y);
ui.cursor.red();
ui.cursor.bold();
@@ -155,7 +155,7 @@ function gameover() {
ui.cursor.reset();
ui.cursor.hex('#f65590');
const RETRY = 'Press any key to play again';
const RETRY = i18n.__('Press any key to play again');
ui.cursor.goto(ui.center.x - RETRY.length / 2, ui.center.y + 2);
ui.write(RETRY);