From cfcc211c2dd148d6b2e92ae37784b73b124bab74 Mon Sep 17 00:00:00 2001 From: Andrew Engelbrecht Date: Wed, 12 Aug 2015 12:09:31 -0400 Subject: [PATCH] split up reply strings for finer control now edward can say hello without saying that decryption was successful. he can also say that decryption was successful without saying he will quote the reply. --- edward | 11 +++++++++-- lang/an.py | 5 ++++- lang/de.py | 7 +++++-- lang/el.py | 7 +++++-- lang/en.py | 7 +++++-- lang/es.py | 9 ++++++--- lang/fr.py | 7 +++++-- lang/it.py | 7 +++++-- lang/ja.py | 7 +++++-- lang/pt_br.py | 7 +++++-- lang/ro.py | 7 +++++-- lang/ru.py | 7 +++++-- lang/tr.py | 7 +++++-- tests/flatten-2.out | 2 +- tests/gpg-flatten-1.out | 2 +- tests/gpg-flatten-2.out | 4 +++- tests/gpg-flatten-4.out | 2 +- 17 files changed, 75 insertions(+), 30 deletions(-) diff --git a/edward b/edward index ca6453b..aaed2a5 100755 --- a/edward +++ b/edward @@ -919,16 +919,23 @@ def write_reply (replyinfo_obj): reply_plain = "" + if (replyinfo_obj.pubkey_success == True): + reply_plain += replyinfo_obj.replies['greeting'] + reply_plain += "\n\n" + if replyinfo_obj.decrypt_success == True: debug('decrypt success') reply_plain += replyinfo_obj.replies['success_decrypt'] - reply_plain += "\n\n" if (replyinfo_obj.sig_success == True) and (replyinfo_obj.have_reply_key == True): debug('message quoted') + reply_plain += replyinfo_obj.replies['space'] + reply_plain += replyinfo_obj.replies['quote_follows'] + reply_plain += "\n\n" quoted_text = email_quote_text(replyinfo_obj.msg_to_quote) reply_plain += quoted_text - reply_plain += "\n\n" + + reply_plain += "\n\n" else: debug('decrypt failure') diff --git a/lang/an.py b/lang/an.py index a50e654..97ccbec 100644 --- a/lang/an.py +++ b/lang/an.py @@ -21,13 +21,16 @@ *********************************************************************""" replies = { + 'greeting' : "", 'success_decrypt' : "", + 'quote_follows' : "", 'public_key_received' : '', 'failed_decrypt' : "", 'no_public_key' : "", 'sig_failure' : '', 'sig_success' : '', - 'signature' : '' + 'signature' : '', + 'space' : " " } diff --git a/lang/de.py b/lang/de.py index 4f7ce36..1798c3b 100644 --- a/lang/de.py +++ b/lang/de.py @@ -21,13 +21,16 @@ *********************************************************************""" replies = { - 'success_decrypt' : "Hallo, Ich bin Edward, der freundliche GnuPG Roboter. Ich deine E-Mail empfangen und entschlüsselt. Hier ist eine Kopie deiner Nachricht:", + 'greeting' : "Hallo, Ich bin Edward, der freundliche GnuPG Roboter.", + 'success_decrypt' : "Ich deine E-Mail empfangen und entschlüsselt.", + 'quote_follows' : "Hier ist eine Kopie deiner Nachricht:", 'public_key_received' : 'Ich habe deinen öffentlicher Schlüssel erhalten. Danke.', 'failed_decrypt' : "Tut mir leid, ich konnte deine Nachricht nicht entschlüsseln. Bist du dir sicher, dass du sie mit meinem öffentlichen Schlüssel verschlüsselt hast?", 'no_public_key' : "Tut mir leid, Ich konnte deinen öffentlicher Schlüssel nicht finden. Hast du daran gedacht ihn an die E-Mail anzuhängen?", 'sig_failure' : 'Deine Signatur konnte nicht verifiziert werden.', 'sig_success' : 'Deine Signatur wurde erfolgreich verifiziert.', - 'signature' : '- Edward, der freundliche GnuPG Roboter\nnDie Free Software Foundation hat mich erstellt. Kannst du etwas spenden, um ihre Arbeit zu unterstützung? | https://www.fsf.org/donate' + 'signature' : '- Edward, der freundliche GnuPG Roboter\nnDie Free Software Foundation hat mich erstellt. Kannst du etwas spenden, um ihre Arbeit zu unterstützung? | https://www.fsf.org/donate', + 'space' : " " } diff --git a/lang/el.py b/lang/el.py index 4df5bb2..e87b993 100644 --- a/lang/el.py +++ b/lang/el.py @@ -21,13 +21,16 @@ *********************************************************************""" replies = { - 'success_decrypt' : "Γειά σου, είμαι ο Edward, το φιλικό ρομπότ του GnuPG. Έλαβα το μήνυμα σου και το αποκρυπτογράφησα. Δες ένα αντίγραφο του μηνύματος σου:", + 'greeting' : "Γειά σου, είμαι ο Edward, το φιλικό ρομπότ του GnuPG.", + 'success_decrypt' : "Έλαβα το μήνυμα σου και το αποκρυπτογράφησα.", + 'quote_follows' : "Δες ένα αντίγραφο του μηνύματος σου:", 'public_key_received' : 'Έλαβα το δημόσιο κλειδί σου. Ευχαριστώ.', 'failed_decrypt' : "Λυπάμαι, δε μπόρεσα να αποκρυπτογραφήσω το μήνυμα σου. Είσαι σίγουρος/η ότι το κρυπτογράφησες με το δημόσιο κλειδί μου;", 'no_public_key' : "Δυστυχώς δε μπόρεσα να βρώ το δημόσιο κλειδί σου. Μήπως ξέχασες να το επισυνάψεις;", 'sig_failure' : 'Δε μπόρεσα να επαληθεύσω την υπογραφή σου.', 'sig_success' : 'nΕπαλήθευσα την υπογραφή σου.', - 'signature' : '- Edward, το φιλικό ρομπότ του GnuPG\n\nΜε δημιούργησε η Free Software Foundation. Μπορείς να υποστηρίξεις το έργο τους με μια δωρεά; | https://www.fsf.org/donate' + 'signature' : '- Edward, το φιλικό ρομπότ του GnuPG\n\nΜε δημιούργησε η Free Software Foundation. Μπορείς να υποστηρίξεις το έργο τους με μια δωρεά; | https://www.fsf.org/donate', + 'space' : " " } diff --git a/lang/en.py b/lang/en.py index 582c165..f9455db 100644 --- a/lang/en.py +++ b/lang/en.py @@ -21,13 +21,16 @@ *********************************************************************""" replies = { - 'success_decrypt' : "Hello, I am Edward, the friendly GnuPG bot. I received your message and decrypted it. Here's a copy of your message:", + 'greeting' : "Hello, I am Edward, the friendly GnuPG bot.", + 'success_decrypt' : "I received your message and decrypted it.", + 'quote_follows' : "Here's a copy of your message:", 'public_key_received' : 'I received your public key. Thanks.', 'failed_decrypt' : "I'm sorry, I was not able to decrypt your message. Are you sure you encrypted it with my public key?", 'no_public_key' : "I'm sorry, I was not able to find your public key. Did you remember to attach it?", 'sig_failure' : 'Your signature could not be verified.', 'sig_success' : 'Your signature was verified.', - 'signature' : '- Edward, the friendly GnuPG bot\nThe Free Software Foundation created me.\n\nCan you donate to support their work?\nhttps://www.fsf.org/donate' + 'signature' : '- Edward, the friendly GnuPG bot\nThe Free Software Foundation created me.\n\nCan you donate to support their work?\nhttps://www.fsf.org/donate', + 'space' : " " } diff --git a/lang/es.py b/lang/es.py index aa5dee4..4dc6512 100644 --- a/lang/es.py +++ b/lang/es.py @@ -21,12 +21,15 @@ *********************************************************************""" replies = { - 'success_decrypt' : "He recibido tu mensaje y lo he descifrado. Aquí tienes una copia de tu mensaje:", - 'public_key_received' : 'Hola, soy Edward, el simpático robot GnuPG. He recibido tu clave pública. Gracias.', + 'greeting' : "Hola, soy Edward, el simpático robot GnuPG.", + 'success_decrypt' : "He recibido tu mensaje y lo he descifrado.", + 'quote_follows' : " Aquí tienes una copia de tu mensaje:", + 'public_key_received' : 'He recibido tu clave pública. Gracias.', 'failed_decrypt' : "Lo siento, no he podido descifrar tu mensaje. ¿Estás seguro de haberlo cifrado con mi clave pública?", 'no_public_key' : "Lo siento, no he podido encontrar tu clave pública. ¿Te acordaste de adjuntarla?", 'sig_failure' : 'No he podido verificar tu firma criptográfica.', 'sig_success' : 'He verificado con éxito tu firma criptográfica.', - 'signature' : '- Edward, el simpático robot GnuPG\n\nMe creó la Free Software Foundation. ¿Puedes hacer una donación para apoyar su trabajo? | https://www.fsf.org/donate' + 'signature' : '- Edward, el simpático robot GnuPG\n\nMe creó la Free Software Foundation. ¿Puedes hacer una donación para apoyar su trabajo? | https://www.fsf.org/donate', + 'space' : " " } diff --git a/lang/fr.py b/lang/fr.py index 686ae65..788e546 100644 --- a/lang/fr.py +++ b/lang/fr.py @@ -21,13 +21,16 @@ *********************************************************************""" replies = { - 'success_decrypt': " Bonjour, je suis Edward, le gentil robot de GnuPG. J'ai bien reçu votre message et l'ai déchiffré. En voici une copie:", + 'greeting' : "Bonjour, je suis Edward, le gentil robot de GnuPG.", + 'success_decrypt' : "J'ai bien reçu votre message et l'ai déchiffré.", + 'quote_follows' : "En voici une copie:", 'public_key_received' : "J'ai bien reçu votre clef publique. Merci.", 'failed_decrypt' : "Je n'ai pas été en mesure de déchiffrer votre message, désolé. L'avez-vous bien chiffré avec ma clef publique ?", 'no_public_key' : "Je n'ai pas pu trouver votre clef publique, désolé. Avez-vous oublié de la joindre ?", 'sig_failure' : "Votre signature n'a pas pu être vérifiée.", 'sig_success' : 'Votre signature a été vérifiée.', - 'signature' : "- Edward, le gentil robot de GnuPGn\nLa Free Software Foundation m'a créé. Pourriez-vous faire un don pour soutenir leur travail ? | https://www.fsf.org/donate" + 'signature' : "- Edward, le gentil robot de GnuPGn\nLa Free Software Foundation m'a créé. Pourriez-vous faire un don pour soutenir leur travail ? | https://www.fsf.org/donate", + 'space' : " " } diff --git a/lang/it.py b/lang/it.py index b2a3852..277168c 100644 --- a/lang/it.py +++ b/lang/it.py @@ -21,12 +21,15 @@ *********************************************************************""" replies = { - 'success_decrypt' : "Ciao, io sono Edward, l'amichevole bot GnuPG. Ho ricevuto il tuo messaggio e l'ho decriptato. Questa è una copia del tuo messaggio:", + 'greeting' : "Ciao, io sono Edward, l'amichevole bot GnuPG.", + 'success_decrypt' : "Ho ricevuto il tuo messaggio e l'ho decriptato.", + 'quote_follows' : "Questa è una copia del tuo messaggio:", 'public_key_received' : 'Ho ricevuto la tua chiave pubblica. Grazie.', 'failed_decrypt' : "Mi dispiace, non sono stato in grado di decifrare il tuo messaggio. Sei sicuro di averlo criptato con la mia chiave pubblica?", 'no_public_key' : "Mi dispiace, non ho trovato la tua chiave pubblica. Ti sei ricordato di allegarla?", 'sig_failure' : 'La tua firma non può essere verificata.', 'sig_success' : 'La tua firma è stata verificata.', - 'signature' : "- Edward, l'amichevole bot GnuPG\n\nLa Free Software Foundation mi ha creato. Potresti fare una donazione per supportare il loro lavoro? | https://www.fsf.org/donate" + 'signature' : "- Edward, l'amichevole bot GnuPG\n\nLa Free Software Foundation mi ha creato. Potresti fare una donazione per supportare il loro lavoro? | https://www.fsf.org/donate", + 'space' : " " } diff --git a/lang/ja.py b/lang/ja.py index 6cb9250..3d80f60 100644 --- a/lang/ja.py +++ b/lang/ja.py @@ -21,13 +21,16 @@ *********************************************************************""" replies = { - 'success_decrypt' : "こんにちは! 私はGnuPGボットのEdwardです。あなたから送られたメールの暗号を解きました。確認のため、内容を返信します:", + 'greeting' : "こんにちは! 私はGnuPGボットのEdwardです。", + 'success_decrypt' : "あなたから送られたメールの暗号を解きました。", + 'quote_follows' : "確認のため、内容を返信します:", 'public_key_received' : 'あなたの公開鍵を受けとりました。', 'failed_decrypt' : "あなたからのメッセージを解読できなくて、すみません。そちらでは暗号化のとき、私の公開鍵を使ってくださったでしょうか?", 'no_public_key' : "ごめんなさい、あなたの公開鍵が見つからないのです。公開鍵を添付したメールを前に送ってくださいましたか?", 'sig_failure' : 'あなたの署名を認証できませんでした。', 'sig_success' : ' あなたの署名を確認できました。', - 'signature' : '- GnuPGボットのEdward\n\nFree Software Foundationが私を制作しました。 Free Software Foundationに寄付しませんか。| https://www.fsf.org/donate' + 'signature' : '- GnuPGボットのEdward\n\nFree Software Foundationが私を制作しました。 Free Software Foundationに寄付しませんか。| https://www.fsf.org/donate', + 'space' : "" } diff --git a/lang/pt_br.py b/lang/pt_br.py index 43039b1..5c700a5 100644 --- a/lang/pt_br.py +++ b/lang/pt_br.py @@ -21,13 +21,16 @@ *********************************************************************""" replies = { - 'success_decrypt' : "Olá, sou Edward, o amigo robô de GnuPG. Recebi e decifrei sua mensagem. Aqui vai uma cópia da sua mensagem:", + 'greeting' : "Olá, sou Edward, o amigo robô de GnuPG.", + 'success_decrypt' : "Recebi e decifrei sua mensagem.", + 'quote_follows' : "Aqui vai uma cópia da sua mensagem:", 'public_key_received' : 'Recebi sua chave pública. Muito agradecido.', 'failed_decrypt' : "Perdão, não consegui decifrar sua mensagem. Você tem certeza que a cifrou usando minha chave pública?", 'no_public_key' : "Perdão, não consegui encontrar sua chave pública. Você se lembrou de anexá-la?", 'sig_failure' : 'Sua assinatura não pôde ser verificada.', 'sig_success' : 'Sua assinatura foi verificada.', - 'signature' : '- Edward, o amigo robô de GnuPG\n\nA Free Software Foundation me criou. Você pode fazer uma doação para apoiar o trabalho dela? | https://www.fsf.org/donate' + 'signature' : '- Edward, o amigo robô de GnuPG\n\nA Free Software Foundation me criou. Você pode fazer uma doação para apoiar o trabalho dela? | https://www.fsf.org/donate', + 'space' : " " } diff --git a/lang/ro.py b/lang/ro.py index 539ea2c..4eb67af 100644 --- a/lang/ro.py +++ b/lang/ro.py @@ -21,13 +21,16 @@ *********************************************************************""" replies = { - 'success_decrypt' : "Bună ziua, eu sunt Edward, robotul GnuPG cel prietenos. Am primit mesajul dumneavoastră și l-am decriptat. Iată o copie a mesajului dumneavoastră:", + 'greeting' : "Bună ziua, eu sunt Edward, robotul GnuPG cel prietenos.", + 'success_decrypt' : "Am primit mesajul dumneavoastră și l-am decriptat.", + 'quote_follows' : "Iată o copie a mesajului dumneavoastră:", 'public_key_received' : 'Am primit cheia dumneavoastră publică. Mulțumesc.', 'failed_decrypt' : "Îmi pare rău, dar nu am putut decripta mesajul dumneavoastră. Sunteți sigur(ă) că l-ați criptat cu cheia mea publică?", 'no_public_key' : "Îmi pare rău, dar nu am putut găsi cheia dumneavoastră publică. V-ați amintit să o atașați?", 'sig_failure' : 'Semnătura dumneavoastră nu a putut fi verificată.', 'sig_success' : 'Semnătura dumneavoastră a fost verificată.', - 'signature' : '- Edward, robotul GnuPG cel prietenos.\n\nFundația pentru Software Liber m-a creat. Puteți dona ca să le susțineți munca? | https://www.fsf.org/donate' + 'signature' : '- Edward, robotul GnuPG cel prietenos.\n\nFundația pentru Software Liber m-a creat. Puteți dona ca să le susțineți munca? | https://www.fsf.org/donate', + 'space' : " " } diff --git a/lang/ru.py b/lang/ru.py index c384839..acae0b3 100644 --- a/lang/ru.py +++ b/lang/ru.py @@ -21,13 +21,16 @@ *********************************************************************""" replies = { - 'success_decrypt' : "Привет, я Эдвард, дружелюбный GnuPG бот. Я получил ваше сообщение и расшифровал его. Вот копия вашего сообщения:", + 'greeting' : "Привет, я Эдвард, дружелюбный GnuPG бот.", + 'success_decrypt' : "Я получил ваше сообщение и расшифровал его.", + 'quote_follows' : "Вот копия вашего сообщения:", 'public_key_received' : 'Я получил ваш открытый ключ. Спасибо.', 'failed_decrypt' : "Прошу прощения, я не смог расшифровать ваше сообщение. Вы уверены, что зашифровали его при помощи моего открытого ключа?", 'no_public_key' : "Прошу прощения, я не смог найти ваш открытый ключ. Вы не забыли вложить его в письмо?", 'sig_failure' : 'Мне не удалось проверить вашу подпись.', 'sig_success' : 'Ваша подпись была успешно проверена.', - 'signature' : '- Эдвард, дружелюбный GnuPG бот\nЯ был создан Фондом свободного программного обеспечения. Вы можете сделать пожертвование в поддержку их работы? | https://www.fsf.org/donate' + 'signature' : '- Эдвард, дружелюбный GnuPG бот\nЯ был создан Фондом свободного программного обеспечения. Вы можете сделать пожертвование в поддержку их работы? | https://www.fsf.org/donate', + 'space' : " " } diff --git a/lang/tr.py b/lang/tr.py index 2ca1fa7..ce26612 100644 --- a/lang/tr.py +++ b/lang/tr.py @@ -21,13 +21,16 @@ *********************************************************************""" replies = { - 'success_decrypt' : "Merhaba, Ben Edward, arkadaş canlısı GnuPG botu. Mesajınızı aldım ve şifresini çözerek düz metine çevirdim. Mesajınızın düz metin kopyası şudur:", + 'greeting' : "Merhaba, Ben Edward, arkadaş canlısı GnuPG botu.", + 'success_decrypt' : "Mesajınızı aldım ve şifresini çözerek düz metine çevirdim.", + 'quote_follows' : "Mesajınızın düz metin kopyası şudur:", 'public_key_received' : 'Açık anahtarınızı aldım. Teşekkürler.', 'failed_decrypt' : "Özür dilerim, mesajınızı çözmeyi ve düz metine çevirmeyi başaramadım. Benim açık anahtarımla şifrelediğinize emin misiniz?", 'no_public_key' : "Özür dilerim, açık anahtarınızı bulamadım. E-postaya eklemeyi unutmadınız, değil mi?", 'sig_failure' : 'İmzanız doğrulanamadı.', 'sig_success' : 'İmzanız doğrulandı.', - 'signature' : '- Edward, arkadaş canlısı GnuPG botu\n\nÖzgür Yazılım Vakfı tarafından yaratıldım. Çalışmalarını desteklemek için bağışta bulunur musunuz? | https://www.fsf.org/donate' + 'signature' : '- Edward, arkadaş canlısı GnuPG botu\n\nÖzgür Yazılım Vakfı tarafından yaratıldım. Çalışmalarını desteklemek için bağışta bulunur musunuz? | https://www.fsf.org/donate', + 'space' : " " } diff --git a/tests/flatten-2.out b/tests/flatten-2.out index 190652a..795aac0 100644 --- a/tests/flatten-2.out +++ b/tests/flatten-2.out @@ -1,4 +1,4 @@ -Hello, I am Edward, the friendly GnuPG bot. I received your message and decrypted it. Here's a copy of your message: +I received your message and decrypted it. Your signature could not be verified. diff --git a/tests/gpg-flatten-1.out b/tests/gpg-flatten-1.out index c7d4ba3..934ec63 100644 --- a/tests/gpg-flatten-1.out +++ b/tests/gpg-flatten-1.out @@ -1,4 +1,4 @@ -Hello, I am Edward, the friendly GnuPG bot. I received your message and decrypted it. Here's a copy of your message: +I received your message and decrypted it. Here's a copy of your message: > thanks for the message! > diff --git a/tests/gpg-flatten-2.out b/tests/gpg-flatten-2.out index aeb3687..1ffc9fa 100644 --- a/tests/gpg-flatten-2.out +++ b/tests/gpg-flatten-2.out @@ -1,4 +1,6 @@ -Hello, I am Edward, the friendly GnuPG bot. I received your message and decrypted it. Here's a copy of your message: +Hello, I am Edward, the friendly GnuPG bot. + +I received your message and decrypted it. Here's a copy of your message: > thanks for the message! > diff --git a/tests/gpg-flatten-4.out b/tests/gpg-flatten-4.out index 4802422..5148e53 100644 --- a/tests/gpg-flatten-4.out +++ b/tests/gpg-flatten-4.out @@ -1,4 +1,4 @@ -こんにちは! 私はGnuPGボットのEdwardです。あなたから送られたメールの暗号を解きました。確認のため、内容を返信します: +あなたから送られたメールの暗号を解きました。確認のため、内容を返信します: > thanks for the message! > -- 2.25.1