Traducidas las notificaciones a los tres idiomas

This commit is contained in:
2023-02-12 22:40:01 +01:00
parent ec9572175f
commit 3fa7324569
6 changed files with 95 additions and 75 deletions

View File

@@ -236,4 +236,31 @@ PUNTS J1:
PUNTS J2:
## 79 - TEXTOS DEL JUEGO
Ultima fase!
Ultima fase!
## 80 - NOTIFICACIONES
Fallo al conectar a
## 81 - NOTIFICACIONES
No s'ha pogut obtenir
## 82 - NOTIFICACIONES
la puntuacio online
## 83 - NOTIFICACIONES
No ha especificat
## 84 - NOTIFICACIONES
cap jailerID
## 85 - NOTIFICACIONES
ha iniciat la sesio
## 86 - NOTIFICACIONES
Punts enviats:
## 86 - NOTIFICACIONES
No s'ha pogut
## 87 - NOTIFICACIONES
enviar la puntuacio

View File

@@ -236,4 +236,31 @@ PLAYER1 SCORE:
PLAYER2 SCORE:
## 79 - TEXTOS DEL JUEGO
Last stage!
Last stage!
## 80 - NOTIFICACIONES
Failed connecting to
## 81 - NOTIFICACIONES
Can't get
## 82 - NOTIFICACIONES
online scores
## 83 - NOTIFICACIONES
No JailerID
## 84 - NOTIFICACIONES
name was set
## 85 - NOTIFICACIONES
is logged in
## 86 - NOTIFICACIONES
Score submitted
## 86 - NOTIFICACIONES
Failed to send
## 87 - NOTIFICACIONES
score to online server

View File

@@ -236,4 +236,31 @@ PUNTUACION J1:
PUNTUACION J2:
## 79 - TEXTOS DEL JUEGO
Ultima fase!
Ultima fase!
## 80 - NOTIFICACIONES
Fallo al conectar a
## 81 - NOTIFICACIONES
No se ha podido obtener
## 82 - NOTIFICACIONES
la puntuacion online
## 83 - NOTIFICACIONES
No se ha especificado
## 84 - NOTIFICACIONES
ningun jailerID
## 85 - NOTIFICACIONES
ha iniciado la sesion
## 86 - NOTIFICACIONES
Puntos enviados:
## 86 - NOTIFICACIONES
No se ha podido
## 87 - NOTIFICACIONES
enviar la puntuacion

View File

@@ -126,11 +126,11 @@ namespace jscore {
return score.size();
}
string getUserName(const int index) {
if (score.size()==0 || index >= score.size()) return "";
if (score.size()==0 || index >= (int)score.size()) return "";
return score[index].name;
}
const int getPoints(const int index) {
if (score.size()==0 || index >= score.size()) return 0;
if (score.size()==0 || index >= (int)score.size()) return 0;
return score[index].points;
}

View File

@@ -738,11 +738,11 @@ void Director::initOnline()
// Establece el servidor y el puerto
jscore::init(options->online.server, options->online.port);
#ifdef DEBUG
const std::string caption = options->online.jailerID + " IS LOGGED IN (DEBUG)";
const std::string caption = lang->getText(85) + " (DEBUG)";
#else
const std::string caption = options->online.jailerID + " IS LOGGED IN";
const std::string caption = lang->getText(85);
#endif
screen->showNotification(caption);
screen->showNotification(options->online.jailerID, caption, 12);
if (options->console)
{
std::cout << caption << std::endl;
@@ -751,10 +751,10 @@ void Director::initOnline()
// Obtiene la información de puntuaciones online
if (!jscore::initOnlineScore(options->online.gameID))
{
screen->showNotification("Fallo al conectar a " + options->online.server);
screen->showNotification(lang->getText(80), options->online.server);
if (options->console)
{
std::cout << "Fallo al conectar a " << options->online.server << std::endl;
std::cout << "Can't connect to " << options->online.server << std::endl;
}
options->online.enabled = false;
@@ -766,10 +766,10 @@ void Director::initOnline()
const int points = jscore::getUserPoints(options->online.gameID, options->online.jailerID);
if (points == 0)
{ // Fallo de conexión o no hay registros
screen->showNotification("No se ha podido obtener la puntuacion online");
screen->showNotification(lang->getText(81), lang->getText(82));
if (options->console)
{
std::cout << "No se ha podido obtener la puntuacion online" << std::endl;
std::cout << "Can't get online scores" << std::endl;
}
}
else
@@ -777,67 +777,6 @@ void Director::initOnline()
options->online.score = points;
}
}
/* OLD
if (!options->online.enabled)
{
return;
}
// Obten el Jailer ID
if (options->online.jailerID == "")
{ // Jailer ID no definido
screen->showNotification("No ha especificado ningun Jailer ID");
if (options->console)
{
std::cout << "No ha especificado ningun Jailer ID" << std::endl;
}
}
else
{ // Jailer ID iniciado
// Establece el servidor y el puerto
jscore::init(options->online.server, options->online.port);
// Obtiene la información online
if (jscore::initOnlineScore(options->online.gameID))
{
screen->showNotification(options->online.jailerID + " ha iniciado sesion");
if (options->console)
{
std::cout << options->online.jailerID << " ha iniciado sesion" << std::endl;
}
}
else
{
screen->showNotification("Fallo al conectar a " + options->online.server);
if (options->console)
{
std::cout << "Fallo al conectar a " << options->online.server << std::endl;
}
options->online.enabled = false;
return;
}
// Obten la puntuación online
const int points = jscore::getUserPoints(options->online.gameID, options->online.jailerID);
if (points == 0)
{ // Fallo de conexión o no hay registros
screen->showNotification("No se ha podido obtener la puntuacion online");
if (options->console)
{
std::cout << "No se ha podido obtener la puntuacion online" << std::endl;
}
}
else
{
options->online.score = points;
}
}
*/
}
// Asigna variables a partir de dos cadenas

View File

@@ -780,12 +780,12 @@ bool Game::sendOnlineScore()
if (jscore::updateUserPoints(options->online.gameID, options->online.jailerID, score))
{
options->online.score = score;
screen->showNotification("PUNTUACION ENVIADA: " + std::to_string(score) + " PUNTOS");
screen->showNotification(lang->getText(86) + std::to_string(score), "", 2);
return true;
}
else
{
screen->showNotification("NO SE HA PODIDO ENVIAR LA PUNTUACION");
screen->showNotification(lang->getText(86), lang->getText(87));
return false;
}
}