From d3729c8526c307177eb1cc8ec42fa4820038aa0f Mon Sep 17 00:00:00 2001 From: "Pinakin Nayi (OpenERP)" Date: Tue, 9 Apr 2013 10:57:12 +0530 Subject: [PATCH 1/2] [IMP]survey:add missing translation bzr revid: pna@tinyerp.com-20130409052712-bxnwhj4ro2tuksk6 --- addons/survey/i18n/survey.pot | 90 +++++++++++++++++++ .../survey/report/survey_browse_response.py | 19 ++-- addons/survey/wizard/survey_answer.py | 16 ++-- 3 files changed, 108 insertions(+), 17 deletions(-) diff --git a/addons/survey/i18n/survey.pot b/addons/survey/i18n/survey.pot index cd08e9bc711..f08b9ede3c4 100644 --- a/addons/survey/i18n/survey.pot +++ b/addons/survey/i18n/survey.pot @@ -1490,6 +1490,54 @@ msgstr "" msgid "Survey Answers" msgstr "" +#. module: survey +#: code:addons/survey/report/survey_browse_response.py:70 +#, python-format +msgid "Page : " +msgstr "" + +#. module: survey +#: code:addons/survey/report/survey_browse_response.py:210 +#, python-format +msgid "Print Date : " +msgstr "" + +#. module: survey +#: code:addons/survey/report/survey_browse_response.py:213 +#, python-format +msgid "Answered by : " +msgstr "" + +#. module: survey +#: code:addons/survey/report/survey_browse_response.py:220 +#, python-format +msgid "Answer Date : " +msgstr "" + +#. module: survey +#: code:addons/survey/report/survey_browse_response.py:225 +#, python-format +msgid "Not Finished" +msgstr "" + +#. module: survey +#: code:addons/survey/report/survey_browse_response.py:226 +#, python-format +msgid "Finished" +msgstr "" + +#. module: survey +#: code:addons/survey/report/survey_browse_response.py:232 +#, python-format +msgid "Status :- " +msgstr "" + +#. module: survey +#: code:addons/survey/report/survey_browse_response.py:243 +#, python-format +msgid "Page :- " +msgstr "" + #. module: survey #: model:ir.ui.menu,name:survey.menu_print_survey_answer msgid "Surveys Answers" @@ -1596,6 +1644,48 @@ msgstr "" msgid "Warning!" msgstr "" +#. module: survey +#: code:addons/survey/wizard/survey_answer.py:392 +#, python-format +msgid "Exit" +msgstr "" + +#. module: survey +#: code:addons/survey/wizard/survey_answer.py:376 +#, python-format +msgid "Next" +msgstr "" + +#. module: survey +#: code:addons/survey/wizard/survey_answer.py:222 +#, python-format +msgid "Answer" +msgstr "" + +#. module: survey +#: code:addons/survey/wizard/survey_answer.py:174 +#, python-format +msgid "Answer Of :- " +msgstr "" + +#. module: survey +#: code:addons/survey/wizard/survey_answer.py:174 +#, python-format +msgid ", Date :- " +msgstr "" + +#. module: survey +#: code:addons/survey/wizard/survey_answer.py:175 +#, python-format +msgid " Answer :- " +msgstr "" + +#. module: survey +#: code:addons/survey/wizard/survey_answer.py:375 +#, python-format +msgid "Previous" +msgstr "" + #. module: survey #: code:addons/survey/survey.py:465 #, python-format diff --git a/addons/survey/report/survey_browse_response.py b/addons/survey/report/survey_browse_response.py index f910140727d..54abe6e34bb 100644 --- a/addons/survey/report/survey_browse_response.py +++ b/addons/survey/report/survey_browse_response.py @@ -26,6 +26,7 @@ from openerp import pooler, tools from openerp.report import report_sxw from openerp.report.interface import report_rml from openerp.tools import to_xml +from openerp.tools.translate import _ class survey_browse_response(report_rml): def create(self, cr, uid, ids, datas, context): @@ -66,7 +67,7 @@ class survey_browse_response(report_rml): rml +=""" - Page : """ + """+_('Page : ')+""" """ rml +=""" @@ -206,29 +207,29 @@ class survey_browse_response(report_rml): resp_create = tools.ustr(time.strftime('%d-%m-%Y %I:%M:%S %p', time.strptime(response.date_create.split('.')[0], '%Y-%m-%d %H:%M:%S'))) rml += """ - Print Date : + """ + _('Print Date : ') + """ """ + to_xml(rml_obj.formatLang(time.strftime("%Y-%m-%d %H:%M:%S"),date_time=True)) + """ - Answered by : + """ +_('Answered by : ') + """ """ + to_xml(response.user_id.login or '') + """ - Answer Date : + """ +_('Answer Date : ') + """ """ + to_xml(resp_create) + """ """ - status = "Not Finished" - if response.state == "done": status = "Finished" + status = _("Not Finished") + if response.state == "done": status = _("Finished") colwidth = str(tbl_width - 7) + "cm," colwidth += "7cm" rml += """ """ + to_xml(tools.ustr(survey.title)) + """ - Status :- """ + to_xml(tools.ustr(status)) + """ + """+_('Status :- ')+ to_xml(tools.ustr(status)) + """ """ @@ -239,7 +240,7 @@ class survey_browse_response(report_rml): for page in survey.page_ids: rml += """ - Page :- """ + to_xml(tools.ustr(page.title or '')) + """ + """+_('Page :- ') + to_xml(tools.ustr(page.title or '')) + """ """ if page.note: rml += """ @@ -299,7 +300,7 @@ class survey_browse_response(report_rml): else: rml +=""" - No Answer + """+ _('No Answer') + """ """ elif que.type in ['multiple_choice_only_one_ans','multiple_choice_multiple_ans']: diff --git a/addons/survey/wizard/survey_answer.py b/addons/survey/wizard/survey_answer.py index d935eb92ade..4e7c1c57304 100644 --- a/addons/survey/wizard/survey_answer.py +++ b/addons/survey/wizard/survey_answer.py @@ -171,8 +171,8 @@ class survey_question_wiz(osv.osv_memory): # TODO: l10n, cleanup this code to make it readable. Or template? xml_group = etree.SubElement(xml_form, 'group', {'col': '40', 'colspan': '4'}) record = sur_response_obj.browse(cr, uid, context['response_id'][context['response_no']]) - etree.SubElement(xml_group, 'label', {'string': to_xml(tools.ustr('Answer Of :- ' + record.user_id.name + ', Date :- ' + record.date_create.split('.')[0] )), 'align':"0.0"}) - etree.SubElement(xml_group, 'label', {'string': to_xml(tools.ustr(" Answer :- " + str(context.get('response_no',0) + 1) +"/" + str(len(context.get('response_id',0))) )), 'align':"0.0"}) + etree.SubElement(xml_group, 'label', {'string': to_xml(tools.ustr(_('Answer Of :- ') + record.user_id.name + _(', Date :- ') + record.date_create.split('.')[0] )), 'align':"0.0"}) + etree.SubElement(xml_group, 'label', {'string': to_xml(tools.ustr(_(" Answer :- ") + str(context.get('response_no',0) + 1) +"/" + str(len(context.get('response_id',0))) )), 'align':"0.0"}) if context.get('response_no',0) > 0: etree.SubElement(xml_group, 'button', {'colspan':"1",'icon':"gtk-go-back",'name':"action_forward_previous",'string': tools.ustr("Previous Answer"),'type':"object"}) if context.get('response_no',0) + 1 < len(context.get('response_id',0)): @@ -219,7 +219,7 @@ class survey_question_wiz(osv.osv_memory): selection.append((tools.ustr(ans.id), ans.answer)) xml_group = etree.SubElement(xml_group, 'group', {'col': '2', 'colspan': '2'}) etree.SubElement(xml_group, 'field', {'readonly':str(readonly), 'name': tools.ustr(que.id) + "_selection"}) - fields[tools.ustr(que.id) + "_selection"] = {'type':'selection', 'selection' :selection, 'string':"Answer"} + fields[tools.ustr(que.id) + "_selection"] = {'type':'selection', 'selection' :selection, 'string':_('Answer')} elif que_rec.type == 'multiple_choice_multiple_ans': xml_group = etree.SubElement(xml_group, 'group', {'col': '4', 'colspan': '4'}) @@ -372,10 +372,10 @@ class survey_question_wiz(osv.osv_memory): if pre_button: etree.SubElement(xml_footer, 'label', {'string': ""}) - etree.SubElement(xml_footer, 'button', {'name':"action_previous",'string':"Previous",'type':"object"}) - but_string = "Next" + etree.SubElement(xml_footer, 'button', {'name':"action_previous",'string':_('Previous'),'type':"object"}) + but_string = _('Next') if int(page_number) + 1 == total_pages: - but_string = "Done" + but_string = _('Done') if context.has_key('active') and context.get('active',False) and int(page_number) + 1 == total_pages and context.has_key('response_id') and context.has_key('response_no') and context.get('response_no',0) + 1 == len(context.get('response_id',0)): etree.SubElement(xml_footer, 'label', {'string': ""}) etree.SubElement(xml_footer, 'button', {'special' : 'cancel','string': tools.ustr("Done") ,'context' : tools.ustr(context), 'class':"oe_highlight"}) @@ -388,8 +388,8 @@ class survey_question_wiz(osv.osv_memory): else: etree.SubElement(xml_footer, 'label', {'string': ""}) etree.SubElement(xml_footer, 'button', {'name':"action_next",'string': tools.ustr(but_string) ,'type':"object",'context' : tools.ustr(context), 'class':"oe_highlight"}) - etree.SubElement(xml_footer, 'label', {'string': "or"}) - etree.SubElement(xml_footer, 'button', {'special': "cancel",'string':"Exit",'class':"oe_link"}) + etree.SubElement(xml_footer, 'label', {'string': _('or')}) + etree.SubElement(xml_footer, 'button', {'special': "cancel",'string':_('Exit'),'class':"oe_link"}) etree.SubElement(xml_footer, 'label', {'string': tools.ustr(page_number+ 1) + "/" + tools.ustr(total_pages), 'class':"oe_survey_title_page oe_right"}) root = xml_form.getroottree() From a9e8b58ec5746113dfef89c5bd540d188db99b55 Mon Sep 17 00:00:00 2001 From: "Pinakin Nayi (OpenERP)" Date: Thu, 11 Apr 2013 14:38:42 +0530 Subject: [PATCH 2/2] [Remove]survey:remove pot changes bzr revid: pna@tinyerp.com-20130411090842-2s8i8t1wr11hvs8c --- addons/survey/i18n/survey.pot | 90 ----------------------------------- 1 file changed, 90 deletions(-) diff --git a/addons/survey/i18n/survey.pot b/addons/survey/i18n/survey.pot index f08b9ede3c4..cd08e9bc711 100644 --- a/addons/survey/i18n/survey.pot +++ b/addons/survey/i18n/survey.pot @@ -1490,54 +1490,6 @@ msgstr "" msgid "Survey Answers" msgstr "" -#. module: survey -#: code:addons/survey/report/survey_browse_response.py:70 -#, python-format -msgid "Page : " -msgstr "" - -#. module: survey -#: code:addons/survey/report/survey_browse_response.py:210 -#, python-format -msgid "Print Date : " -msgstr "" - -#. module: survey -#: code:addons/survey/report/survey_browse_response.py:213 -#, python-format -msgid "Answered by : " -msgstr "" - -#. module: survey -#: code:addons/survey/report/survey_browse_response.py:220 -#, python-format -msgid "Answer Date : " -msgstr "" - -#. module: survey -#: code:addons/survey/report/survey_browse_response.py:225 -#, python-format -msgid "Not Finished" -msgstr "" - -#. module: survey -#: code:addons/survey/report/survey_browse_response.py:226 -#, python-format -msgid "Finished" -msgstr "" - -#. module: survey -#: code:addons/survey/report/survey_browse_response.py:232 -#, python-format -msgid "Status :- " -msgstr "" - -#. module: survey -#: code:addons/survey/report/survey_browse_response.py:243 -#, python-format -msgid "Page :- " -msgstr "" - #. module: survey #: model:ir.ui.menu,name:survey.menu_print_survey_answer msgid "Surveys Answers" @@ -1644,48 +1596,6 @@ msgstr "" msgid "Warning!" msgstr "" -#. module: survey -#: code:addons/survey/wizard/survey_answer.py:392 -#, python-format -msgid "Exit" -msgstr "" - -#. module: survey -#: code:addons/survey/wizard/survey_answer.py:376 -#, python-format -msgid "Next" -msgstr "" - -#. module: survey -#: code:addons/survey/wizard/survey_answer.py:222 -#, python-format -msgid "Answer" -msgstr "" - -#. module: survey -#: code:addons/survey/wizard/survey_answer.py:174 -#, python-format -msgid "Answer Of :- " -msgstr "" - -#. module: survey -#: code:addons/survey/wizard/survey_answer.py:174 -#, python-format -msgid ", Date :- " -msgstr "" - -#. module: survey -#: code:addons/survey/wizard/survey_answer.py:175 -#, python-format -msgid " Answer :- " -msgstr "" - -#. module: survey -#: code:addons/survey/wizard/survey_answer.py:375 -#, python-format -msgid "Previous" -msgstr "" - #. module: survey #: code:addons/survey/survey.py:465 #, python-format