diff --git a/bot.py b/bot.py index 700ed97..e240fee 100644 --- a/bot.py +++ b/bot.py @@ -298,7 +298,7 @@ def close_game(bot, update): else: send_async(bot, chat.id, - text=_("Only the game creator ({name}) can do that") + text=_("Only the game creator ({name}) can do that.") .format(name=game.owner.first_name), reply_to_message_id=update.message.message_id) return @@ -612,7 +612,7 @@ def do_play_card(bot, player, result_id): except NotEnoughPlayersError: send_async(bot, chat.id, text=__("Game ended!", game.translate)) - us2 = UserSetting.get(id=game.current_player.next.user.id) + us2 = UserSetting.get(id=game.current_player.user.id) if us2 and us2.stats: us2.games_played += 1 diff --git a/game_manager.py b/game_manager.py index 0013cba..69648ba 100644 --- a/game_manager.py +++ b/game_manager.py @@ -130,8 +130,13 @@ class GameManager(object): # Clear game for player_in_game in game.players: - this_users_players = self.userid_players[player_in_game.user.id] - this_users_players.remove(player_in_game) + this_users_players = \ + self.userid_players.get(player_in_game.user.id, list()) + + try: + this_users_players.remove(player_in_game) + except ValueError: + pass if this_users_players: self.userid_current[player.user.id] = this_users_players[0] diff --git a/locales/it_IT/LC_MESSAGES/unobot.po b/locales/it_IT/LC_MESSAGES/unobot.po index 7120c26..735c810 100644 --- a/locales/it_IT/LC_MESSAGES/unobot.po +++ b/locales/it_IT/LC_MESSAGES/unobot.po @@ -18,7 +18,7 @@ msgstr "" "Project-Id-Version: uno_bot 0.1\n" "Report-Msgid-Bugs-To: uno@jhoeke.de\n" "POT-Creation-Date: 2016-05-22 20:02+0200\n" -"PO-Revision-Date: 2016-05-22 23:47+0200\n" +"PO-Revision-Date: 2016-05-23 01:39+0200\n" "Language-Team: en \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" @@ -83,11 +83,9 @@ msgstr "" "/close - Chiude la stanza, nessun giocatore può unirsi alla partita dopo che " "questa è già avviata.\n" "/open - Apre la stanza, i giocatori possono unirsi alla partita in qualsiasi " -"momento.\n" -"/enable_translations - Traduce i messaggi importanti nelle lingue " +"momento. \v/enable_translations - Traduce i messaggi importanti nelle lingue " "parlate durante la partita\n" -"/disable_translations - Usa l'inglese (default) " -"per questi messaggi\n" +"/disable_translations - Usa l'inglese (default) per questi messaggi\n" "\n" "Sperimentale: Gioca in più gruppi allo stesso tempo. Premi il tasto " "Partita in corso: ... e scegli il gruppo dove vuoi giocare la " @@ -148,11 +146,11 @@ msgstr "Partita non trovata." #: bot.py:223 msgid "Back to last group" -msgstr "Vai all'ultimo gruppo. " +msgstr "Vai all'ultimo gruppo." #: bot.py:227 msgid "Please switch to the group you selected!" -msgstr "Per favore, spostati sul gruppo che hai selezionato!" +msgstr "Per favore, vai sul gruppo che hai selezionato!" #: bot.py:233 #, python-format @@ -180,8 +178,8 @@ msgstr "La partita è già iniziata" #: bot.py:281 msgid "At least two players must /join the game before you can start it" msgstr "" -"Ci devono essere almeno due giocatori che hanno cliccato /join per iniziare " -"la partita" +"Devono partecipare almeno due giocatori per iniziare la partita. Partecipa " +"con /join" #: bot.py:297 #, python-format @@ -243,7 +241,7 @@ msgid "" "Waiting time to skip this player has been reduced to {time} seconds.\n" "Next player: {name}" msgstr "" -"Il tempo di attesa per saltare questo giocatore è stata ridotta a {time} " +"Il tempo di attesa per saltare questo giocatore è stato ridotto a {time} " "secondi.\n" "Prossimo giocatore: {name}" @@ -304,12 +302,12 @@ msgstr "Non ci sono più carte sul tavolo." #: bot.py:627 #, python-format msgid "Bluff called! Giving 4 cards to {name}" -msgstr "Il baro è stato scoperto! Sto dando 4 carte a {name}" +msgstr "Il baro è stato scoperto! {name} deve pescare 4 carte!" #: bot.py:639 #, python-format msgid "{name1} didn't bluff! Giving 6 cards to {name2}" -msgstr "{name1} non ha barato! Sto dando 6 carte a {name2}" +msgstr "{name1} non ha barato! {name2} deve pescare 6 carte!" #: results.py:38 msgid "Choose Color" @@ -359,14 +357,14 @@ msgstr "Inizia la partita con /start" #: results.py:108 #, python-format msgid "Drawing 1 card" -msgstr "Pesca 1 carta" +msgstr "Sto pescando 1 carta" msgid "Drawing {number} cards" -msgstr "Pesca {number} carte" +msgstr "Sto pescando {number} carte" #: results.py:136 msgid "Pass" -msgstr "Passa" +msgstr "Passo" #: results.py:148 msgid "I'm calling your bluff!" @@ -423,7 +421,7 @@ msgstr "{number} partite giocate" #: simple_commands.py msgid "{number} first places" -msgstr "{number} primi posti" +msgstr "{number} vittorie" #: simple_commands.py msgid "{number} cards played" diff --git a/locales/pt_BR/LC_MESSAGES/unobot.po b/locales/pt_BR/LC_MESSAGES/unobot.po index d3d047f..34e3328 100644 --- a/locales/pt_BR/LC_MESSAGES/unobot.po +++ b/locales/pt_BR/LC_MESSAGES/unobot.po @@ -18,7 +18,7 @@ msgstr "" "Project-Id-Version: uno_bot 0.1\n" "Report-Msgid-Bugs-To: uno@jhoeke.de\n" "POT-Creation-Date: 2016-05-22 18:56-0300\n" -"PO-Revision-Date: 2016-05-22 19:37-0300\n" +"PO-Revision-Date: 2016-05-22 20:48-0300\n" "Language-Team: en \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" @@ -75,7 +75,6 @@ msgstr "" "leave. Se um jogador levar mais de 90 segundos para jogar, você pode usar /" "skip para pular a vez desse jogador.\n" "\n" -"\n" "Idioma e outras configurações: /settings\n" "Outros comandos (somente para o criador do jogo):\n" "/close - Fechar o lobby\n" @@ -104,7 +103,7 @@ msgstr "" #: bot.py:133 msgid "" "Created a new game! Join the game with /join and start the game with /start" -msgstr "Crie um novo jogo! Entre no jogo com /join e inicie o jogo com /start" +msgstr "Novo jogo criado! Entre no jogo com /join e inicie o jogo com /start" #: bot.py:152 msgid "The lobby is closed" @@ -184,7 +183,7 @@ msgid "" msgstr "" "Primeiro jogador: {name}\n" "Use /close para impedir que mais pessoas entrem na partida.\n" -"Ative as traduções com /enable_translations" +"Ative as multi-traduções com /enable_translations" #: bot.py:321 msgid "Please select the group you want to play in." @@ -257,7 +256,8 @@ msgid "" "{name} was skipped four times in a row and has been removed from the game.\n" "The game ended." msgstr "" -"teve suas jogadas puladas quatro vezes seguidas e foi removido(a) do jogo.\n" +"{name} teve suas jogadas puladas quatro vezes seguidas e foi removido(a) do " +"jogo.\n" "O jogo acabou." #: bot.py:455 @@ -312,7 +312,7 @@ msgstr "Escolher Cor" #: results.py:56 msgid "Cards (tap for game state):" -msgstr "Cartas (toque para ver as estatísticas do jogo)" +msgstr "Cartas (toque para ver as estatísticas do jogo):" #: results.py:60 results.py:123 results.py:165 msgid "Current player: {name}" @@ -394,7 +394,7 @@ msgstr "Estatísticas habilitadas!" #: settings.py:70 msgid "Select locale" -msgstr "Definir local" +msgstr "Definir linguagem" #: settings.py:81 msgid "Deleted and disabled statistics!" @@ -402,7 +402,7 @@ msgstr "Estatísticas deletadas e desabilitadas!" #: settings.py:94 msgid "Set locale!" -msgstr "Local selecionado!" +msgstr "Linguagem selecionada!" #: simple_commands.py msgid "" diff --git a/utils.py b/utils.py index af32d83..fdde8aa 100644 --- a/utils.py +++ b/utils.py @@ -185,8 +185,9 @@ def game_locales(func): result = func(bot, update, *pargs, **kwargs) - for i in locales: + while _.code: _.pop() + return result return wrapped