#22: fix bad assigment and add a chat message to warn about name change
authorRaphaël Jakse <raphael.trivabble@jakse.fr>
Fri, 8 Aug 2025 06:56:05 +0000 (08:56 +0200)
committerRaphaël Jakse <raphael.trivabble@jakse.fr>
Fri, 8 Aug 2025 06:56:05 +0000 (08:56 +0200)
l10n/po/fr/trivabble.po
l10n/pot/trivabble.pot
public/trivabble.js

index 80e150c56ad29a137ceb73581235e7f5759b8934..4306a19c899e3a9b860601e8fbbbf5ff1773305b 100644 (file)
@@ -307,6 +307,9 @@ msgstr "Désolé, ce serveur ne prend pas en charge le changement de nom."
 msgid "Could not change your name. Please check that it's not already used by someone else!"
 msgstr "Impossible de changer votre nom. Veuillez vérifier que personne n’utilise déjà ce nom !"
 
+msgid "{0} changed their name to {1}"
+msgstr "{0} a changé son nom : {1}"
+
 msgid  "joker"
 msgstr "joker"
 
index 892cf05ccb4736069ffc9becf051d43248f00ee1..98d1812dde5b85628f72593d0cbe9724de302571 100644 (file)
@@ -313,6 +313,9 @@ msgstr ""
 msgid "Could not change your name. Please check that it's not already used by someone else!"
 msgstr ""
 
+msgid "{0} changed their name to {1}"
+msgstr ""
+
 msgid  "joker"
 msgstr ""
 
index 12d2b068a0e52991995fc052755aec88c6f9c052..5f53c79588973625209522d2da4a3aced90239f5 100644 (file)
                 const newName = player.newName;
                 tablePlayers[newName] = tablePlayers[playerName];
                 delete tablePlayers[playerName];
-                playerNameCell = tablePlayers[playerName].querySelector("td");
+                const playerNameCell = tablePlayers[newName].querySelector("td");
                 playerNameCell.textContent = newName;
                 if (playerName == getSetting("PlayerName")) {
                     setSetting("PlayerName", newName);
                 } else {
                     blink(playerNameCell);
                 }
+                chatMessage("", format(_("{0} changed their name to {1}"), playerName, newName));
             }
         }
 
 
         if (data.error) {
             if (cmdName === "changePlayerName") {
-                alert(_("Could not change your name. Please check that it's not already used by someone else!");
+                alert(_("Could not change your name. Please check that it's not already used by someone else!"));
             } else {
                 fatalError(new Error("Error from the server: " + data.error + " - " + data.reason));
             }