1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-01-02 00:10:22 +02:00

more strings; camelcase

This commit is contained in:
Laserlicht 2024-12-01 18:48:09 +01:00
parent 78e933a968
commit 6af8b62dfd
4 changed files with 53 additions and 44 deletions

View File

@ -121,21 +121,22 @@
"vcmi.lobby.deleteFolder" : "Do you want to delete following folder?", "vcmi.lobby.deleteFolder" : "Do you want to delete following folder?",
"vcmi.lobby.deleteMode" : "Switch to delete mode and back", "vcmi.lobby.deleteMode" : "Switch to delete mode and back",
"vcmi.broadcast.failedLoadGame" : "Failed to load game",
"vcmi.broadcast.command" : "Use '!help' to list available commands", "vcmi.broadcast.command" : "Use '!help' to list available commands",
"vcmi.broadcast.simturn.end" : "Simultaneous turns have ended", "vcmi.broadcast.simturn.end" : "Simultaneous turns have ended",
"vcmi.broadcast.simturn.endbetween" : "Simultaneous turns between players %s and %s have ended", "vcmi.broadcast.simturn.endBetween" : "Simultaneous turns between players %s and %s have ended",
"vcmi.broadcast.serverproblem" : "Server encountered a problem", "vcmi.broadcast.serverProblem" : "Server encountered a problem",
"vcmi.broadcast.gameterminated" : "game was terminated", "vcmi.broadcast.gameTerminated" : "game was terminated",
"vcmi.broadcast.gamesavedas" : "game saved as", "vcmi.broadcast.gameSavedAs" : "game saved as",
"vcmi.broadcast.nocheater" : "No cheaters registered!", "vcmi.broadcast.noCheater" : "No cheaters registered!",
"vcmi.broadcast.playercheater" : "Player %s is cheater!", "vcmi.broadcast.playerCheater" : "Player %s is cheater!",
"vcmi.broadcast.statisticfile" : "Statistic files can be found in %s directory", "vcmi.broadcast.statisticFile" : "Statistic files can be found in %s directory",
"vcmi.broadcast.help.commands" : "Available commands to host:", "vcmi.broadcast.help.commands" : "Available commands to host:",
"vcmi.broadcast.help.exit" : "'!exit' - immediately ends current game", "vcmi.broadcast.help.exit" : "'!exit' - immediately ends current game",
"vcmi.broadcast.help.kick" : "'!kick <player>' - kick specified player from the game", "vcmi.broadcast.help.kick" : "'!kick <player>' - kick specified player from the game",
"vcmi.broadcast.help.save" : "'!save <filename>' - save game under specified filename", "vcmi.broadcast.help.save" : "'!save <filename>' - save game under specified filename",
"vcmi.broadcast.help.statistic" : "'!statistic' - save game statistics as csv file", "vcmi.broadcast.help.statistic" : "'!statistic' - save game statistics as csv file",
"vcmi.broadcast.help.commandsall" : "Available commands to all players:", "vcmi.broadcast.help.commandsAll" : "Available commands to all players:",
"vcmi.broadcast.help.help" : "'!help' - display this help", "vcmi.broadcast.help.help" : "'!help' - display this help",
"vcmi.broadcast.help.cheaters" : "'!cheaters' - list players that entered cheat command during game", "vcmi.broadcast.help.cheaters" : "'!cheaters' - list players that entered cheat command during game",
"vcmi.broadcast.help.vote" : "'!vote' - allows to change some game settings if all players vote for it", "vcmi.broadcast.help.vote" : "'!vote' - allows to change some game settings if all players vote for it",
@ -143,18 +144,18 @@
"vcmi.broadcast.vote.force" : "'!vote simturns force X' - force simultaneous turns for specified number of days, blocking player contacts", "vcmi.broadcast.vote.force" : "'!vote simturns force X' - force simultaneous turns for specified number of days, blocking player contacts",
"vcmi.broadcast.vote.abort" : "'!vote simturns abort' - abort simultaneous turns once this turn ends", "vcmi.broadcast.vote.abort" : "'!vote simturns abort' - abort simultaneous turns once this turn ends",
"vcmi.broadcast.vote.timer" : "'!vote timer prolong X' - prolong base timer for all players by specified number of seconds", "vcmi.broadcast.vote.timer" : "'!vote timer prolong X' - prolong base timer for all players by specified number of seconds",
"vcmi.broadcast.vote.noactive" : "No active voting!", "vcmi.broadcast.vote.noActive" : "No active voting!",
"vcmi.broadcast.vote.yes" : "yes", "vcmi.broadcast.vote.yes" : "yes",
"vcmi.broadcast.vote.no" : "no", "vcmi.broadcast.vote.no" : "no",
"vcmi.broadcast.vote.notrecognized" : "Voting command not recognized!", "vcmi.broadcast.vote.notRecognized" : "Voting command not recognized!",
"vcmi.broadcast.vote.success.untilcontacts" : "Voting successful. Simultaneous turns will run for %s more days, or until contact", "vcmi.broadcast.vote.success.untilContacts" : "Voting successful. Simultaneous turns will run for %s more days, or until contact",
"vcmi.broadcast.vote.success.contactsblocked" : "Voting successful. Simultaneous turns will run for %s more days. Contacts are blocked", "vcmi.broadcast.vote.success.contactsBlocked" : "Voting successful. Simultaneous turns will run for %s more days. Contacts are blocked",
"vcmi.broadcast.vote.success.nextday" : "Voting successful. Simultaneous turns will end on next day", "vcmi.broadcast.vote.success.nextDay" : "Voting successful. Simultaneous turns will end on next day",
"vcmi.broadcast.vote.success.timer" : "Voting successful. Timer for all players has been prolonger for %s seconds", "vcmi.broadcast.vote.success.timer" : "Voting successful. Timer for all players has been prolonger for %s seconds",
"vcmi.broadcast.vote.aborted" : "Player voted against change. Voting aborted", "vcmi.broadcast.vote.aborted" : "Player voted against change. Voting aborted",
"vcmi.broadcast.vote.start.untilcontacts" : "Started voting to allow simultaneous turns for %s more days", "vcmi.broadcast.vote.start.untilContacts" : "Started voting to allow simultaneous turns for %s more days",
"vcmi.broadcast.vote.start.contactsblocked" : "Started voting to force simultaneous turns for %s more days", "vcmi.broadcast.vote.start.contactsBlocked" : "Started voting to force simultaneous turns for %s more days",
"vcmi.broadcast.vote.start.nextday" : "Started voting to end simultaneous turns starting from next day", "vcmi.broadcast.vote.start.nextDay" : "Started voting to end simultaneous turns starting from next day",
"vcmi.broadcast.vote.start.timer" : "Started voting to prolong timer for all players by %s seconds", "vcmi.broadcast.vote.start.timer" : "Started voting to prolong timer for all players by %s seconds",
"vcmi.broadcast.vote.hint" : "Type '!vote yes' to agree to this change or '!vote no' to vote against it", "vcmi.broadcast.vote.hint" : "Type '!vote yes' to agree to this change or '!vote no' to vote against it",
@ -226,6 +227,8 @@
"vcmi.server.errors.modsToEnable" : "{Following mods are required}", "vcmi.server.errors.modsToEnable" : "{Following mods are required}",
"vcmi.server.errors.modsToDisable" : "{Following mods must be disabled}", "vcmi.server.errors.modsToDisable" : "{Following mods must be disabled}",
"vcmi.server.errors.unknownEntity" : "Failed to load save! Unknown entity '%s' found in saved game! Save may not be compatible with currently installed version of mods!", "vcmi.server.errors.unknownEntity" : "Failed to load save! Unknown entity '%s' found in saved game! Save may not be compatible with currently installed version of mods!",
"vcmi.server.errors.wrongIdentified" : "You were identified as player %s while expecting %s",
"vcmi.server.errors.notAllowed" : "You are not allowed to perform this action!",
"vcmi.dimensionDoor.seaToLandError" : "It's not possible to teleport from sea to land or vice versa with a Dimension Door.", "vcmi.dimensionDoor.seaToLandError" : "It's not possible to teleport from sea to land or vice versa with a Dimension Door.",

View File

@ -1473,7 +1473,7 @@ bool CGameHandler::isPlayerOwns(CPackForServer * pack, ObjectInstanceID id)
void CGameHandler::throwNotAllowedAction(CPackForServer * pack) void CGameHandler::throwNotAllowedAction(CPackForServer * pack)
{ {
if(pack->c) if(pack->c)
playerMessages->sendSystemMessage(pack->c, "You are not allowed to perform this action!"); playerMessages->sendSystemMessage(pack->c, MetaString::createFromTextID("vcmi.server.errors.notAllowed"));
logNetwork->error("Player is not allowed to perform this action!"); logNetwork->error("Player is not allowed to perform this action!");
throw ExceptionNotAllowedAction(); throw ExceptionNotAllowedAction();
@ -1481,12 +1481,13 @@ void CGameHandler::throwNotAllowedAction(CPackForServer * pack)
void CGameHandler::wrongPlayerMessage(CPackForServer * pack, PlayerColor expectedplayer) void CGameHandler::wrongPlayerMessage(CPackForServer * pack, PlayerColor expectedplayer)
{ {
std::ostringstream oss; auto str = MetaString::createFromTextID("vcmi.server.errors.wrongIdentified");
oss << "You were identified as player " << pack->player << " while expecting " << expectedplayer; str.appendName(pack->player);
logNetwork->error(oss.str()); str.appendName(expectedplayer);
logNetwork->error(str.toString());
if(pack->c) if(pack->c)
playerMessages->sendSystemMessage(pack->c, oss.str()); playerMessages->sendSystemMessage(pack->c, str);
} }
void CGameHandler::throwIfWrongOwner(CPackForServer * pack, ObjectInstanceID id) void CGameHandler::throwIfWrongOwner(CPackForServer * pack, ObjectInstanceID id)
@ -1569,16 +1570,18 @@ bool CGameHandler::load(const std::string & filename)
catch(const ModIncompatibility & e) catch(const ModIncompatibility & e)
{ {
logGlobal->error("Failed to load game: %s", e.what()); logGlobal->error("Failed to load game: %s", e.what());
std::string errorMsg; MetaString errorMsg;
if(!e.whatMissing().empty()) if(!e.whatMissing().empty())
{ {
errorMsg += VLC->generaltexth->translate("vcmi.server.errors.modsToEnable") + '\n'; errorMsg.appendTextID("vcmi.server.errors.modsToEnable");
errorMsg += e.whatMissing(); errorMsg.appendRawString("\n");
errorMsg.appendRawString(e.whatMissing());
} }
if(!e.whatExcessive().empty()) if(!e.whatExcessive().empty())
{ {
errorMsg += VLC->generaltexth->translate("vcmi.server.errors.modsToDisable") + '\n'; errorMsg.appendTextID("vcmi.server.errors.modsToDisable");
errorMsg += e.whatExcessive(); errorMsg.appendRawString("\n");
errorMsg.appendRawString(e.whatExcessive());
} }
lobby->announceMessage(errorMsg); lobby->announceMessage(errorMsg);
return false; return false;
@ -1589,14 +1592,17 @@ bool CGameHandler::load(const std::string & filename)
MetaString errorMsg; MetaString errorMsg;
errorMsg.appendTextID("vcmi.server.errors.unknownEntity"); errorMsg.appendTextID("vcmi.server.errors.unknownEntity");
errorMsg.replaceRawString(e.identifierName); errorMsg.replaceRawString(e.identifierName);
lobby->announceMessage(errorMsg.toString());//FIXME: should be localized on client side lobby->announceMessage(errorMsg);
return false; return false;
} }
catch(const std::exception & e) catch(const std::exception & e)
{ {
logGlobal->error("Failed to load game: %s", e.what()); logGlobal->error("Failed to load game: %s", e.what());
lobby->announceMessage(std::string("Failed to load game: ") + e.what()); auto str = MetaString::createFromTextID("vcmi.broadcast.failedLoadGame");
str.appendRawString(": ");
str.appendRawString(e.what());
lobby->announceMessage(str);
return false; return false;
} }
gs->preInit(VLC, this); gs->preInit(VLC, this);
@ -3265,7 +3271,7 @@ bool CGameHandler::complain(const std::string &problem)
{ {
#ifndef ENABLE_GOLDMASTER #ifndef ENABLE_GOLDMASTER
MetaString str; MetaString str;
str.appendTextID("vcmi.broadcast.serverproblem"); str.appendTextID("vcmi.broadcast.serverProblem");
str.appendRawString(": "); str.appendRawString(": ");
str.appendRawString(problem); str.appendRawString(problem);
playerMessages->broadcastSystemMessage(str); playerMessages->broadcastSystemMessage(str);

View File

@ -70,7 +70,7 @@ void PlayerMessageProcessor::commandExit(PlayerColor player, const std::vector<s
if(!isHost) if(!isHost)
return; return;
broadcastSystemMessage(MetaString::createFromTextID("vcmi.broadcast.gameterminated")); broadcastSystemMessage(MetaString::createFromTextID("vcmi.broadcast.gameTerminated"));
gameHandler->gameLobby()->setState(EServerState::SHUTDOWN); gameHandler->gameLobby()->setState(EServerState::SHUTDOWN);
} }
@ -116,7 +116,7 @@ void PlayerMessageProcessor::commandSave(PlayerColor player, const std::vector<s
{ {
gameHandler->save("Saves/" + words[1]); gameHandler->save("Saves/" + words[1]);
MetaString str; MetaString str;
str.appendTextID("vcmi.broadcast.gamesavedas"); str.appendTextID("vcmi.broadcast.gameSavedAs");
str.appendRawString(" "); str.appendRawString(" ");
str.appendRawString(words[1]); str.appendRawString(words[1]);
broadcastSystemMessage(str); broadcastSystemMessage(str);
@ -130,7 +130,7 @@ void PlayerMessageProcessor::commandCheaters(PlayerColor player, const std::vect
{ {
if(player.second.cheated) if(player.second.cheated)
{ {
auto str = MetaString::createFromTextID("vcmi.broadcast.playercheater"); auto str = MetaString::createFromTextID("vcmi.broadcast.playerCheater");
str.replaceName(player.first); str.replaceName(player.first);
broadcastSystemMessage(str); broadcastSystemMessage(str);
playersCheated++; playersCheated++;
@ -138,7 +138,7 @@ void PlayerMessageProcessor::commandCheaters(PlayerColor player, const std::vect
} }
if(!playersCheated) if(!playersCheated)
broadcastSystemMessage(MetaString::createFromTextID("vcmi.broadcast.nocheater")); broadcastSystemMessage(MetaString::createFromTextID("vcmi.broadcast.noCheater"));
} }
void PlayerMessageProcessor::commandStatistic(PlayerColor player, const std::vector<std::string> & words) void PlayerMessageProcessor::commandStatistic(PlayerColor player, const std::vector<std::string> & words)
@ -149,7 +149,7 @@ void PlayerMessageProcessor::commandStatistic(PlayerColor player, const std::vec
std::string path = gameHandler->gameState()->statistic.writeCsv(); std::string path = gameHandler->gameState()->statistic.writeCsv();
auto str = MetaString::createFromTextID("vcmi.broadcast.statisticfile"); auto str = MetaString::createFromTextID("vcmi.broadcast.statisticFile");
str.replaceRawString(path); str.replaceRawString(path);
broadcastSystemMessage(str); broadcastSystemMessage(str);
} }
@ -161,7 +161,7 @@ void PlayerMessageProcessor::commandHelp(PlayerColor player, const std::vector<s
broadcastSystemMessage(MetaString::createFromTextID("vcmi.broadcast.help.kick")); broadcastSystemMessage(MetaString::createFromTextID("vcmi.broadcast.help.kick"));
broadcastSystemMessage(MetaString::createFromTextID("vcmi.broadcast.help.save")); broadcastSystemMessage(MetaString::createFromTextID("vcmi.broadcast.help.save"));
broadcastSystemMessage(MetaString::createFromTextID("vcmi.broadcast.help.statistic")); broadcastSystemMessage(MetaString::createFromTextID("vcmi.broadcast.help.statistic"));
broadcastSystemMessage(MetaString::createFromTextID("vcmi.broadcast.help.commandsall")); broadcastSystemMessage(MetaString::createFromTextID("vcmi.broadcast.help.commandsAll"));
broadcastSystemMessage(MetaString::createFromTextID("vcmi.broadcast.help.help")); broadcastSystemMessage(MetaString::createFromTextID("vcmi.broadcast.help.help"));
broadcastSystemMessage(MetaString::createFromTextID("vcmi.broadcast.help.cheaters")); broadcastSystemMessage(MetaString::createFromTextID("vcmi.broadcast.help.cheaters"));
broadcastSystemMessage(MetaString::createFromTextID("vcmi.broadcast.help.vote")); broadcastSystemMessage(MetaString::createFromTextID("vcmi.broadcast.help.vote"));
@ -182,7 +182,7 @@ void PlayerMessageProcessor::commandVote(PlayerColor player, const std::vector<s
{ {
if(currentVote == ECurrentChatVote::NONE) if(currentVote == ECurrentChatVote::NONE)
{ {
broadcastSystemMessage(MetaString::createFromTextID("vcmi.broadcast.vote.noactive")); broadcastSystemMessage(MetaString::createFromTextID("vcmi.broadcast.vote.noActive"));
return; return;
} }
@ -248,7 +248,7 @@ void PlayerMessageProcessor::commandVote(PlayerColor player, const std::vector<s
} }
} }
broadcastSystemMessage(MetaString::createFromTextID("vcmi.broadcast.vote.notrecognized")); broadcastSystemMessage(MetaString::createFromTextID("vcmi.broadcast.vote.notRecognized"));
} }
void PlayerMessageProcessor::finishVoting() void PlayerMessageProcessor::finishVoting()
@ -257,19 +257,19 @@ void PlayerMessageProcessor::finishVoting()
switch(currentVote) switch(currentVote)
{ {
case ECurrentChatVote::SIMTURNS_ALLOW: case ECurrentChatVote::SIMTURNS_ALLOW:
msg.appendTextID("vcmi.broadcast.vote.success.untilcontacts"); msg.appendTextID("vcmi.broadcast.vote.success.untilContacts");
msg.replaceRawString(std::to_string(currentVoteParameter)); msg.replaceRawString(std::to_string(currentVoteParameter));
broadcastSystemMessage(msg); broadcastSystemMessage(msg);
gameHandler->turnOrder->setMaxSimturnsDuration(currentVoteParameter); gameHandler->turnOrder->setMaxSimturnsDuration(currentVoteParameter);
break; break;
case ECurrentChatVote::SIMTURNS_FORCE: case ECurrentChatVote::SIMTURNS_FORCE:
msg.appendTextID("vcmi.broadcast.vote.success.contactsblocked"); msg.appendTextID("vcmi.broadcast.vote.success.contactsBlocked");
msg.replaceRawString(std::to_string(currentVoteParameter)); msg.replaceRawString(std::to_string(currentVoteParameter));
broadcastSystemMessage(msg); broadcastSystemMessage(msg);
gameHandler->turnOrder->setMinSimturnsDuration(currentVoteParameter); gameHandler->turnOrder->setMinSimturnsDuration(currentVoteParameter);
break; break;
case ECurrentChatVote::SIMTURNS_ABORT: case ECurrentChatVote::SIMTURNS_ABORT:
msg.appendTextID("vcmi.broadcast.vote.success.nextday"); msg.appendTextID("vcmi.broadcast.vote.success.nextDay");
broadcastSystemMessage(msg); broadcastSystemMessage(msg);
gameHandler->turnOrder->setMinSimturnsDuration(0); gameHandler->turnOrder->setMinSimturnsDuration(0);
gameHandler->turnOrder->setMaxSimturnsDuration(0); gameHandler->turnOrder->setMaxSimturnsDuration(0);
@ -301,17 +301,17 @@ void PlayerMessageProcessor::startVoting(PlayerColor initiator, ECurrentChatVote
switch(currentVote) switch(currentVote)
{ {
case ECurrentChatVote::SIMTURNS_ALLOW: case ECurrentChatVote::SIMTURNS_ALLOW:
msg.appendTextID("vcmi.broadcast.vote.start.untilcontacts"); msg.appendTextID("vcmi.broadcast.vote.start.untilContacts");
msg.replaceRawString(std::to_string(parameter)); msg.replaceRawString(std::to_string(parameter));
broadcastSystemMessage(msg); broadcastSystemMessage(msg);
break; break;
case ECurrentChatVote::SIMTURNS_FORCE: case ECurrentChatVote::SIMTURNS_FORCE:
msg.appendTextID("vcmi.broadcast.vote.start.contactsblocked"); msg.appendTextID("vcmi.broadcast.vote.start.contactsBlocked");
msg.replaceRawString(std::to_string(parameter)); msg.replaceRawString(std::to_string(parameter));
broadcastSystemMessage(msg); broadcastSystemMessage(msg);
break; break;
case ECurrentChatVote::SIMTURNS_ABORT: case ECurrentChatVote::SIMTURNS_ABORT:
msg.appendTextID("vcmi.broadcast.vote.start.nextday"); msg.appendTextID("vcmi.broadcast.vote.start.nextDay");
broadcastSystemMessage(msg); broadcastSystemMessage(msg);
break; break;
case ECurrentChatVote::TIMER_PROLONG: case ECurrentChatVote::TIMER_PROLONG:

View File

@ -83,7 +83,7 @@ void TurnOrderProcessor::updateAndNotifyContactStatus()
continue; continue;
MetaString message; MetaString message;
message.appendTextID("vcmi.broadcast.simturn.endbetween"); message.appendTextID("vcmi.broadcast.simturn.endBetween");
message.replaceName(contact.a); message.replaceName(contact.a);
message.replaceName(contact.b); message.replaceName(contact.b);