From e1dbdbc51a384bdfc929f4951ddb81106dfbb01b Mon Sep 17 00:00:00 2001 From: Jairo Llopis Date: Fri, 29 Jan 2016 12:38:38 +0100 Subject: [PATCH] Make strings more translator-friendly. --- mass_mailing_unique/hooks.py | 16 ++++++++-------- mass_mailing_unique/i18n/es.po | 30 +++++++++++++++--------------- 2 files changed, 23 insertions(+), 23 deletions(-) diff --git a/mass_mailing_unique/hooks.py b/mass_mailing_unique/hooks.py index 7c8de0c9..419b520f 100644 --- a/mass_mailing_unique/hooks.py +++ b/mass_mailing_unique/hooks.py @@ -17,27 +17,27 @@ def pre_init_hook(cr): errors = list() # Search for duplicates in emails - cr.execute("""SELECT c.email, l.name AS list, COUNT(c.id) AS duplicates + cr.execute("""SELECT c.email, l.name, COUNT(c.id) FROM mail_mass_mailing_contact AS c INNER JOIN mail_mass_mailing_list AS l ON c.list_id = l.id GROUP BY l.name, l.id, c.email HAVING COUNT(c.id) > 1""") - for result in cr.dictfetchall(): + for result in cr.fetchall(): errors.append( - _("%(email)s appears %(duplicates)d times in list %(list)s") % - result) + _("{0} appears {2} times in list {1}.").format(*result)) # Search for duplicates in list's name - cr.execute("""SELECT name, COUNT(id) as duplicates + cr.execute("""SELECT name, COUNT(id) FROM mail_mass_mailing_list GROUP BY name HAVING COUNT(id) > 1""") - for result in cr.dictfetchall(): + for result in cr.fetchall(): errors.append( - _("there are %(duplicates)d lists with name %(name)s") % result) + _("There are {1} lists with name {0}.").format(*result)) # Abort if duplicates are found if errors: raise ValidationError( - _("Fix this before installing: %s.") % ", ".join(errors)) + _("Fix this before installing:") + + "".join("\n" + e for e in errors)) diff --git a/mass_mailing_unique/i18n/es.po b/mass_mailing_unique/i18n/es.po index 8221df28..c2447c42 100644 --- a/mass_mailing_unique/i18n/es.po +++ b/mass_mailing_unique/i18n/es.po @@ -6,23 +6,17 @@ msgid "" msgstr "" "Project-Id-Version: Odoo Server 8.0\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2016-01-25 09:40+0000\n" -"PO-Revision-Date: 2016-01-25 10:42+0100\n" +"POT-Creation-Date: 2016-01-29 12:37+0100\n" +"PO-Revision-Date: 2016-01-29 12:38+0100\n" "Last-Translator: Jairo Llopis \n" "Language-Team: \n" +"Language: es\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: \n" -"Language: es\n" "X-Generator: Poedit 1.8.5\n" -#. module: mass_mailing_unique -#: code:addons/mass_mailing_unique/__init__.py:29 -#, python-format -msgid "%(email)s appears %(duplicates)d times in list %(list)s" -msgstr "%(email)s aparece %(duplicates)d veces en la lista %(list)s" - #. module: mass_mailing_unique #: sql_constraint:mail.mass_mailing.list:0 msgid "Cannot have more than one lists with the same name." @@ -34,10 +28,10 @@ msgid "Cannot have the same email more than once in the same list." msgstr "No se puede tener el mismo email varias veces en la misma lista." #. module: mass_mailing_unique -#: code:addons/mass_mailing_unique/__init__.py:44 +#: code:addons/mass_mailing_unique/hooks.py:42 #, python-format -msgid "Fix this before installing: %s." -msgstr "Arregle esto antes de instalar: %s." +msgid "Fix this before installing:" +msgstr "Arregle esto antes de instalar:" #. module: mass_mailing_unique #: model:ir.model,name:mass_mailing_unique.model_mail_mass_mailing_list @@ -50,7 +44,13 @@ msgid "Mass Mailing Contact" msgstr "Contacto de envĂ­o masivo" #. module: mass_mailing_unique -#: code:addons/mass_mailing_unique/__init__.py:39 +#: code:addons/mass_mailing_unique/hooks.py:37 +#, python-format +msgid "There are {1} lists with name {0}." +msgstr "Hay {1} listas con el nombre {0}." + +#. module: mass_mailing_unique +#: code:addons/mass_mailing_unique/hooks.py:28 #, python-format -msgid "there are %(duplicates)d lists with name %(name)s" -msgstr "hay %(duplicates)d listas con el nombre %(name)s" +msgid "{0} appears {2} times in list {1}." +msgstr "{0} aparece {2} veces en la lista {1}."