From 64f9d7e94f5e3418320a1610540fec6ddd5de574 Mon Sep 17 00:00:00 2001 From: "Rifakat Haradwala (Open ERP)" Date: Tue, 8 Mar 2011 16:52:08 +0530 Subject: [PATCH] [IMP] : base_module_quality, crm, email_template, mail_gateway, sale_crm, share: string formatting bzr revid: rha@tinyerp.com-20110308112208-40jbv5er9w21xiw0 --- addons/base_module_quality/i18n/base_module_quality.pot | 3 +-- addons/base_module_quality/speed_test/speed_test.py | 2 +- addons/crm/crm_lead.py | 2 +- addons/crm/i18n/crm.pot | 6 ++++++ addons/email_template/email_template.py | 4 ++-- addons/email_template/i18n/email_template.pot | 2 +- addons/mail_gateway/i18n/mail_gateway.pot | 8 ++++---- addons/mail_gateway/mail_gateway.py | 8 ++++---- addons/sale_crm/i18n/sale_crm.pot | 9 ++------- addons/sale_crm/wizard/crm_make_sale.py | 2 +- addons/share/i18n/share.pot | 8 +++++--- addons/share/wizard/share_wizard.py | 4 ++-- 12 files changed, 30 insertions(+), 28 deletions(-) diff --git a/addons/base_module_quality/i18n/base_module_quality.pot b/addons/base_module_quality/i18n/base_module_quality.pot index f96e2828f60..94113a8a457 100644 --- a/addons/base_module_quality/i18n/base_module_quality.pot +++ b/addons/base_module_quality/i18n/base_module_quality.pot @@ -351,10 +351,9 @@ msgid "Error! Module is not properly loaded/installed" msgstr "" #. module: base_module_quality -#: code:addons/base_module_quality/speed_test/speed_test.py:115 #: code:addons/base_module_quality/speed_test/speed_test.py:116 #, python-format -msgid "Error in Read method" +msgid "Error in Read method: %s" msgstr "" #. module: base_module_quality diff --git a/addons/base_module_quality/speed_test/speed_test.py b/addons/base_module_quality/speed_test/speed_test.py index 611ada2c13e..21ddee92ea1 100644 --- a/addons/base_module_quality/speed_test/speed_test.py +++ b/addons/base_module_quality/speed_test/speed_test.py @@ -113,7 +113,7 @@ This test checks the speed of the module. Note that at least 5 demo data is need except Exception, e: self.log.warning('Error in read method', exc_info=True) list2 = [obj, _("Error in Read method")] - speed_list = [obj, size, code_base_complexity, code_half_complexity, code_size_complexity, _("Error in Read method") + ": %s " % e] + speed_list = [obj, size, code_base_complexity, code_half_complexity, code_size_complexity, _("Error in Read method: %s") % e] else: if size < 5: speed_list = [obj, size, code_base_complexity, code_half_complexity, code_size_complexity, _("Warning! Not enough demo data")] diff --git a/addons/crm/crm_lead.py b/addons/crm/crm_lead.py index 4507baad2f7..47b811963dc 100644 --- a/addons/crm/crm_lead.py +++ b/addons/crm/crm_lead.py @@ -279,7 +279,7 @@ class crm_lead(crm_case, osv.osv): if 'stage_id' in vals and vals['stage_id']: stage_obj = self.pool.get('crm.case.stage').browse(cr, uid, vals['stage_id'], context=context) - self.history(cr, uid, ids, _("Changed Stage to: ") + stage_obj.name, details=_("Changed Stage to: ") + stage_obj.name) + self.history(cr, uid, ids, _("Changed Stage to: %s") % stage_obj.name, details=_("Changed Stage to: %s") % stage_obj.name) message='' for case in self.browse(cr, uid, ids, context=context): if case.type == 'lead' or context.get('stage_type',False)=='lead': diff --git a/addons/crm/i18n/crm.pot b/addons/crm/i18n/crm.pot index 8757c33f9f7..860a11217da 100644 --- a/addons/crm/i18n/crm.pot +++ b/addons/crm/i18n/crm.pot @@ -2267,6 +2267,12 @@ msgstr "" msgid "The stage of opportunity '%s' has been changed to '%s'." msgstr "" +#. module: crm +#: code:addons/crm/crm_lead.py:282 +#, python-format +msgid "Changed Stage to: %s" +msgstr "" + #. module: crm #: selection:crm.segmentation.line,operator:0 msgid "Mandatory Expression" diff --git a/addons/email_template/email_template.py b/addons/email_template/email_template.py index ee94b4c7c37..bb0a1f94708 100644 --- a/addons/email_template/email_template.py +++ b/addons/email_template/email_template.py @@ -36,7 +36,7 @@ try: TEMPLATE_ENGINES.append(('mako', 'Mako Templates')) except ImportError: logging.getLogger('init').warning("module email_template: Mako templates not installed") - + try: from django.template import Context, Template as DjangoTemplate #Workaround for bug: @@ -316,7 +316,7 @@ This is useful for CRM leads for example"), default = {} default = default.copy() old = self.read(cr, uid, id, ['name'], context=context) - new_name = _("Copy of template ") + old.get('name', 'No Name') + new_name = _("Copy of template %s") % old.get('name', 'No Name') check = self.search(cr, uid, [('name', '=', new_name)], context=context) if check: new_name = new_name + '_' + random.choice('abcdefghij') + random.choice('lmnopqrs') + random.choice('tuvwzyz') diff --git a/addons/email_template/i18n/email_template.pot b/addons/email_template/i18n/email_template.pot index 54a559dcb89..09b9d459a2f 100644 --- a/addons/email_template/i18n/email_template.pot +++ b/addons/email_template/i18n/email_template.pot @@ -856,7 +856,7 @@ msgstr "" #. module: email_template #: code:addons/email_template/email_template.py:319 #, python-format -msgid "Copy of template " +msgid "Copy of template %s" msgstr "" #. module: email_template diff --git a/addons/mail_gateway/i18n/mail_gateway.pot b/addons/mail_gateway/i18n/mail_gateway.pot index 42cb1443822..2f951863a93 100644 --- a/addons/mail_gateway/i18n/mail_gateway.pot +++ b/addons/mail_gateway/i18n/mail_gateway.pot @@ -113,9 +113,9 @@ msgid "Partner" msgstr "" #. module: mail_gateway -#: code:addons/mail_gateway/mail_gateway.py:242 +#: code:addons/mail_gateway/mail_gateway.py:250 #, python-format -msgid " wrote on " +msgid " wrote on %s:\n" msgstr "" #. module: mail_gateway @@ -286,9 +286,9 @@ msgid "Cc" msgstr "" #. module: mail_gateway -#: code:addons/mail_gateway/mail_gateway.py:246 +#: code:addons/mail_gateway/mail_gateway.py:254 #, python-format -msgid " on " +msgid " on %s:\n" msgstr "" #. module: mail_gateway diff --git a/addons/mail_gateway/mail_gateway.py b/addons/mail_gateway/mail_gateway.py index 5dae3d3bb16..213d2376def 100644 --- a/addons/mail_gateway/mail_gateway.py +++ b/addons/mail_gateway/mail_gateway.py @@ -169,7 +169,7 @@ class mailgate_thread(osv.osv): 'message_id': message_id, 'attachment_ids': [(6, 0, attachments)] } - + obj.create(cr, uid, data, context=context) return True mailgate_thread() @@ -221,7 +221,7 @@ class mailgate_message(osv.osv): action_data = False action_pool = self.pool.get('ir.actions.act_window') message_pool = self.browse(cr ,uid, ids, context=context)[0] - att_ids = [x.id for x in message_pool.attachment_ids] + att_ids = [x.id for x in message_pool.attachment_ids] action_ids = action_pool.search(cr, uid, [('res_model', '=', 'ir.attachment')]) if action_ids: action_data = action_pool.read(cr, uid, action_ids[0], context=context) @@ -247,11 +247,11 @@ class mailgate_message(osv.osv): for message in self.browse(cr, uid, ids, context=context): msg_txt = '' if message.history: - msg_txt += (message.email_from or '/') + _(' wrote on ') + format_date_tz(message.date, tz) + ':\n\t' + msg_txt += (message.email_from or '/') + _(' wrote on %s:\n\t') % format_date_tz(message.date, tz) if message.description: msg_txt += self.truncate_data(cr, uid, message.description, context=context) else: - msg_txt = (message.user_id.name or '/') + _(' on ') + format_date_tz(message.date, tz) + ':\n\t' + msg_txt = (message.user_id.name or '/') + _(' on %s:\n\t') % format_date_tz(message.date, tz) msg_txt += message.name result[message.id] = msg_txt return result diff --git a/addons/sale_crm/i18n/sale_crm.pot b/addons/sale_crm/i18n/sale_crm.pot index 1903c196ce7..cbd1428243c 100644 --- a/addons/sale_crm/i18n/sale_crm.pot +++ b/addons/sale_crm/i18n/sale_crm.pot @@ -28,9 +28,10 @@ msgstr "" #. module: sale_crm #: code:addons/sale_crm/wizard/crm_make_sale.py:108 #, python-format -msgid "is converted to Quotation." +msgid "Opportunity '%s' is converted to Quotation." msgstr "" + #. module: sale_crm #: code:addons/sale_crm/wizard/crm_make_sale.py:89 #, python-format @@ -94,12 +95,6 @@ msgstr "" msgid "Converted to Sales Quotation(id: %s)." msgstr "" -#. module: sale_crm -#: code:addons/sale_crm/wizard/crm_make_sale.py:108 -#, python-format -msgid "Opportunity " -msgstr "" - #. module: sale_crm #: code:addons/sale_crm/wizard/crm_make_sale.py:92 #, python-format diff --git a/addons/sale_crm/wizard/crm_make_sale.py b/addons/sale_crm/wizard/crm_make_sale.py index 3c17f278e16..50fbbc4dea3 100644 --- a/addons/sale_crm/wizard/crm_make_sale.py +++ b/addons/sale_crm/wizard/crm_make_sale.py @@ -105,7 +105,7 @@ class crm_make_sale(osv.osv_memory): new_id = sale_obj.create(cr, uid, vals) case_obj.write(cr, uid, [case.id], {'ref': 'sale.order,%s' % new_id}) new_ids.append(new_id) - message = _('Opportunity ') + " '" + case.name + "' "+ _("is converted to Quotation.") + message = _("Opportunity '%s' is converted to Quotation.") % (case.name) self.log(cr, uid, case.id, message) case_obj._history(cr, uid, [case], _("Converted to Sales Quotation(id: %s).") % (new_id)) diff --git a/addons/share/i18n/share.pot b/addons/share/i18n/share.pot index 2d90d0ba8ca..5fecafdfce3 100644 --- a/addons/share/i18n/share.pot +++ b/addons/share/i18n/share.pot @@ -61,10 +61,12 @@ msgid "Share Access Rules" msgstr "" #. module: share -#: code:addons/share/wizard/share_wizard.py:425 +#: code:addons/share/wizard/share_wizard.py:453 #, python-format msgid "Dear,\n" "\n" +"%s\n" +"\n" "" msgstr "" @@ -116,9 +118,9 @@ msgid "Generic Share Access URL" msgstr "" #. module: share -#: code:addons/share/wizard/share_wizard.py:429 +#: code:addons/share/wizard/share_wizard.py:457 #, python-format -msgid "You may use the following login and password to get access to this protected area:" +msgid "You may use the following login and password to get access to this protected area:\n" msgstr "" #. module: share diff --git a/addons/share/wizard/share_wizard.py b/addons/share/wizard/share_wizard.py index 48243c57dda..6eda2360d2b 100644 --- a/addons/share/wizard/share_wizard.py +++ b/addons/share/wizard/share_wizard.py @@ -450,11 +450,11 @@ class share_create(osv.osv_memory): for result_line in wizard_data.result_line_ids: email_to = result_line.login subject = _('%s has shared OpenERP %s information with you') % (user.name, wizard_data.action_id.name) - body = _("Dear,\n\n") + subject + "\n\n" + body = _("Dear,\n\n%s\n\n") % subject body += _("To access it, you can go to the following URL:\n %s") % result_line.share_url body += "\n\n" if result_line.newly_created: - body += _("You may use the following login and password to get access to this protected area:") + "\n" + body += _("You may use the following login and password to get access to this protected area:\n") body += "%s: %s" % (_("Username"), result_line.login) + "\n" body += "%s: %s" % (_("Password"), result_line.password) + "\n" body += "%s: %s" % (_("Database"), cr.dbname) + "\n"