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 d2390bc6225..aa7f199367b 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()