Browse Source

Make strings more translator-friendly.

pull/38/head
Jairo Llopis 9 years ago
parent
commit
e1dbdbc51a
  1. 16
      mass_mailing_unique/hooks.py
  2. 30
      mass_mailing_unique/i18n/es.po

16
mass_mailing_unique/hooks.py

@ -17,27 +17,27 @@ def pre_init_hook(cr):
errors = list() errors = list()
# Search for duplicates in emails # 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 FROM
mail_mass_mailing_contact AS c mail_mass_mailing_contact AS c
INNER JOIN mail_mass_mailing_list AS l ON c.list_id = l.id INNER JOIN mail_mass_mailing_list AS l ON c.list_id = l.id
GROUP BY l.name, l.id, c.email GROUP BY l.name, l.id, c.email
HAVING COUNT(c.id) > 1""") HAVING COUNT(c.id) > 1""")
for result in cr.dictfetchall():
for result in cr.fetchall():
errors.append( 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 # 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 FROM mail_mass_mailing_list
GROUP BY name GROUP BY name
HAVING COUNT(id) > 1""") HAVING COUNT(id) > 1""")
for result in cr.dictfetchall():
for result in cr.fetchall():
errors.append( 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 # Abort if duplicates are found
if errors: if errors:
raise ValidationError( raise ValidationError(
_("Fix this before installing: %s.") % ", ".join(errors))
_("Fix this before installing:") +
"".join("\n" + e for e in errors))

30
mass_mailing_unique/i18n/es.po

@ -6,23 +6,17 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: Odoo Server 8.0\n" "Project-Id-Version: Odoo Server 8.0\n"
"Report-Msgid-Bugs-To: \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 <j.llopis@grupoesoc.es>\n" "Last-Translator: Jairo Llopis <j.llopis@grupoesoc.es>\n"
"Language-Team: \n" "Language-Team: \n"
"Language: es\n"
"MIME-Version: 1.0\n" "MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n" "Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n" "Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: \n" "Plural-Forms: \n"
"Language: es\n"
"X-Generator: Poedit 1.8.5\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 #. module: mass_mailing_unique
#: sql_constraint:mail.mass_mailing.list:0 #: sql_constraint:mail.mass_mailing.list:0
msgid "Cannot have more than one lists with the same name." 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." msgstr "No se puede tener el mismo email varias veces en la misma lista."
#. module: mass_mailing_unique #. module: mass_mailing_unique
#: code:addons/mass_mailing_unique/__init__.py:44
#: code:addons/mass_mailing_unique/hooks.py:42
#, python-format #, 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 #. module: mass_mailing_unique
#: model:ir.model,name:mass_mailing_unique.model_mail_mass_mailing_list #: 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" msgstr "Contacto de envío masivo"
#. module: mass_mailing_unique #. 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 #, 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}."
Loading…
Cancel
Save