diff --git a/locale/admin_patches.pot b/locale/admin_patches.pot index 521c35a1..57aeb6d5 100644 --- a/locale/admin_patches.pot +++ b/locale/admin_patches.pot @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PROJECT VERSION\n" "Report-Msgid-Bugs-To: EMAIL@ADDRESS\n" -"POT-Creation-Date: 2019-10-06 15:35+0100\n" +"POT-Creation-Date: 2019-10-07 14:28+0100\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" diff --git a/locale/en_GB/admin_patches.po b/locale/en_GB/admin_patches.po index 1edd03da..9a8d9c1f 100644 --- a/locale/en_GB/admin_patches.po +++ b/locale/en_GB/admin_patches.po @@ -7,8 +7,8 @@ msgid "" msgstr "" "Project-Id-Version: PROJECT VERSION\n" "Report-Msgid-Bugs-To: EMAIL@ADDRESS\n" -"POT-Creation-Date: 2019-10-06 15:35+0100\n" -"PO-Revision-Date: 2019-10-06 15:35+0100\n" +"POT-Creation-Date: 2019-10-07 14:28+0100\n" +"PO-Revision-Date: 2019-10-07 14:28+0100\n" "Last-Translator: FULL NAME \n" "Language: en_GB\n" "Language-Team: en_GB \n" diff --git a/locale/en_GB/magicked_admin.po b/locale/en_GB/magicked_admin.po index 60961ddd..dd07930f 100644 --- a/locale/en_GB/magicked_admin.po +++ b/locale/en_GB/magicked_admin.po @@ -7,8 +7,8 @@ msgid "" msgstr "" "Project-Id-Version: PROJECT VERSION\n" "Report-Msgid-Bugs-To: EMAIL@ADDRESS\n" -"POT-Creation-Date: 2019-10-06 15:35+0100\n" -"PO-Revision-Date: 2019-10-06 15:35+0100\n" +"POT-Creation-Date: 2019-10-07 14:28+0100\n" +"PO-Revision-Date: 2019-10-07 14:28+0100\n" "Last-Translator: FULL NAME \n" "Language: en_GB\n" "Language-Team: en_GB \n" @@ -113,11 +113,11 @@ msgid "" "; silent\n" msgstr "" -#: magicked_admin/chatbot/chatbot.py:22 +#: magicked_admin/chatbot/chatbot.py:21 msgid "Unnamed" msgstr "" -#: magicked_admin/chatbot/chatbot.py:60 +#: magicked_admin/chatbot/chatbot.py:59 msgid "Executing script: " msgstr "" @@ -328,11 +328,569 @@ msgstr "" msgid "Auth failure, username: {}, user flags: {:b}" msgstr "" +#: magicked_admin/chatbot/commands/event_commands.py:15 +msgid "" +"Usage: !start_jc COMMAND\n" +"\tCOMMAND - Command to run\n" +"Desc: Runs a command when a player joins the match" +msgstr "" + +#: magicked_admin/chatbot/commands/event_commands.py:32 +#: magicked_admin/chatbot/commands/event_commands.py:98 +#: magicked_admin/chatbot/commands/event_commands.py:166 +#: magicked_admin/chatbot/commands/event_commands.py:222 +msgid "Please specify a command to run" +msgstr "" + +#: magicked_admin/chatbot/commands/event_commands.py:41 +msgid "Player join command started" +msgstr "" + +#: magicked_admin/chatbot/commands/event_commands.py:49 +msgid "" +"Usage: !stop_jc\n" +"Desc: Stops all join commands" +msgstr "" + +#: magicked_admin/chatbot/commands/event_commands.py:70 +msgid "" +"Usage: !start_wc [--wave] COMMAND\n" +"\t-w --wave - Optional, wave to run on\n" +"\tCOMMAND - Command to run\n" +"Desc: Run a command at the start of a wave, wave can be omitted top run " +"on every wave" +msgstr "" + +#: magicked_admin/chatbot/commands/event_commands.py:90 +#: magicked_admin/chatbot/commands/event_commands.py:230 +msgid "'{}' is not a valid wave number" +msgstr "" + +#: magicked_admin/chatbot/commands/event_commands.py:105 +msgid "Wave start command started" +msgstr "" + +#: magicked_admin/chatbot/commands/event_commands.py:113 +msgid "" +"Usage: !stop_wc\n" +"Desc: Stops all wave commands" +msgstr "" + +#: magicked_admin/chatbot/commands/event_commands.py:134 +msgid "" +"Usage: !start_tc [-r -t] COMMAND\n" +"\tCOMMAND - Command to run\n" +"\t-r --repeat - Optional, run repeatedly\n" +"\t-t --time - Seconds before running\n" +"Desc: Runs a command after some time delay" +msgstr "" + +#: magicked_admin/chatbot/commands/event_commands.py:152 +msgid "Please specify a time interval, '!start_tc -h' for help" +msgstr "" + +#: magicked_admin/chatbot/commands/event_commands.py:160 +msgid "'{}' is not a valid time interval" +msgstr "" + +#: magicked_admin/chatbot/commands/event_commands.py:175 +msgid "Time interval command started" +msgstr "" + +#: magicked_admin/chatbot/commands/event_commands.py:183 +msgid "" +"Usage: !stop_tc\n" +"Desc: Stops all timed commands" +msgstr "" + +#: magicked_admin/chatbot/commands/event_commands.py:204 +msgid "" +"Usage: !start_trc [--wave] COMMAND\n" +"\tCOMMAND - Command to run\n" +"\t-w --wave - Optional, wave to run on\n" +"Desc: Runs a command when the trader opens, wave can be omitted to run " +"every time the trader opens" +msgstr "" + +#: magicked_admin/chatbot/commands/event_commands.py:238 +msgid "Trader open command started" +msgstr "" + +#: magicked_admin/chatbot/commands/event_commands.py:246 +msgid "" +"Usage: !stop_trc\n" +"Desc: Stops all trader commands" +msgstr "" + +#: magicked_admin/chatbot/commands/info_commands.py:19 +msgid "" +"Usage: !marquee FILE\n" +"\tFILE - Some file in 'conf/marquee'\n" +"Desc: Runs a marquee in chat" +msgstr "" + +#: magicked_admin/chatbot/commands/info_commands.py:49 +msgid "Missing argument: filename" +msgstr "" + +#: magicked_admin/chatbot/commands/info_commands.py:53 +msgid "Couldn't find file" +msgstr "" + +#: magicked_admin/chatbot/commands/info_commands.py:78 +msgid "" +"Usage: !players\n" +"Desc: Shows the number of players currently online" +msgstr "" + +#: magicked_admin/chatbot/commands/info_commands.py:90 +msgid "{}/{} Players are online" +msgstr "" + +#: magicked_admin/chatbot/commands/info_commands.py:101 +msgid "" +"Usage: !players\n" +"Desc: Shows detailed information about online players" +msgstr "" + +#: magicked_admin/chatbot/commands/info_commands.py:114 +#: magicked_admin/chatbot/commands/player_commands.py:265 +msgid "No players in game" +msgstr "" + +#: magicked_admin/chatbot/commands/info_commands.py:127 +msgid "" +"Usage: !game\n" +"Desc: Shows current game info and rules" +msgstr "" + +#: magicked_admin/chatbot/commands/info_commands.py:144 +#: magicked_admin/chatbot/commands/server_commands.py:169 +msgid "" +"Usage: !map\n" +"Desc: Shows statistics about the current map" +msgstr "" + +#: magicked_admin/chatbot/commands/info_commands.py:161 +msgid "" +"Usage: !game_time\n" +"Desc: Shows the number of seconds since the match started. Excludes " +"trader time and the boss wave." +msgstr "" + +#: magicked_admin/chatbot/commands/info_commands.py:180 +msgid "" +"Usage: !record_wave\n" +"Desc: Shows the highest wave reached on this map" +msgstr "" + +#: magicked_admin/chatbot/commands/info_commands.py:191 +msgid "{} is the highest wave reached on this map" +msgstr "" + +#: magicked_admin/chatbot/commands/info_commands.py:201 +msgid "" +"Usage: !commands\n" +"Desc: Lists all player commands" +msgstr "" + +#: magicked_admin/chatbot/commands/info_commands.py:211 +msgid "" +"\n" +"Available commands:\n" +"\t!record_wave,\n" +"\t!game,\n" +"\t!kills,\n" +"\t!dosh,\n" +"\t!top_kills,\n" +"\t!top_dosh,\n" +"\t!top_time,\n" +"\t!stats,\n" +"\t!game_time,\n" +"\t!server_kills,\n" +"\t!server_dosh,\n" +"\t!map,\n" +"\t!maps,\n" +"\t!player_count\n" +"Commands have help, e.g. '!stats -h'" +msgstr "" + +#: magicked_admin/chatbot/commands/info_commands.py:235 +msgid "" +"Usage: !stats USERNAME\n" +"\tUSERNAME - Person to get stats for\n" +"Desc: Shows statistics about a player, username can be omitted to get " +"personal stats" +msgstr "" + +#: magicked_admin/chatbot/commands/info_commands.py:273 +msgid "" +"Stats for {}:\n" +"Total play time: {} ({} sessions)\n" +"Total deaths: {}\n" +"Total kills: {} (rank #{}) \n" +"Total dosh earned: £{} (rank #{})\n" +"Dosh this game: {}" +msgstr "" + +#: magicked_admin/chatbot/commands/player_commands.py:14 +msgid "" +"Usage: !server_dosh\n" +"Desc: Shows total dosh earned on this server" +msgstr "" + +#: magicked_admin/chatbot/commands/player_commands.py:27 +msgid "£{} has been earned on this server" +msgstr "" + +#: magicked_admin/chatbot/commands/player_commands.py:36 +msgid "" +"Usage: !server_kills\n" +"Desc: Shows total ZEDs killed on this server" +msgstr "" + +#: magicked_admin/chatbot/commands/player_commands.py:49 +msgid "{} ZEDs have been killed on this server" +msgstr "" + +#: magicked_admin/chatbot/commands/player_commands.py:59 +msgid "" +"Usage: !kills USERNAME\n" +"\tUSERNAME - User to get kill stats for\n" +"Desc: Shows kill statistics for a player, username can be omitted to get " +"personal stats" +msgstr "" + +#: magicked_admin/chatbot/commands/player_commands.py:79 +msgid "You've killed a total of {} ZEDs (#{}), and {} this game" +msgstr "" + +#: magicked_admin/chatbot/commands/player_commands.py:89 +msgid "Player {} not in game" +msgstr "" + +#: magicked_admin/chatbot/commands/player_commands.py:97 +msgid "" +"Usage: !dosh USERNAME\n" +"\tUSERNAME - User to get dosh stats for\n" +"Desc: Shows dosh statistics for a player, username can be omitted to get " +"personal stats" +msgstr "" + +#: magicked_admin/chatbot/commands/player_commands.py:117 +msgid "You've earned a total of £{} dosh (#{}), and £{} this game" +msgstr "" + +#: magicked_admin/chatbot/commands/player_commands.py:127 +msgid "Player not in game" +msgstr "" + +#: magicked_admin/chatbot/commands/player_commands.py:134 +msgid "" +"Usage: !top_kills\n" +"Desc: Show the global kills leaderboard" +msgstr "" + +#: magicked_admin/chatbot/commands/player_commands.py:147 +msgid "Top 5 players by total kills:\n" +msgstr "" + +#: magicked_admin/chatbot/commands/player_commands.py:163 +msgid "" +"Usage: !top_dosh\n" +"Desc: Shows the global dosh leaderboard" +msgstr "" + +#: magicked_admin/chatbot/commands/player_commands.py:176 +msgid "Top 5 players by Dosh earned:\n" +msgstr "" + +#: magicked_admin/chatbot/commands/player_commands.py:192 +msgid "" +"Usage: !top_time\n" +"Desc: Shows the global play time leaderboard" +msgstr "" + +#: magicked_admin/chatbot/commands/player_commands.py:205 +msgid "Top 5 players by play time:\n" +msgstr "" + +#: magicked_admin/chatbot/commands/player_commands.py:221 +msgid "" +"Usage: !scoreboard\n" +"Desc: Shows full player scoreboard" +msgstr "" + +#: magicked_admin/chatbot/commands/player_commands.py:231 +msgid "Scoreboard (name, kills, dosh):\n" +msgstr "" + +#: magicked_admin/chatbot/commands/player_commands.py:242 +msgid "{}\t- {} Kills, £{}\n" +msgstr "" + +#: magicked_admin/chatbot/commands/player_commands.py:253 +msgid "" +"Usage: !top_wave_kills\n" +"Desc: Shows who killed the most ZEDs in this wave" +msgstr "" + +#: magicked_admin/chatbot/commands/player_commands.py:274 +msgid "Player {} killed the most ZEDs this wave: {}" +msgstr "" + +#: magicked_admin/chatbot/commands/player_commands.py:285 +msgid "" +"Usage: !top_wave_dosh\n" +"Desc: Shows who earned the most dosh this wave" +msgstr "" + +#: magicked_admin/chatbot/commands/player_commands.py:305 +msgid "Player {} earned the most Dosh this wave: £{}" +msgstr "" + +#: magicked_admin/chatbot/commands/server_commands.py:17 +msgid "" +"Usage: !ban USERNAME\n" +"\tUSERNAME - Player to ban\n" +"Desc: Bans a player from the server" +msgstr "" + +#: magicked_admin/chatbot/commands/server_commands.py:32 +#: magicked_admin/chatbot/commands/server_commands.py:90 +#: magicked_admin/chatbot/commands/server_commands.py:126 +#: magicked_admin/chatbot/commands/server_commands.py:245 +msgid "Missing argument, username or Steam ID" +msgstr "" + +#: magicked_admin/chatbot/commands/server_commands.py:39 +msgid "Player, {}, was banned" +msgstr "" + +#: magicked_admin/chatbot/commands/server_commands.py:42 +#: magicked_admin/chatbot/commands/server_commands.py:255 +msgid "Player not found" +msgstr "" + +#: magicked_admin/chatbot/commands/server_commands.py:49 +msgid "" +"Usage: !say MESSAGE\n" +"\tMESSAGE - Message to echo\n" +"Desc: Echos a message in chat" +msgstr "" + +#: magicked_admin/chatbot/commands/server_commands.py:74 +msgid "" +"Usage: !op USERNAME\n" +"\tUSERNAME - Player to give operator status\n" +"Desc: Allows a player to use admin commands" +msgstr "" + +#: magicked_admin/chatbot/commands/server_commands.py:95 +#: magicked_admin/chatbot/commands/server_commands.py:131 +msgid "Couldn't find player '{}'" +msgstr "" + +#: magicked_admin/chatbot/commands/server_commands.py:98 +msgid "Oped {}" +msgstr "" + +#: magicked_admin/chatbot/commands/server_commands.py:109 +msgid "" +"Usage: !deop USERNAME\n" +"\tUSERNAME - Player to revoke op status for\n" +"Desc: Revokes a players ability to use admin commands" +msgstr "" + +#: magicked_admin/chatbot/commands/server_commands.py:134 +msgid "Deoped {}" +msgstr "" + +#: magicked_admin/chatbot/commands/server_commands.py:145 +msgid "" +"Usage: !maps [--all]\n" +"\t-a --all - Show all available maps\n" +"Desc: Shows maps that are in the map cycle" +msgstr "" + +#: magicked_admin/chatbot/commands/server_commands.py:197 +msgid "Stats for {}:\n" +msgstr "" + +#: magicked_admin/chatbot/commands/server_commands.py:198 +msgid "Total plays: {} \n" +msgstr "" + +#: magicked_admin/chatbot/commands/server_commands.py:199 +msgid "Record wave: {} \n" +msgstr "" + +#: magicked_admin/chatbot/commands/server_commands.py:200 +msgid "Survival wins: {} \n" +msgstr "" + +#: magicked_admin/chatbot/commands/server_commands.py:209 +msgid "" +"Usage: !enforce_dosh\n" +"Desc: Kicks players with more dosh than the threshold configured in " +"'conf/magicked_admin.conf'" +msgstr "" + +#: magicked_admin/chatbot/commands/server_commands.py:230 +msgid "" +"Usage: !kick USERNAME\n" +"\tUSERNAME - Player to kick\n" +"Desc: Kicks a player from the match" +msgstr "" + +#: magicked_admin/chatbot/commands/server_commands.py:252 +msgid "Player, {}, was kicked" +msgstr "" + +#: magicked_admin/chatbot/commands/server_commands.py:263 +msgid "" +"Usage: !run FILE\n" +"\tFILE - Some file in 'conf/scripts'\n" +"Desc: Runs a script" +msgstr "" + +#: magicked_admin/chatbot/commands/server_commands.py:278 +msgid "No script was specified" +msgstr "" + +#: magicked_admin/chatbot/commands/server_commands.py:283 +msgid "Script not found" +msgstr "" + +#: magicked_admin/chatbot/commands/server_commands.py:292 +msgid "" +"Usage: !restart\n" +"Desc: Restarts the match" +msgstr "" + +#: magicked_admin/chatbot/commands/server_commands.py:303 +msgid "Restarting map..." +msgstr "" + +#: magicked_admin/chatbot/commands/server_commands.py:310 +msgid "" +"Usage: !load_map MAP_NAME\n" +"\tMAP_NAME - Map to load\n" +"Desc: Immediately changes the map." +msgstr "" + +#: magicked_admin/chatbot/commands/server_commands.py:323 +msgid "Missing argument (map name)" +msgstr "" + +#: magicked_admin/chatbot/commands/server_commands.py:326 +msgid "Changing map" +msgstr "" + +#: magicked_admin/chatbot/commands/server_commands.py:333 +msgid "" +"Usage: !password [--set] STATE\n" +"\tSTATE - On, off, or new password\n" +"\t-s --set - Set a new password\n" +"Desc: Enables or disables the game password configured in " +"'conf/magicked_admin.conf', state can be on, off, or a new password." +msgstr "" + +#: magicked_admin/chatbot/commands/server_commands.py:352 +msgid "Game password is currently {}" +msgstr "" + +#: magicked_admin/chatbot/commands/server_commands.py:353 +msgid "enabled" +msgstr "" + +#: magicked_admin/chatbot/commands/server_commands.py:353 +msgid "disabled" +msgstr "" + +#: magicked_admin/chatbot/commands/server_commands.py:364 +msgid "Game password enabled" +msgstr "" + +#: magicked_admin/chatbot/commands/server_commands.py:368 +msgid "Game password disabled" +msgstr "" + +#: magicked_admin/chatbot/commands/server_commands.py:371 +msgid "Unrecognised option {}" +msgstr "" + +#: magicked_admin/chatbot/commands/server_commands.py:381 +msgid "" +"Usage: !silent [--quiet]\n" +"\t-q --quiet - Suppresses output'\n" +"Desc: Toggles command output globally" +msgstr "" + +#: magicked_admin/chatbot/commands/server_commands.py:394 +msgid "Silent mode disabled" +msgstr "" + +#: magicked_admin/chatbot/commands/server_commands.py:396 +msgid "Silent mode enabled" +msgstr "" + +#: magicked_admin/chatbot/commands/server_commands.py:410 +msgid "" +"Usage: !length LENGTH\n" +"\tLENGTH - Length to change to\n" +"Desc: Changes the game length next match" +msgstr "" + +#: magicked_admin/chatbot/commands/server_commands.py:423 +#: magicked_admin/chatbot/commands/server_commands.py:435 +msgid "Length not recognised, options are: short, medium, or long" +msgstr "" + +#: magicked_admin/chatbot/commands/server_commands.py:442 +msgid "Length change will take effect next game" +msgstr "" + +#: magicked_admin/chatbot/commands/server_commands.py:451 +msgid "" +"Usage: !difficulty DIFFICULTY\n" +"\tDIFFICULTY - Difficulty to change to\n" +"Desc: Changes the difficulty next match" +msgstr "" + +#: magicked_admin/chatbot/commands/server_commands.py:464 +#: magicked_admin/chatbot/commands/server_commands.py:478 +msgid "Difficulty not recognised, options are: normal, hard, suicidal, or hell" +msgstr "" + +#: magicked_admin/chatbot/commands/server_commands.py:485 +msgid "Difficulty change will take effect next game" +msgstr "" + +#: magicked_admin/chatbot/commands/server_commands.py:494 +msgid "" +"Usage: !game_mode MODE\n" +"\tMODE - Mode to change to\n" +"Desc: Immediately changes the game mode" +msgstr "" + +#: magicked_admin/chatbot/commands/server_commands.py:508 +msgid "Mode not recognised, options are: endless, survival, weekly or versus" +msgstr "" + +#: magicked_admin/chatbot/commands/server_commands.py:523 +msgid "GameMode not recognised, options are: endless, survival, weekly or versus" +msgstr "" + +#: magicked_admin/chatbot/commands/server_commands.py:530 +msgid "Game mode will be changed to {}" +msgstr "" + #: magicked_admin/database/database.py:29 msgid "Building new database..." msgstr "" -#: magicked_admin/server/game.py:29 +#: magicked_admin/server/game.py:30 msgid "" "Mode: {}\n" "Map: {}\n" @@ -340,7 +898,7 @@ msgid "" "Wave {}/{}" msgstr "" -#: magicked_admin/server/game.py:69 +#: magicked_admin/server/game.py:70 msgid "" "Title: {}\n" "Plays survival: {}\n" @@ -367,7 +925,7 @@ msgstr "" msgid "Scoreboard_type not recognised '{}' for {}. Options are: dosh, kills" msgstr "" -#: magicked_admin/server/player.py:38 magicked_admin/utils/net.py:58 +#: magicked_admin/server/player.py:38 magicked_admin/utils/net.py:59 msgid "Unknown" msgstr "" @@ -379,43 +937,43 @@ msgid "" "Steam ID:{}" msgstr "" -#: magicked_admin/server/server.py:19 +#: magicked_admin/server/server.py:20 msgid "Connecting to {} ({})..." msgstr "" -#: magicked_admin/server/server.py:21 +#: magicked_admin/server/server.py:22 msgid "Connected to {} ({})" msgstr "" -#: magicked_admin/server/server.py:90 +#: magicked_admin/server/server.py:91 msgid "Flushing players on {}" msgstr "" -#: magicked_admin/server/server.py:95 +#: magicked_admin/server/server.py:96 msgid "Writing game to database ({})" msgstr "" -#: magicked_admin/server/server.py:194 +#: magicked_admin/server/server.py:195 msgid "Player {} joined {} from {}" msgstr "" -#: magicked_admin/server/server.py:207 +#: magicked_admin/server/server.py:208 msgid "Player {} left {}" msgstr "" -#: magicked_admin/server/server.py:216 +#: magicked_admin/server/server.py:217 msgid "Player {} died on {}" msgstr "" -#: magicked_admin/server/server.py:220 +#: magicked_admin/server/server.py:221 msgid "New game on {}, map: {}, mode: {}" msgstr "" -#: magicked_admin/server/server.py:237 +#: magicked_admin/server/server.py:238 msgid "Unknown game_type {}" msgstr "" -#: magicked_admin/server/server.py:244 +#: magicked_admin/server/server.py:245 msgid "End game on {}, map: {}, mode: {}, victory: {}" msgstr "" @@ -425,36 +983,36 @@ msgid "" "Press enter to exit..." msgstr "" -#: magicked_admin/web_admin/web_admin.py:92 +#: magicked_admin/web_admin/web_admin.py:93 msgid "Tried to toggle game password before setting value" msgstr "" -#: magicked_admin/web_admin/web_admin.py:379 +#: magicked_admin/web_admin/web_admin.py:380 msgid "Couldn't find identify player: {}" msgstr "" -#: magicked_admin/web_admin/web_interface.py:59 -#: magicked_admin/web_admin/web_interface.py:98 +#: magicked_admin/web_admin/web_interface.py:60 +#: magicked_admin/web_admin/web_interface.py:99 msgid "Session killed, renewing!" msgstr "" -#: magicked_admin/web_admin/web_interface.py:121 +#: magicked_admin/web_admin/web_interface.py:122 msgid "Web admin not responding, sleeping" msgstr "" -#: magicked_admin/web_admin/web_interface.py:126 +#: magicked_admin/web_admin/web_interface.py:127 msgid "Web admin is back, resuming" msgstr "" -#: magicked_admin/web_admin/web_interface.py:162 +#: magicked_admin/web_admin/web_interface.py:163 msgid "Login failure, bad credentials or login attempts exceeded." msgstr "" -#: magicked_admin/web_admin/web_interface.py:167 +#: magicked_admin/web_admin/web_interface.py:168 msgid "Detected KF2-MA install on server." msgstr "" -#: magicked_admin/web_admin/web_interface.py:170 +#: magicked_admin/web_admin/web_interface.py:171 msgid "" "KF2-MA install not detected on server side! Consequently, only Survival " "mode will function fully." diff --git a/locale/magicked_admin.pot b/locale/magicked_admin.pot index 81b6be12..2e818326 100644 --- a/locale/magicked_admin.pot +++ b/locale/magicked_admin.pot @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PROJECT VERSION\n" "Report-Msgid-Bugs-To: EMAIL@ADDRESS\n" -"POT-Creation-Date: 2019-10-06 15:35+0100\n" +"POT-Creation-Date: 2019-10-07 14:28+0100\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -112,11 +112,11 @@ msgid "" "; silent\n" msgstr "" -#: magicked_admin/chatbot/chatbot.py:22 +#: magicked_admin/chatbot/chatbot.py:21 msgid "Unnamed" msgstr "" -#: magicked_admin/chatbot/chatbot.py:60 +#: magicked_admin/chatbot/chatbot.py:59 msgid "Executing script: " msgstr "" @@ -327,11 +327,569 @@ msgstr "" msgid "Auth failure, username: {}, user flags: {:b}" msgstr "" +#: magicked_admin/chatbot/commands/event_commands.py:15 +msgid "" +"Usage: !start_jc COMMAND\n" +"\tCOMMAND - Command to run\n" +"Desc: Runs a command when a player joins the match" +msgstr "" + +#: magicked_admin/chatbot/commands/event_commands.py:32 +#: magicked_admin/chatbot/commands/event_commands.py:98 +#: magicked_admin/chatbot/commands/event_commands.py:166 +#: magicked_admin/chatbot/commands/event_commands.py:222 +msgid "Please specify a command to run" +msgstr "" + +#: magicked_admin/chatbot/commands/event_commands.py:41 +msgid "Player join command started" +msgstr "" + +#: magicked_admin/chatbot/commands/event_commands.py:49 +msgid "" +"Usage: !stop_jc\n" +"Desc: Stops all join commands" +msgstr "" + +#: magicked_admin/chatbot/commands/event_commands.py:70 +msgid "" +"Usage: !start_wc [--wave] COMMAND\n" +"\t-w --wave - Optional, wave to run on\n" +"\tCOMMAND - Command to run\n" +"Desc: Run a command at the start of a wave, wave can be omitted top run " +"on every wave" +msgstr "" + +#: magicked_admin/chatbot/commands/event_commands.py:90 +#: magicked_admin/chatbot/commands/event_commands.py:230 +msgid "'{}' is not a valid wave number" +msgstr "" + +#: magicked_admin/chatbot/commands/event_commands.py:105 +msgid "Wave start command started" +msgstr "" + +#: magicked_admin/chatbot/commands/event_commands.py:113 +msgid "" +"Usage: !stop_wc\n" +"Desc: Stops all wave commands" +msgstr "" + +#: magicked_admin/chatbot/commands/event_commands.py:134 +msgid "" +"Usage: !start_tc [-r -t] COMMAND\n" +"\tCOMMAND - Command to run\n" +"\t-r --repeat - Optional, run repeatedly\n" +"\t-t --time - Seconds before running\n" +"Desc: Runs a command after some time delay" +msgstr "" + +#: magicked_admin/chatbot/commands/event_commands.py:152 +msgid "Please specify a time interval, '!start_tc -h' for help" +msgstr "" + +#: magicked_admin/chatbot/commands/event_commands.py:160 +msgid "'{}' is not a valid time interval" +msgstr "" + +#: magicked_admin/chatbot/commands/event_commands.py:175 +msgid "Time interval command started" +msgstr "" + +#: magicked_admin/chatbot/commands/event_commands.py:183 +msgid "" +"Usage: !stop_tc\n" +"Desc: Stops all timed commands" +msgstr "" + +#: magicked_admin/chatbot/commands/event_commands.py:204 +msgid "" +"Usage: !start_trc [--wave] COMMAND\n" +"\tCOMMAND - Command to run\n" +"\t-w --wave - Optional, wave to run on\n" +"Desc: Runs a command when the trader opens, wave can be omitted to run " +"every time the trader opens" +msgstr "" + +#: magicked_admin/chatbot/commands/event_commands.py:238 +msgid "Trader open command started" +msgstr "" + +#: magicked_admin/chatbot/commands/event_commands.py:246 +msgid "" +"Usage: !stop_trc\n" +"Desc: Stops all trader commands" +msgstr "" + +#: magicked_admin/chatbot/commands/info_commands.py:19 +msgid "" +"Usage: !marquee FILE\n" +"\tFILE - Some file in 'conf/marquee'\n" +"Desc: Runs a marquee in chat" +msgstr "" + +#: magicked_admin/chatbot/commands/info_commands.py:49 +msgid "Missing argument: filename" +msgstr "" + +#: magicked_admin/chatbot/commands/info_commands.py:53 +msgid "Couldn't find file" +msgstr "" + +#: magicked_admin/chatbot/commands/info_commands.py:78 +msgid "" +"Usage: !players\n" +"Desc: Shows the number of players currently online" +msgstr "" + +#: magicked_admin/chatbot/commands/info_commands.py:90 +msgid "{}/{} Players are online" +msgstr "" + +#: magicked_admin/chatbot/commands/info_commands.py:101 +msgid "" +"Usage: !players\n" +"Desc: Shows detailed information about online players" +msgstr "" + +#: magicked_admin/chatbot/commands/info_commands.py:114 +#: magicked_admin/chatbot/commands/player_commands.py:265 +msgid "No players in game" +msgstr "" + +#: magicked_admin/chatbot/commands/info_commands.py:127 +msgid "" +"Usage: !game\n" +"Desc: Shows current game info and rules" +msgstr "" + +#: magicked_admin/chatbot/commands/info_commands.py:144 +#: magicked_admin/chatbot/commands/server_commands.py:169 +msgid "" +"Usage: !map\n" +"Desc: Shows statistics about the current map" +msgstr "" + +#: magicked_admin/chatbot/commands/info_commands.py:161 +msgid "" +"Usage: !game_time\n" +"Desc: Shows the number of seconds since the match started. Excludes " +"trader time and the boss wave." +msgstr "" + +#: magicked_admin/chatbot/commands/info_commands.py:180 +msgid "" +"Usage: !record_wave\n" +"Desc: Shows the highest wave reached on this map" +msgstr "" + +#: magicked_admin/chatbot/commands/info_commands.py:191 +msgid "{} is the highest wave reached on this map" +msgstr "" + +#: magicked_admin/chatbot/commands/info_commands.py:201 +msgid "" +"Usage: !commands\n" +"Desc: Lists all player commands" +msgstr "" + +#: magicked_admin/chatbot/commands/info_commands.py:211 +msgid "" +"\n" +"Available commands:\n" +"\t!record_wave,\n" +"\t!game,\n" +"\t!kills,\n" +"\t!dosh,\n" +"\t!top_kills,\n" +"\t!top_dosh,\n" +"\t!top_time,\n" +"\t!stats,\n" +"\t!game_time,\n" +"\t!server_kills,\n" +"\t!server_dosh,\n" +"\t!map,\n" +"\t!maps,\n" +"\t!player_count\n" +"Commands have help, e.g. '!stats -h'" +msgstr "" + +#: magicked_admin/chatbot/commands/info_commands.py:235 +msgid "" +"Usage: !stats USERNAME\n" +"\tUSERNAME - Person to get stats for\n" +"Desc: Shows statistics about a player, username can be omitted to get " +"personal stats" +msgstr "" + +#: magicked_admin/chatbot/commands/info_commands.py:273 +msgid "" +"Stats for {}:\n" +"Total play time: {} ({} sessions)\n" +"Total deaths: {}\n" +"Total kills: {} (rank #{}) \n" +"Total dosh earned: £{} (rank #{})\n" +"Dosh this game: {}" +msgstr "" + +#: magicked_admin/chatbot/commands/player_commands.py:14 +msgid "" +"Usage: !server_dosh\n" +"Desc: Shows total dosh earned on this server" +msgstr "" + +#: magicked_admin/chatbot/commands/player_commands.py:27 +msgid "£{} has been earned on this server" +msgstr "" + +#: magicked_admin/chatbot/commands/player_commands.py:36 +msgid "" +"Usage: !server_kills\n" +"Desc: Shows total ZEDs killed on this server" +msgstr "" + +#: magicked_admin/chatbot/commands/player_commands.py:49 +msgid "{} ZEDs have been killed on this server" +msgstr "" + +#: magicked_admin/chatbot/commands/player_commands.py:59 +msgid "" +"Usage: !kills USERNAME\n" +"\tUSERNAME - User to get kill stats for\n" +"Desc: Shows kill statistics for a player, username can be omitted to get " +"personal stats" +msgstr "" + +#: magicked_admin/chatbot/commands/player_commands.py:79 +msgid "You've killed a total of {} ZEDs (#{}), and {} this game" +msgstr "" + +#: magicked_admin/chatbot/commands/player_commands.py:89 +msgid "Player {} not in game" +msgstr "" + +#: magicked_admin/chatbot/commands/player_commands.py:97 +msgid "" +"Usage: !dosh USERNAME\n" +"\tUSERNAME - User to get dosh stats for\n" +"Desc: Shows dosh statistics for a player, username can be omitted to get " +"personal stats" +msgstr "" + +#: magicked_admin/chatbot/commands/player_commands.py:117 +msgid "You've earned a total of £{} dosh (#{}), and £{} this game" +msgstr "" + +#: magicked_admin/chatbot/commands/player_commands.py:127 +msgid "Player not in game" +msgstr "" + +#: magicked_admin/chatbot/commands/player_commands.py:134 +msgid "" +"Usage: !top_kills\n" +"Desc: Show the global kills leaderboard" +msgstr "" + +#: magicked_admin/chatbot/commands/player_commands.py:147 +msgid "Top 5 players by total kills:\n" +msgstr "" + +#: magicked_admin/chatbot/commands/player_commands.py:163 +msgid "" +"Usage: !top_dosh\n" +"Desc: Shows the global dosh leaderboard" +msgstr "" + +#: magicked_admin/chatbot/commands/player_commands.py:176 +msgid "Top 5 players by Dosh earned:\n" +msgstr "" + +#: magicked_admin/chatbot/commands/player_commands.py:192 +msgid "" +"Usage: !top_time\n" +"Desc: Shows the global play time leaderboard" +msgstr "" + +#: magicked_admin/chatbot/commands/player_commands.py:205 +msgid "Top 5 players by play time:\n" +msgstr "" + +#: magicked_admin/chatbot/commands/player_commands.py:221 +msgid "" +"Usage: !scoreboard\n" +"Desc: Shows full player scoreboard" +msgstr "" + +#: magicked_admin/chatbot/commands/player_commands.py:231 +msgid "Scoreboard (name, kills, dosh):\n" +msgstr "" + +#: magicked_admin/chatbot/commands/player_commands.py:242 +msgid "{}\t- {} Kills, £{}\n" +msgstr "" + +#: magicked_admin/chatbot/commands/player_commands.py:253 +msgid "" +"Usage: !top_wave_kills\n" +"Desc: Shows who killed the most ZEDs in this wave" +msgstr "" + +#: magicked_admin/chatbot/commands/player_commands.py:274 +msgid "Player {} killed the most ZEDs this wave: {}" +msgstr "" + +#: magicked_admin/chatbot/commands/player_commands.py:285 +msgid "" +"Usage: !top_wave_dosh\n" +"Desc: Shows who earned the most dosh this wave" +msgstr "" + +#: magicked_admin/chatbot/commands/player_commands.py:305 +msgid "Player {} earned the most Dosh this wave: £{}" +msgstr "" + +#: magicked_admin/chatbot/commands/server_commands.py:17 +msgid "" +"Usage: !ban USERNAME\n" +"\tUSERNAME - Player to ban\n" +"Desc: Bans a player from the server" +msgstr "" + +#: magicked_admin/chatbot/commands/server_commands.py:32 +#: magicked_admin/chatbot/commands/server_commands.py:90 +#: magicked_admin/chatbot/commands/server_commands.py:126 +#: magicked_admin/chatbot/commands/server_commands.py:245 +msgid "Missing argument, username or Steam ID" +msgstr "" + +#: magicked_admin/chatbot/commands/server_commands.py:39 +msgid "Player, {}, was banned" +msgstr "" + +#: magicked_admin/chatbot/commands/server_commands.py:42 +#: magicked_admin/chatbot/commands/server_commands.py:255 +msgid "Player not found" +msgstr "" + +#: magicked_admin/chatbot/commands/server_commands.py:49 +msgid "" +"Usage: !say MESSAGE\n" +"\tMESSAGE - Message to echo\n" +"Desc: Echos a message in chat" +msgstr "" + +#: magicked_admin/chatbot/commands/server_commands.py:74 +msgid "" +"Usage: !op USERNAME\n" +"\tUSERNAME - Player to give operator status\n" +"Desc: Allows a player to use admin commands" +msgstr "" + +#: magicked_admin/chatbot/commands/server_commands.py:95 +#: magicked_admin/chatbot/commands/server_commands.py:131 +msgid "Couldn't find player '{}'" +msgstr "" + +#: magicked_admin/chatbot/commands/server_commands.py:98 +msgid "Oped {}" +msgstr "" + +#: magicked_admin/chatbot/commands/server_commands.py:109 +msgid "" +"Usage: !deop USERNAME\n" +"\tUSERNAME - Player to revoke op status for\n" +"Desc: Revokes a players ability to use admin commands" +msgstr "" + +#: magicked_admin/chatbot/commands/server_commands.py:134 +msgid "Deoped {}" +msgstr "" + +#: magicked_admin/chatbot/commands/server_commands.py:145 +msgid "" +"Usage: !maps [--all]\n" +"\t-a --all - Show all available maps\n" +"Desc: Shows maps that are in the map cycle" +msgstr "" + +#: magicked_admin/chatbot/commands/server_commands.py:197 +msgid "Stats for {}:\n" +msgstr "" + +#: magicked_admin/chatbot/commands/server_commands.py:198 +msgid "Total plays: {} \n" +msgstr "" + +#: magicked_admin/chatbot/commands/server_commands.py:199 +msgid "Record wave: {} \n" +msgstr "" + +#: magicked_admin/chatbot/commands/server_commands.py:200 +msgid "Survival wins: {} \n" +msgstr "" + +#: magicked_admin/chatbot/commands/server_commands.py:209 +msgid "" +"Usage: !enforce_dosh\n" +"Desc: Kicks players with more dosh than the threshold configured in " +"'conf/magicked_admin.conf'" +msgstr "" + +#: magicked_admin/chatbot/commands/server_commands.py:230 +msgid "" +"Usage: !kick USERNAME\n" +"\tUSERNAME - Player to kick\n" +"Desc: Kicks a player from the match" +msgstr "" + +#: magicked_admin/chatbot/commands/server_commands.py:252 +msgid "Player, {}, was kicked" +msgstr "" + +#: magicked_admin/chatbot/commands/server_commands.py:263 +msgid "" +"Usage: !run FILE\n" +"\tFILE - Some file in 'conf/scripts'\n" +"Desc: Runs a script" +msgstr "" + +#: magicked_admin/chatbot/commands/server_commands.py:278 +msgid "No script was specified" +msgstr "" + +#: magicked_admin/chatbot/commands/server_commands.py:283 +msgid "Script not found" +msgstr "" + +#: magicked_admin/chatbot/commands/server_commands.py:292 +msgid "" +"Usage: !restart\n" +"Desc: Restarts the match" +msgstr "" + +#: magicked_admin/chatbot/commands/server_commands.py:303 +msgid "Restarting map..." +msgstr "" + +#: magicked_admin/chatbot/commands/server_commands.py:310 +msgid "" +"Usage: !load_map MAP_NAME\n" +"\tMAP_NAME - Map to load\n" +"Desc: Immediately changes the map." +msgstr "" + +#: magicked_admin/chatbot/commands/server_commands.py:323 +msgid "Missing argument (map name)" +msgstr "" + +#: magicked_admin/chatbot/commands/server_commands.py:326 +msgid "Changing map" +msgstr "" + +#: magicked_admin/chatbot/commands/server_commands.py:333 +msgid "" +"Usage: !password [--set] STATE\n" +"\tSTATE - On, off, or new password\n" +"\t-s --set - Set a new password\n" +"Desc: Enables or disables the game password configured in " +"'conf/magicked_admin.conf', state can be on, off, or a new password." +msgstr "" + +#: magicked_admin/chatbot/commands/server_commands.py:352 +msgid "Game password is currently {}" +msgstr "" + +#: magicked_admin/chatbot/commands/server_commands.py:353 +msgid "enabled" +msgstr "" + +#: magicked_admin/chatbot/commands/server_commands.py:353 +msgid "disabled" +msgstr "" + +#: magicked_admin/chatbot/commands/server_commands.py:364 +msgid "Game password enabled" +msgstr "" + +#: magicked_admin/chatbot/commands/server_commands.py:368 +msgid "Game password disabled" +msgstr "" + +#: magicked_admin/chatbot/commands/server_commands.py:371 +msgid "Unrecognised option {}" +msgstr "" + +#: magicked_admin/chatbot/commands/server_commands.py:381 +msgid "" +"Usage: !silent [--quiet]\n" +"\t-q --quiet - Suppresses output'\n" +"Desc: Toggles command output globally" +msgstr "" + +#: magicked_admin/chatbot/commands/server_commands.py:394 +msgid "Silent mode disabled" +msgstr "" + +#: magicked_admin/chatbot/commands/server_commands.py:396 +msgid "Silent mode enabled" +msgstr "" + +#: magicked_admin/chatbot/commands/server_commands.py:410 +msgid "" +"Usage: !length LENGTH\n" +"\tLENGTH - Length to change to\n" +"Desc: Changes the game length next match" +msgstr "" + +#: magicked_admin/chatbot/commands/server_commands.py:423 +#: magicked_admin/chatbot/commands/server_commands.py:435 +msgid "Length not recognised, options are: short, medium, or long" +msgstr "" + +#: magicked_admin/chatbot/commands/server_commands.py:442 +msgid "Length change will take effect next game" +msgstr "" + +#: magicked_admin/chatbot/commands/server_commands.py:451 +msgid "" +"Usage: !difficulty DIFFICULTY\n" +"\tDIFFICULTY - Difficulty to change to\n" +"Desc: Changes the difficulty next match" +msgstr "" + +#: magicked_admin/chatbot/commands/server_commands.py:464 +#: magicked_admin/chatbot/commands/server_commands.py:478 +msgid "Difficulty not recognised, options are: normal, hard, suicidal, or hell" +msgstr "" + +#: magicked_admin/chatbot/commands/server_commands.py:485 +msgid "Difficulty change will take effect next game" +msgstr "" + +#: magicked_admin/chatbot/commands/server_commands.py:494 +msgid "" +"Usage: !game_mode MODE\n" +"\tMODE - Mode to change to\n" +"Desc: Immediately changes the game mode" +msgstr "" + +#: magicked_admin/chatbot/commands/server_commands.py:508 +msgid "Mode not recognised, options are: endless, survival, weekly or versus" +msgstr "" + +#: magicked_admin/chatbot/commands/server_commands.py:523 +msgid "GameMode not recognised, options are: endless, survival, weekly or versus" +msgstr "" + +#: magicked_admin/chatbot/commands/server_commands.py:530 +msgid "Game mode will be changed to {}" +msgstr "" + #: magicked_admin/database/database.py:29 msgid "Building new database..." msgstr "" -#: magicked_admin/server/game.py:29 +#: magicked_admin/server/game.py:30 msgid "" "Mode: {}\n" "Map: {}\n" @@ -339,7 +897,7 @@ msgid "" "Wave {}/{}" msgstr "" -#: magicked_admin/server/game.py:69 +#: magicked_admin/server/game.py:70 msgid "" "Title: {}\n" "Plays survival: {}\n" @@ -366,7 +924,7 @@ msgstr "" msgid "Scoreboard_type not recognised '{}' for {}. Options are: dosh, kills" msgstr "" -#: magicked_admin/server/player.py:38 magicked_admin/utils/net.py:58 +#: magicked_admin/server/player.py:38 magicked_admin/utils/net.py:59 msgid "Unknown" msgstr "" @@ -378,43 +936,43 @@ msgid "" "Steam ID:{}" msgstr "" -#: magicked_admin/server/server.py:19 +#: magicked_admin/server/server.py:20 msgid "Connecting to {} ({})..." msgstr "" -#: magicked_admin/server/server.py:21 +#: magicked_admin/server/server.py:22 msgid "Connected to {} ({})" msgstr "" -#: magicked_admin/server/server.py:90 +#: magicked_admin/server/server.py:91 msgid "Flushing players on {}" msgstr "" -#: magicked_admin/server/server.py:95 +#: magicked_admin/server/server.py:96 msgid "Writing game to database ({})" msgstr "" -#: magicked_admin/server/server.py:194 +#: magicked_admin/server/server.py:195 msgid "Player {} joined {} from {}" msgstr "" -#: magicked_admin/server/server.py:207 +#: magicked_admin/server/server.py:208 msgid "Player {} left {}" msgstr "" -#: magicked_admin/server/server.py:216 +#: magicked_admin/server/server.py:217 msgid "Player {} died on {}" msgstr "" -#: magicked_admin/server/server.py:220 +#: magicked_admin/server/server.py:221 msgid "New game on {}, map: {}, mode: {}" msgstr "" -#: magicked_admin/server/server.py:237 +#: magicked_admin/server/server.py:238 msgid "Unknown game_type {}" msgstr "" -#: magicked_admin/server/server.py:244 +#: magicked_admin/server/server.py:245 msgid "End game on {}, map: {}, mode: {}, victory: {}" msgstr "" @@ -424,36 +982,36 @@ msgid "" "Press enter to exit..." msgstr "" -#: magicked_admin/web_admin/web_admin.py:92 +#: magicked_admin/web_admin/web_admin.py:93 msgid "Tried to toggle game password before setting value" msgstr "" -#: magicked_admin/web_admin/web_admin.py:379 +#: magicked_admin/web_admin/web_admin.py:380 msgid "Couldn't find identify player: {}" msgstr "" -#: magicked_admin/web_admin/web_interface.py:59 -#: magicked_admin/web_admin/web_interface.py:98 +#: magicked_admin/web_admin/web_interface.py:60 +#: magicked_admin/web_admin/web_interface.py:99 msgid "Session killed, renewing!" msgstr "" -#: magicked_admin/web_admin/web_interface.py:121 +#: magicked_admin/web_admin/web_interface.py:122 msgid "Web admin not responding, sleeping" msgstr "" -#: magicked_admin/web_admin/web_interface.py:126 +#: magicked_admin/web_admin/web_interface.py:127 msgid "Web admin is back, resuming" msgstr "" -#: magicked_admin/web_admin/web_interface.py:162 +#: magicked_admin/web_admin/web_interface.py:163 msgid "Login failure, bad credentials or login attempts exceeded." msgstr "" -#: magicked_admin/web_admin/web_interface.py:167 +#: magicked_admin/web_admin/web_interface.py:168 msgid "Detected KF2-MA install on server." msgstr "" -#: magicked_admin/web_admin/web_interface.py:170 +#: magicked_admin/web_admin/web_interface.py:171 msgid "" "KF2-MA install not detected on server side! Consequently, only Survival " "mode will function fully." diff --git a/magicked_admin/chatbot/commands/event_commands.py b/magicked_admin/chatbot/commands/event_commands.py index 243d190d..96d7912e 100644 --- a/magicked_admin/chatbot/commands/event_commands.py +++ b/magicked_admin/chatbot/commands/event_commands.py @@ -1,16 +1,21 @@ +import gettext + from chatbot.command_scheduler import (ALL_WAVES, CommandOnJoin, CommandOnTime, CommandOnTrader, CommandOnWave) from chatbot.commands.command import Command +_ = gettext.gettext + class CommandStartJoinCommand(Command): def __init__(self, server, scheduler): Command.__init__(self, server, admin_only=True, requires_patch=False) self.scheduler = scheduler - self.help_text = "Usage: !start_jc COMMAND\n" \ - "\tCOMMAND - Command to run\n" \ - "Desc: Runs a command when a player joins the match" + self.help_text = _("Usage: !start_jc COMMAND\n" + "\tCOMMAND - Command to run\n" + "Desc: Runs a command when a player joins the " + "match") self.parser.add_argument("command", nargs="*") self.run_delay = 8 @@ -24,7 +29,7 @@ def execute(self, username, args, user_flags): if not args.command: return self.format_response( - "Please specify a command to run", args + _("Please specify a command to run"), args ) delayed_command = [ @@ -33,7 +38,7 @@ def execute(self, username, args, user_flags): command = CommandOnJoin(self.server, " ".join(delayed_command)) self.scheduler.schedule_command(command) - return self.format_response("Player join command started", args) + return self.format_response(_("Player join command started"), args) class CommandStopJoinCommands(Command): @@ -41,8 +46,8 @@ def __init__(self, server, scheduler): Command.__init__(self, server, admin_only=True, requires_patch=False) self.scheduler = scheduler - self.help_text = "Usage: !stop_jc\n" \ - "Desc: Stops all join commands" + self.help_text = _("Usage: !stop_jc\n" + "Desc: Stops all join commands") def execute(self, username, args, user_flags): args, err = self.parse_args(username, args, user_flags) @@ -62,11 +67,11 @@ def __init__(self, server, scheduler): Command.__init__(self, server, admin_only=True, requires_patch=False) self.scheduler = scheduler - self.help_text = "Usage: !start_wc [--wave] COMMAND\n" \ - "\t-w --wave - Optional, wave to run on\n" \ - "\tCOMMAND - Command to run\n" \ - "Desc: Run a command at the start of a wave, wave" \ - " can be omitted top run on every wave" + self.help_text = _("Usage: !start_wc [--wave] COMMAND\n" + "\t-w --wave - Optional, wave to run on\n" + "\tCOMMAND - Command to run\n" + "Desc: Run a command at the start of a wave, wave" + " can be omitted top run on every wave") self.parser.add_argument("--wave", "-w") self.parser.add_argument("command", nargs="*") @@ -82,7 +87,7 @@ def execute(self, username, args, user_flags): wave = int(args.wave) except ValueError: return self.format_response( - "'{}' is not a valid wave number".format(args.wave), + _("'{}' is not a valid wave number").format(args.wave), args ) else: @@ -90,14 +95,14 @@ def execute(self, username, args, user_flags): if not args.command: return self.format_response( - "Please specify a command to run", args + _("Please specify a command to run"), args ) command = CommandOnWave( self.server, " ".join(args.command), wave ) self.scheduler.schedule_command(command) - return self.format_response("Wave start command started", args) + return self.format_response(_("Wave start command started"), args) class CommandStopWaveCommands(Command): @@ -105,8 +110,8 @@ def __init__(self, server, scheduler): Command.__init__(self, server, admin_only=True, requires_patch=False) self.scheduler = scheduler - self.help_text = "Usage: !stop_wc\n" \ - "Desc: Stops all wave commands" + self.help_text = _("Usage: !stop_wc\n" + "Desc: Stops all wave commands") def execute(self, username, args, user_flags): args, err = self.parse_args(username, args, user_flags) @@ -126,11 +131,11 @@ def __init__(self, server, scheduler): Command.__init__(self, server, admin_only=True, requires_patch=False) self.scheduler = scheduler - self.help_text = "Usage: !start_tc [-r -t] COMMAND\n" \ - "\tCOMMAND - Command to run\n" \ - "\t-r --repeat - Optional, run repeatedly\n" \ - "\t-t --time - Seconds before running\n" \ - "Desc: Runs a command after some time delay" + self.help_text = _("Usage: !start_tc [-r -t] COMMAND\n" + "\tCOMMAND - Command to run\n" + "\t-r --repeat - Optional, run repeatedly\n" + "\t-t --time - Seconds before running\n" + "Desc: Runs a command after some time delay") self.parser.add_argument("--time", "-t") self.parser.add_argument("--repeat", "-r", action="store_true") self.parser.add_argument("command", nargs="*") @@ -144,7 +149,7 @@ def execute(self, username, args, user_flags): if not args.time: return self.format_response( - "Please specify a time interval, '!start_tc -h' for help", + _("Please specify a time interval, '!start_tc -h' for help"), args ) @@ -152,13 +157,13 @@ def execute(self, username, args, user_flags): interval = float(args.time) except ValueError: return self.format_response( - "'{}' is not a valid time interval".format(args.time), + _("'{}' is not a valid time interval").format(args.time), args ) if not args.command: return self.format_response( - "Please specify a command to run", args + _("Please specify a command to run"), args ) run_once = False if args.repeat else True @@ -167,7 +172,7 @@ def execute(self, username, args, user_flags): self.server, " ".join(args.command), interval, run_once=run_once ) self.scheduler.schedule_command(command) - return self.format_response("Time interval command started", args) + return self.format_response(_("Time interval command started"), args) class CommandStopTimeCommands(Command): @@ -175,8 +180,8 @@ def __init__(self, server, scheduler): Command.__init__(self, server, admin_only=True, requires_patch=False) self.scheduler = scheduler - self.help_text = "Usage: !stop_tc\n" \ - "Desc: Stops all timed commands" + self.help_text = _("Usage: !stop_tc\n" + "Desc: Stops all timed commands") def execute(self, username, args, user_flags): args, err = self.parse_args(username, args, user_flags) @@ -196,11 +201,12 @@ def __init__(self, server, scheduler): Command.__init__(self, server, admin_only=True, requires_patch=False) self.scheduler = scheduler - self.help_text = "Usage: !start_trc [--wave] COMMAND\n" \ - "\tCOMMAND - Command to run\n" \ - "\t-w --wave - Optional, wave to run on\n" \ - "Desc: Runs a command when the trader opens, wave" \ - " can be omitted to run every time the trader opens" + self.help_text = _("Usage: !start_trc [--wave] COMMAND\n" + "\tCOMMAND - Command to run\n" + "\t-w --wave - Optional, wave to run on\n" + "Desc: Runs a command when the trader opens, wave" + " can be omitted to run every time the trader " + "opens") self.parser.add_argument("--wave", "-w") self.parser.add_argument("command", nargs="*") @@ -213,7 +219,7 @@ def execute(self, username, args, user_flags): if not args.command: return self.format_response( - "Please specify a command to run", args + _("Please specify a command to run"), args ) wave = args.wave if args.wave else ALL_WAVES @@ -221,7 +227,7 @@ def execute(self, username, args, user_flags): wave = int(wave) except ValueError: return self.format_response( - "'{}' is not a valid wave number".format(args.wave), + _("'{}' is not a valid wave number").format(args.wave), args ) @@ -229,7 +235,7 @@ def execute(self, username, args, user_flags): self.server, " ".join(args.command), wave=wave ) self.scheduler.schedule_command(command) - return self.format_response("Trader open command started", args) + return self.format_response(_("Trader open command started"), args) class CommandStopTraderCommands(Command): @@ -237,8 +243,8 @@ def __init__(self, server, scheduler): Command.__init__(self, server, admin_only=True, requires_patch=False) self.scheduler = scheduler - self.help_text = "Usage: !stop_trc\n" \ - "Desc: Stops all trader commands" + self.help_text = _("Usage: !stop_trc\n" + "Desc: Stops all trader commands") def execute(self, username, args, user_flags): args, err = self.parse_args(username, args, user_flags) diff --git a/magicked_admin/chatbot/commands/info_commands.py b/magicked_admin/chatbot/commands/info_commands.py index 78a27bbd..c6096999 100644 --- a/magicked_admin/chatbot/commands/info_commands.py +++ b/magicked_admin/chatbot/commands/info_commands.py @@ -1,5 +1,6 @@ import os import time +import gettext from chatbot.commands.command import Command from server.player import Player @@ -7,15 +8,17 @@ from utils.text import millify from utils.time import seconds_to_hhmmss +_ = gettext.gettext + class CommandMarquee(Command): def __init__(self, server, chatbot): self.chatbot = chatbot Command.__init__(self, server, admin_only=True, requires_patch=False) - self.help_text = "Usage: !marquee FILE\n" \ - "\tFILE - Some file in 'conf/marquee'\n" \ - "Desc: Runs a marquee in chat" + self.help_text = _("Usage: !marquee FILE\n" + "\tFILE - Some file in 'conf/marquee'\n" + "Desc: Runs a marquee in chat") # self.parser.add_argument("iterations") self.parser.add_argument("filename", nargs="*") @@ -43,11 +46,11 @@ def execute(self, username, args, user_flags): return self.format_response(self.help_text, args) if not args.filename: - return self.format_response("Missing argument: filename", args) + return self.format_response(_("Missing argument: filename"), args) file_loaded = self.load_file(" ".join(args.filename)) if not file_loaded: - return self.format_response("Couldn't find file", args) + return self.format_response(_("Couldn't find file"), args) for i in range(0, 300): line_start = i % len(self.marquee) @@ -72,8 +75,9 @@ class CommandPlayerCount(Command): def __init__(self, server): Command.__init__(self, server, admin_only=False, requires_patch=False) - self.help_text = "Usage: !players\n" \ - "Desc: Shows the number of players currently online" + self.help_text = _("Usage: !players\n" + "Desc: Shows the number of players currently " + "online") def execute(self, username, args, user_flags): args, err = self.parse_args(username, args, user_flags) @@ -83,7 +87,7 @@ def execute(self, username, args, user_flags): return self.format_response(self.help_text, args) return self.format_response( - "{}/{} Players are online".format( + _("{}/{} Players are online").format( len(self.server.players), self.server.game.players_max ), args @@ -94,9 +98,9 @@ class CommandPlayers(Command): def __init__(self, server): Command.__init__(self, server, admin_only=True, requires_patch=False) - self.help_text = "Usage: !players\n" \ - "Desc: Shows detailed information about online " \ - "players" + self.help_text = _("Usage: !players\n" + "Desc: Shows detailed information about online " + "players") def execute(self, username, args, user_flags): args, err = self.parse_args(username, args, user_flags) @@ -107,7 +111,7 @@ def execute(self, username, args, user_flags): players = self.server.players if not players: - return self.format_response("No players in game", args) + return self.format_response(_("No players in game"), args) message = "" for player in players: @@ -120,8 +124,8 @@ class CommandGame(Command): def __init__(self, server): Command.__init__(self, server, admin_only=False, requires_patch=False) - self.help_text = "Usage: !game\n" \ - "Desc: Shows current game info and rules" + self.help_text = _("Usage: !game\n" + "Desc: Shows current game info and rules") def execute(self, username, args, user_flags): args, err = self.parse_args(username, args, user_flags) @@ -137,8 +141,8 @@ class CommandGameMap(Command): def __init__(self, server, admin_only=False, requires_patch=False): Command.__init__(self, server, admin_only) - self.help_text = "Usage: !map\n" \ - "Desc: Shows statistics about the current map" + self.help_text = _("Usage: !map\n" + "Desc: Shows statistics about the current map") def execute(self, username, args, user_flags): args, err = self.parse_args(username, args, user_flags) @@ -154,9 +158,10 @@ class CommandGameTime(Command): def __init__(self, server): Command.__init__(self, server, admin_only=False, requires_patch=False) - self.help_text = "Usage: !game_time\n" \ - "Desc: Shows the number of seconds since the match " \ - "started. Excludes trader time and the boss wave." + self.help_text = _("Usage: !game_time\n" + "Desc: Shows the number of seconds since the " + "match started. Excludes trader time and the boss" + " wave.") def execute(self, username, args, user_flags): args, err = self.parse_args(username, args, user_flags) @@ -172,8 +177,8 @@ class CommandHighWave(Command): def __init__(self, server): Command.__init__(self, server, admin_only=False, requires_patch=True) - self.help_text = "Usage: !record_wave\n" \ - "Desc: Shows the highest wave reached on this map" + self.help_text = _("Usage: !record_wave\n" + "Desc: Shows the highest wave reached on this map") def execute(self, username, args, user_flags): args, err = self.parse_args(username, args, user_flags) @@ -183,7 +188,7 @@ def execute(self, username, args, user_flags): return self.format_response(self.help_text, args) return self.format_response( - "{} is the highest wave reached on this map".format( + _("{} is the highest wave reached on this map").format( self.server.game.game_map.highest_wave ), args ) @@ -193,8 +198,8 @@ class CommandCommands(Command): def __init__(self, server): Command.__init__(self, server, admin_only=False, requires_patch=False) - self.help_text = "Usage: !commands\n" \ - "Desc: Lists all player commands" + self.help_text = _("Usage: !commands\n" + "Desc: Lists all player commands") def execute(self, username, args, user_flags): args, err = self.parse_args(username, args, user_flags) @@ -203,22 +208,22 @@ def execute(self, username, args, user_flags): elif args.help: return self.format_response(self.help_text, args) - message = "\nAvailable commands:\n" \ - "\t!record_wave,\n" \ - "\t!game,\n" \ - "\t!kills,\n" \ - "\t!dosh,\n" \ - "\t!top_kills,\n" \ - "\t!top_dosh,\n" \ - "\t!top_time,\n" \ - "\t!stats,\n" \ - "\t!game_time,\n" \ - "\t!server_kills,\n" \ - "\t!server_dosh,\n" \ - "\t!map,\n" \ - "\t!maps,\n" \ - "\t!player_count\n" \ - "Commands have help, e.g. '!stats -h'" + message = _("\nAvailable commands:\n" + "\t!record_wave,\n" + "\t!game,\n" + "\t!kills,\n" + "\t!dosh,\n" + "\t!top_kills,\n" + "\t!top_dosh,\n" + "\t!top_time,\n" + "\t!stats,\n" + "\t!game_time,\n" + "\t!server_kills,\n" + "\t!server_dosh,\n" + "\t!map,\n" + "\t!maps,\n" + "\t!player_count\n" + "Commands have help, e.g. '!stats -h'") return self.format_response(message, args) @@ -227,10 +232,10 @@ class CommandStats(Command): def __init__(self, server): Command.__init__(self, server, admin_only=False, requires_patch=False) - self.help_text = "Usage: !stats USERNAME\n" \ - "\tUSERNAME - Person to get stats for\n" \ - "Desc: Shows statistics about a player, username " \ - "can be omitted to get personal stats" + self.help_text = _("Usage: !stats USERNAME\n" + "\tUSERNAME - Person to get stats for\n" + "Desc: Shows statistics about a player, username " + "can be omitted to get personal stats") self.parser.add_argument("username", nargs="*") def execute(self, username, args, user_flags): @@ -265,15 +270,15 @@ def execute(self, username, args, user_flags): # todo Add pos_time to output # pos_time = self.server.database.rank_time(player.steam_id) or 0 - message = "Stats for {}:\n" \ - "Total play time: {} ({} sessions)\n" \ - "Total deaths: {}\n" \ - "Total kills: {} (rank #{}) \n" \ - "Total dosh earned: £{} (rank #{})\n" \ - "Dosh this game: {}".format( - player.username, fmt_time, player.sessions, - player.total_deaths, millify(player.total_kills), pos_kills, - millify(player.total_dosh), pos_dosh, millify(player.game_dosh) - ) + message = _("Stats for {}:\n" + "Total play time: {} ({} sessions)\n" + "Total deaths: {}\n" + "Total kills: {} (rank #{}) \n" + "Total dosh earned: £{} (rank #{})\n" + "Dosh this game: {}").format( + player.username, fmt_time, player.sessions, + player.total_deaths, millify(player.total_kills), + pos_kills, millify(player.total_dosh), pos_dosh, + millify(player.game_dosh)) return self.format_response(message, args) diff --git a/magicked_admin/chatbot/commands/player_commands.py b/magicked_admin/chatbot/commands/player_commands.py index 4d3f4e9b..07bdf368 100644 --- a/magicked_admin/chatbot/commands/player_commands.py +++ b/magicked_admin/chatbot/commands/player_commands.py @@ -1,14 +1,18 @@ +import gettext + from chatbot.commands.command import Command from utils.text import millify, trim_string from utils.time import seconds_to_hhmmss +_ = gettext.gettext + class CommandServerDosh(Command): def __init__(self, server): Command.__init__(self, server, admin_only=False, requires_patch=False) - self.help_text = "Usage: !server_dosh\n" \ - "Desc: Shows total dosh earned on this server" + self.help_text = _("Usage: !server_dosh\n" + "Desc: Shows total dosh earned on this server") def execute(self, username, args, user_flags): args, err = self.parse_args(username, args, user_flags) @@ -20,7 +24,7 @@ def execute(self, username, args, user_flags): self.server.write_all_players() dosh = self.server.database.server_dosh() return self.format_response( - "£{} has been earned on this server".format(millify(dosh)), + _("£{} has been earned on this server").format(millify(dosh)), args ) @@ -29,8 +33,8 @@ class CommandServerKills(Command): def __init__(self, server): Command.__init__(self, server, admin_only=False, requires_patch=False) - self.help_text = "Usage: !server_kills\n" \ - "Desc: Shows total ZEDs killed on this server" + self.help_text = _("Usage: !server_kills\n" + "Desc: Shows total ZEDs killed on this server") def execute(self, username, args, user_flags): args, err = self.parse_args(username, args, user_flags) @@ -42,7 +46,8 @@ def execute(self, username, args, user_flags): self.server.write_all_players() kills = self.server.database.server_kills() return self.format_response( - "{} ZEDs have been killed on this server".format(millify(kills)), + _("{} ZEDs have been killed on this server") + .format(millify(kills)), args ) @@ -51,10 +56,10 @@ class CommandKills(Command): def __init__(self, server): Command.__init__(self, server, admin_only=False, requires_patch=False) - self.help_text = "Usage: !kills USERNAME\n" \ - "\tUSERNAME - User to get kill stats for\n" \ - "Desc: Shows kill statistics for a player, username" \ - " can be omitted to get personal stats" + self.help_text = _("Usage: !kills USERNAME\n" + "\tUSERNAME - User to get kill stats for\n" + "Desc: Shows kill statistics for a player, " + "username can be omitted to get personal stats") self.parser.add_argument("username", nargs="*") def execute(self, username, args, user_flags): @@ -71,8 +76,8 @@ def execute(self, username, args, user_flags): if player: pos_kills = self.server.database.rank_kills(player.steam_id) return self.format_response( - "You've killed a total of {} ZEDs (#{}), and {} this game" - "".format( + _("You've killed a total of {} ZEDs (#{}), and {} this game") + .format( str(player.total_kills), str(pos_kills), str(player.kills) @@ -81,7 +86,7 @@ def execute(self, username, args, user_flags): ) else: return self.format_response( - "Player {} not in game".format(username), args + _("Player {} not in game").format(username), args ) @@ -89,10 +94,10 @@ class CommandDosh(Command): def __init__(self, server): Command.__init__(self, server, admin_only=False, requires_patch=False) - self.help_text = "Usage: !dosh USERNAME\n" \ - "\tUSERNAME - User to get dosh stats for\n" \ - "Desc: Shows dosh statistics for a player, username" \ - " can be omitted to get personal stats" + self.help_text = _("Usage: !dosh USERNAME\n" + "\tUSERNAME - User to get dosh stats for\n" + "Desc: Shows dosh statistics for a player, " + "username can be omitted to get personal stats") self.parser.add_argument("username", nargs="*") def execute(self, username, args, user_flags): @@ -109,8 +114,9 @@ def execute(self, username, args, user_flags): if player: pos_dosh = self.server.database.rank_dosh(player.steam_id) return self.format_response( - "You've earned a total of £{} dosh (#{}), and £{} this game" - "".format( + _("You've earned a total of £{} dosh (#{}), and £{} this" + " game") + .format( str(player.total_dosh), str(pos_dosh), str(player.game_dosh) @@ -118,15 +124,15 @@ def execute(self, username, args, user_flags): args ) else: - return self.format_response("Player not in game", args) + return self.format_response(_("Player not in game"), args) class CommandTopKills(Command): def __init__(self, server): Command.__init__(self, server, admin_only=False, requires_patch=False) - self.help_text = "Usage: !top_kills\n" \ - "Desc: Show the global kills leaderboard" + self.help_text = _("Usage: !top_kills\n" + "Desc: Show the global kills leaderboard") def execute(self, username, args, user_flags): args, err = self.parse_args(username, args, user_flags) @@ -138,7 +144,7 @@ def execute(self, username, args, user_flags): self.server.write_all_players() records = self.server.database.top_kills() - message = "Top 5 players by total kills:\n" + message = _("Top 5 players by total kills:\n") for player in records[:5]: username = trim_string(player['username'], 20) @@ -154,8 +160,8 @@ class CommandTopDosh(Command): def __init__(self, server): Command.__init__(self, server, admin_only=False, requires_patch=False) - self.help_text = "Usage: !top_dosh\n" \ - "Desc: Shows the global dosh leaderboard" + self.help_text = _("Usage: !top_dosh\n" + "Desc: Shows the global dosh leaderboard") def execute(self, username, args, user_flags): args, err = self.parse_args(username, args, user_flags) @@ -167,7 +173,7 @@ def execute(self, username, args, user_flags): self.server.write_all_players() records = self.server.database.top_dosh() - message = "Top 5 players by Dosh earned:\n" + message = _("Top 5 players by Dosh earned:\n") for player in records[:5]: username = trim_string(player['username'], 20) @@ -183,8 +189,8 @@ class CommandTopTime(Command): def __init__(self, server): Command.__init__(self, server, admin_only=False, requires_patch=False) - self.help_text = "Usage: !top_time\n" \ - "Desc: Shows the global play time leaderboard" + self.help_text = _("Usage: !top_time\n" + "Desc: Shows the global play time leaderboard") def execute(self, username, args, user_flags): args, err = self.parse_args(username, args, user_flags) @@ -196,7 +202,7 @@ def execute(self, username, args, user_flags): self.server.write_all_players() records = self.server.database.top_time() - message = "Top 5 players by play time:\n" + message = _("Top 5 players by play time:\n") for player in records[:5]: username = trim_string(player['username'], 20) @@ -212,8 +218,8 @@ class CommandScoreboard(Command): def __init__(self, server): Command.__init__(self, server, admin_only=False, requires_patch=False) - self.help_text = "Usage: !scoreboard\n" \ - "Desc: Shows full player scoreboard" + self.help_text = _("Usage: !scoreboard\n" + "Desc: Shows full player scoreboard") def execute(self, username, args, user_flags): args, err = self.parse_args(username, args, user_flags) @@ -222,7 +228,7 @@ def execute(self, username, args, user_flags): elif args.help: return self.format_response(self.help_text, args) - message = "Scoreboard (name, kills, dosh):\n" + message = _("Scoreboard (name, kills, dosh):\n") self.server.players.sort( key=lambda player: player.kills, @@ -233,7 +239,7 @@ def execute(self, username, args, user_flags): username = trim_string(player.username, 20) dosh = millify(player.dosh) kills = player.kills - message += "{}\t- {} Kills, £{}\n".format( + message += _("{}\t- {} Kills, £{}\n").format( username, kills, dosh ) @@ -244,8 +250,9 @@ class CommandTopWaveKills(Command): def __init__(self, server): Command.__init__(self, server, admin_only=False, requires_patch=True) - self.help_text = "Usage: !top_wave_kills\n" \ - "Desc: Shows who killed the most ZEDs in this wave" + self.help_text = _("Usage: !top_wave_kills\n" + "Desc: Shows who killed the most ZEDs in this " + "wave") def execute(self, username, args, user_flags): args, err = self.parse_args(username, args, user_flags) @@ -255,7 +262,7 @@ def execute(self, username, args, user_flags): return self.format_response(self.help_text, args) if not len(self.server.players): - return self.format_response("No players in game", args) + return self.format_response(_("No players in game"), args) self.server.players.sort( key=lambda player: player.wave_kills, @@ -264,7 +271,7 @@ def execute(self, username, args, user_flags): top = self.server.players[0] return self.format_response( - "Player {} killed the most ZEDs this wave: {}".format( + _("Player {} killed the most ZEDs this wave: {}").format( top.username, millify(top.wave_kills) ), args @@ -275,8 +282,8 @@ class CommandTopWaveDosh(Command): def __init__(self, server): Command.__init__(self, server, admin_only=False, requires_patch=True) - self.help_text = "Usage: !top_wave_dosh\n" \ - "Desc: Shows who earned the most dosh this wave" + self.help_text = _("Usage: !top_wave_dosh\n" + "Desc: Shows who earned the most dosh this wave") def execute(self, username, args, user_flags): args, err = self.parse_args(username, args, user_flags) @@ -295,7 +302,7 @@ def execute(self, username, args, user_flags): top = self.server.players[0] return self.format_response( - "Player {} earned the most Dosh this wave: £{}".format( + _("Player {} earned the most Dosh this wave: £{}").format( top.username, millify(top.wave_dosh) ), args diff --git a/magicked_admin/chatbot/commands/server_commands.py b/magicked_admin/chatbot/commands/server_commands.py index 125469bd..901da5b5 100644 --- a/magicked_admin/chatbot/commands/server_commands.py +++ b/magicked_admin/chatbot/commands/server_commands.py @@ -1,19 +1,22 @@ from os import path +import gettext import server.game as game from chatbot.commands.command import Command from utils import find_data_file from web_admin.constants import * +_ = gettext.gettext + class CommandBan(Command): def __init__(self, server): Command.__init__(self, server, admin_only=True, requires_patch=False) self.parser.add_argument("username", nargs="*") - self.help_text = "Usage: !ban USERNAME\n" \ - "\tUSERNAME - Player to ban\n" \ - "Desc: Bans a player from the server" + self.help_text = _("Usage: !ban USERNAME\n" + "\tUSERNAME - Player to ban\n" + "Desc: Bans a player from the server") def execute(self, username, args, user_flags): args, err = self.parse_args(username, args, user_flags) @@ -26,26 +29,26 @@ def execute(self, username, args, user_flags): username = " ".join(args.username) else: return self.format_response( - "Missing argument, username or Steam ID", args + _("Missing argument, username or Steam ID"), args ) banned = self.server.ban_player(username) if banned: return self.format_response( - "Player, {}, was banned".format(banned), args + _("Player, {}, was banned").format(banned), args ) else: - return self.format_response("Player not found", args) + return self.format_response(_("Player not found"), args) class CommandSay(Command): def __init__(self, server): Command.__init__(self, server, admin_only=True, requires_patch=False) - self.help_text = "Usage: !say MESSAGE\n" \ - "\tMESSAGE - Message to echo\n" \ - "Desc: Echos a message in chat" + self.help_text = _("Usage: !say MESSAGE\n" + "\tMESSAGE - Message to echo\n" + "Desc: Echos a message in chat") self.parser.add_argument("message", nargs="*") def execute(self, username, args, user_flags): @@ -68,9 +71,9 @@ class CommandOp(Command): def __init__(self, server): Command.__init__(self, server, admin_only=True, requires_patch=False) - self.help_text = "Usage: !op USERNAME\n" \ - "\tUSERNAME - Player to give operator status\n" \ - "Desc: Allows a player to use admin commands" + self.help_text = _("Usage: !op USERNAME\n" + "\tUSERNAME - Player to give operator status\n" + "Desc: Allows a player to use admin commands") self.parser.add_argument("username", nargs="*") def execute(self, username, args, user_flags): @@ -84,15 +87,15 @@ def execute(self, username, args, user_flags): username = " ".join(args.username) else: return self.format_response( - "Missing argument, username or Steam ID", args + _("Missing argument, username or Steam ID"), args ) player = self.server.get_player_by_username(username) if not player: - message = "Couldn't find player '{}'".format(username) + message = _("Couldn't find player '{}'").format(username) else: player.op = 1 - message = "Oped {}".format(player.username) + message = _("Oped {}").format(player.username) self.server.write_all_players() @@ -103,10 +106,10 @@ class CommandDeop(Command): def __init__(self, server): Command.__init__(self, server, admin_only=True, requires_patch=False) - self.help_text = "Usage: !deop USERNAME\n" \ - "\tUSERNAME - Player to revoke op status for\n" \ - "Desc: Revokes a players ability to use admin " \ - "commands" + self.help_text = _("Usage: !deop USERNAME\n" + "\tUSERNAME - Player to revoke op status for\n" + "Desc: Revokes a players ability to use admin " + "commands") self.parser.add_argument("username", nargs="*") def execute(self, username, args, user_flags): @@ -120,15 +123,15 @@ def execute(self, username, args, user_flags): username = " ".join(args.username) else: return self.format_response( - "Missing argument, username or Steam ID", args + _("Missing argument, username or Steam ID"), args ) player = self.server.get_player_by_username(username) if not player: - message = "Couldn't find player '{}'".format(username) + message = _("Couldn't find player '{}'").format(username) else: player.op = 0 - message = "Deoped {}".format(player.username) + message = _("Deoped {}").format(player.username) self.server.write_all_players() @@ -139,9 +142,9 @@ class CommandGameMaps(Command): def __init__(self, server): Command.__init__(self, server, admin_only=False, requires_patch=False) - self.help_text = "Usage: !maps [--all]\n" \ - "\t-a --all - Show all available maps\n" \ - "Desc: Shows maps that are in the map cycle" + self.help_text = _("Usage: !maps [--all]\n" + "\t-a --all - Show all available maps\n" + "Desc: Shows maps that are in the map cycle") self.parser.add_argument( "-a", "--all", action="store_true" @@ -163,8 +166,8 @@ class CommandGameMap(Command): def __init__(self, server): Command.__init__(self, server, admin_only=False, requires_patch=False) - self.help_text = "Usage: !map\n" \ - "Desc: Shows statistics about the current map" + self.help_text = _("Usage: !map\n" + "Desc: Shows statistics about the current map") self.parser.add_argument("map_name", nargs="?") def execute(self, username, args, user_flags): @@ -185,16 +188,16 @@ def execute(self, username, args, user_flags): self.server.write_game_map() self.server.database.load_game_map(game_map) - total_plays = game_map.plays_survival \ - + game_map.plays_weekly \ - + game_map.plays_endless \ - + game_map.plays_survival_vs \ - + game_map.plays_other + total_plays = (game_map.plays_survival + + game_map.plays_weekly + + game_map.plays_endless + + game_map.plays_survival_vs + + game_map.plays_other) - message = "Stats for {}:\n".format(game_map.name) - message += "Total plays: {} \n".format(total_plays) - message += "Record wave: {} \n".format(game_map.highest_wave) - message += "Survival wins: {} \n".format(game_map.wins_survival) + message = _("Stats for {}:\n").format(game_map.name) + message += _("Total plays: {} \n").format(total_plays) + message += _("Record wave: {} \n").format(game_map.highest_wave) + message += _("Survival wins: {} \n").format(game_map.wins_survival) return self.format_response(message, args) @@ -203,9 +206,10 @@ class CommandEnforceDosh(Command): def __init__(self, server): Command.__init__(self, server, admin_only=True, requires_patch=False) - self.help_text = "Usage: !enforce_dosh\n" \ - "Desc: Kicks players with more dosh than the " \ - "threshold configured in 'conf/magicked_admin.conf'" + self.help_text = _("Usage: !enforce_dosh\n" + "Desc: Kicks players with more dosh than the " + "threshold configured in " + "'conf/magicked_admin.conf'") # TODO amount optional argument def execute(self, username, args, user_flags): @@ -223,9 +227,9 @@ def __init__(self, server): Command.__init__(self, server, admin_only=True, requires_patch=False) self.parser.add_argument("username", nargs="*") - self.help_text = "Usage: !kick USERNAME\n" \ - "\tUSERNAME - Player to kick\n" \ - "Desc: Kicks a player from the match" + self.help_text = _("Usage: !kick USERNAME\n" + "\tUSERNAME - Player to kick\n" + "Desc: Kicks a player from the match") def execute(self, username, args, user_flags): args, err = self.parse_args(username, args, user_flags) @@ -238,17 +242,17 @@ def execute(self, username, args, user_flags): username = " ".join(args.username) else: return self.format_response( - "Missing argument, username or Steam ID", args + _("Missing argument, username or Steam ID"), args ) kicked = self.server.kick_player(username) if kicked: return self.format_response( - "Player, {}, was kicked".format(kicked), args + _("Player, {}, was kicked").format(kicked), args ) else: - return self.format_response("Player not found", args) + return self.format_response(_("Player not found"), args) class CommandRun(Command): @@ -256,9 +260,9 @@ def __init__(self, server, chatbot): Command.__init__(self, server, admin_only=True, requires_patch=False) self.chatbot = chatbot - self.help_text = "Usage: !run FILE\n" \ - "\tFILE - Some file in 'conf/scripts'\n" \ - "Desc: Runs a script" + self.help_text = _("Usage: !run FILE\n" + "\tFILE - Some file in 'conf/scripts'\n" + "Desc: Runs a script") self.parser.add_argument("file", nargs="*") self.scripts_folder = "scripts" @@ -271,12 +275,12 @@ def execute(self, username, args, user_flags): return self.format_response(self.help_text, args) if not args.file: - return self.format_response("No script was specified", args) + return self.format_response(_("No script was specified"), args) args.file = " ".join(args.file) script_path = find_data_file(self.scripts_folder + "/" + args.file) if not path.exists(script_path): - return self.format_response("Script not found", args) + return self.format_response(_("Script not found"), args) self.chatbot.execute_script(script_path) @@ -285,8 +289,8 @@ class CommandRestart(Command): def __init__(self, server): Command.__init__(self, server, admin_only=True, requires_patch=False) - self.help_text = "Usage: !restart\n" \ - "Desc: Restarts the match" + self.help_text = _("Usage: !restart\n" + "Desc: Restarts the match") def execute(self, username, args, user_flags): args, err = self.parse_args(username, args, user_flags) @@ -296,16 +300,16 @@ def execute(self, username, args, user_flags): return self.format_response(self.help_text, args) self.server.restart_map() - return self.format_response("Restarting map...", args) + return self.format_response(_("Restarting map..."), args) class CommandLoadMap(Command): def __init__(self, server): Command.__init__(self, server, admin_only=True, requires_patch=False) - self.help_text = "Usage: !load_map MAP_NAME\n" \ - "\tMAP_NAME - Map to load\n" \ - "Desc: Immediately changes the map." + self.help_text = _("Usage: !load_map MAP_NAME\n" + "\tMAP_NAME - Map to load\n" + "Desc: Immediately changes the map.") self.parser.add_argument("map_name", nargs="?") def execute(self, username, args, user_flags): @@ -316,22 +320,22 @@ def execute(self, username, args, user_flags): return self.format_response(self.help_text, args) if not args.map_name: - return self.format_response("Missing argument (map name)", args) + return self.format_response(_("Missing argument (map name)"), args) self.server.change_map(args.map_name) - return self.format_response("Changing map", args) + return self.format_response(_("Changing map"), args) class CommandPassword(Command): def __init__(self, server): Command.__init__(self, server, admin_only=True, requires_patch=False) - self.help_text = "Usage: !password [--set] STATE\n" \ - "\tSTATE - On, off, or new password\n" \ - "\t-s --set - Set a new password\n" \ - "Desc: Enables or disables the game password " \ - "configured in 'conf/magicked_admin.conf', state " \ - "can be on, off, or a new password." + self.help_text = _("Usage: !password [--set] STATE\n" + "\tSTATE - On, off, or new password\n" + "\t-s --set - Set a new password\n" + "Desc: Enables or disables the game password " + "configured in 'conf/magicked_admin.conf', state " + "can be on, off, or a new password.") self.parser.add_argument("-s", "--set", type=str) self.parser.add_argument("state", nargs="?") @@ -345,8 +349,8 @@ def execute(self, username, args, user_flags): if not (args.state or args.set): enabled = self.server.web_admin.has_game_password() return self.format_response( - "Game password is currently {}".format( - "enabled" if enabled else "disabled" + _("Game password is currently {}").format( + _("enabled") if enabled else _("disabled") ), args ) @@ -357,14 +361,14 @@ def execute(self, username, args, user_flags): self.server.web_admin.set_game_password( self.server.game_password ) - message = "Game password enabled" + message = _("Game password enabled") elif args.state in ['off', 'no', 'n', '0', 'disable']: self.server.web_admin.set_game_password() - message = "Game password disabled" + message = _("Game password disabled") else: - message = "Unrecognised option {}".format(args.state) + message = _("Unrecognised option {}").format(args.state) return self.format_response(message, args) @@ -374,9 +378,9 @@ def __init__(self, server, chatbot): Command.__init__(self, server, admin_only=True, requires_patch=False) self.chatbot = chatbot - self.help_text = "Usage: !silent [--quiet]\n" \ - "\t-q --quiet - Suppresses output'\n" \ - "Desc: Toggles command output globally" + self.help_text = _("Usage: !silent [--quiet]\n" + "\t-q --quiet - Suppresses output'\n" + "Desc: Toggles command output globally") def execute(self, username, args, user_flags): args, err = self.parse_args(username, args, user_flags) @@ -387,9 +391,9 @@ def execute(self, username, args, user_flags): if self.chatbot.silent: self.chatbot.silent = False - return self.format_response("Silent mode disabled", args) + return self.format_response(_("Silent mode disabled"), args) else: - message = self.format_response("Silent mode enabled", args) + message = self.format_response(_("Silent mode enabled"), args) if message: self.chatbot.command_handler( "internal_command", @@ -403,9 +407,9 @@ class CommandLength(Command): def __init__(self, server): Command.__init__(self, server, admin_only=True, requires_patch=False) - self.help_text = "Usage: !length LENGTH\n" \ - "\tLENGTH - Length to change to\n" \ - "Desc: Changes the game length next match" + self.help_text = _("Usage: !length LENGTH\n" + "\tLENGTH - Length to change to\n" + "Desc: Changes the game length next match") self.parser.add_argument("length", nargs="?") def execute(self, username, args, user_flags): @@ -416,8 +420,8 @@ def execute(self, username, args, user_flags): return self.format_response(self.help_text, args) if not args.length: - message = "Length not recognised, options are: " \ - "short, medium, or long" + message = _("Length not recognised, options are: " + "short, medium, or long") return self.format_response(message, args) if args.length in ["short", "0"]: @@ -428,13 +432,14 @@ def execute(self, username, args, user_flags): length = LEN_LONG else: return self.format_response( - "Length not recognised, options are: short, medium, or long", + _("Length not recognised, options are: short, medium, or " + "long"), args ) self.server.set_length(length) return self.format_response( - "Length change will take effect next game", + _("Length change will take effect next game"), args ) @@ -443,9 +448,9 @@ class CommandDifficulty(Command): def __init__(self, server): Command.__init__(self, server, admin_only=True, requires_patch=False) - self.help_text = "Usage: !difficulty DIFFICULTY\n" \ - "\tDIFFICULTY - Difficulty to change to\n" \ - "Desc: Changes the difficulty next match" + self.help_text = _("Usage: !difficulty DIFFICULTY\n" + "\tDIFFICULTY - Difficulty to change to\n" + "Desc: Changes the difficulty next match") self.parser.add_argument("difficulty", nargs="?") def execute(self, username, args, user_flags): @@ -456,8 +461,8 @@ def execute(self, username, args, user_flags): return self.format_response(self.help_text, args) if not args.difficulty: - message = "Difficulty not recognised, options are: normal, " \ - "hard, suicidal, or hell" + message = _("Difficulty not recognised, options are: normal, " + "hard, suicidal, or hell") return self.format_response(message, args) if args.difficulty in ["normal", "0"]: @@ -470,14 +475,14 @@ def execute(self, username, args, user_flags): difficulty = DIFF_HOE else: return self.format_response( - "Difficulty not recognised, options are: normal, hard, " - "suicidal, or hell", + _("Difficulty not recognised, options are: normal, hard, " + "suicidal, or hell"), args ) self.server.set_difficulty(difficulty) return self.format_response( - "Difficulty change will take effect next game", + _("Difficulty change will take effect next game"), args ) @@ -486,9 +491,9 @@ class CommandGameMode(Command): def __init__(self, server): Command.__init__(self, server, admin_only=True, requires_patch=False) - self.help_text = "Usage: !game_mode MODE\n" \ - "\tMODE - Mode to change to\n" \ - "Desc: Immediately changes the game mode" + self.help_text = _("Usage: !game_mode MODE\n" + "\tMODE - Mode to change to\n" + "Desc: Immediately changes the game mode") self.parser.add_argument("game_mode", nargs="?") def execute(self, username, args, user_flags): @@ -500,8 +505,8 @@ def execute(self, username, args, user_flags): if not args.game_mode: return self.format_response( - "Mode not recognised, options are: endless, survival, " - "weekly or versus", + _("Mode not recognised, options are: endless, survival, " + "weekly or versus"), args ) @@ -515,14 +520,14 @@ def execute(self, username, args, user_flags): mode = GAME_TYPE_SURVIVAL_VS else: return self.format_response( - "GameMode not recognised, options are: endless, survival, " - "weekly or versus", + _("GameMode not recognised, options are: endless, survival, " + "weekly or versus"), args ) self.server.change_game_type(mode) return self.format_response( - "Game mode will be changed to {0}".format( + _("Game mode will be changed to {}").format( str(GAME_TYPE_DISPLAY[mode]) ), args