Commit 6b7ff67d authored by Jérome Perrin's avatar Jérome Perrin

ods_style: simplify translations and unicode usage

Page templates have a builtin translation system (with i18n:) and an
"unicode conflict resolver", so it was not necessary to explicitly
convert to unicode on python2 and this simplifies the transition to
python3
parent af95e7b3
......@@ -18,7 +18,7 @@
table:style-name='report-column-title'
table:number-columns-spanned='1'
office:value-type='string'>
<text:p tal:content="python:here.Localizer.erp5_ui.gettext(field.get_value('title')).encode('utf-8')">
<text:p tal:content="python: field.get_value('title')" i18n:translate="">
</text:p>
</table:table-cell>
</table:table-row>
......@@ -51,7 +51,7 @@
table:style-name='report-column-title'
table:number-columns-spanned='1'
office:value-type='string'>
<text:p tal:content="python:here.Localizer.erp5_ui.gettext(field.get_value('title')).encode('utf-8')">
<text:p tal:content="python: field.get_value('title')" i18n:translate="">
</text:p>
</table:table-cell>
</tal:block>
......
......@@ -2,7 +2,7 @@
<tal:block metal:use-macro="here/style_macros/macros/style_macro"/>
<office:body>
<office:spreadsheet>
<table:table table:style-name='ta1' table:print='false' tal:attributes="table:name python: unicode(here.getTitle(), 'utf-8')" i18n:attributes="table:name">
<table:table table:style-name='ta1' table:print='false' tal:attributes="table:name here/getTitle" i18n:attributes="table:name">
<!-- at least one table-column element is required for ODF to validate -->
<table:table-column
......@@ -22,7 +22,7 @@
<table:table-row table:style-name='ro2'>
<table:table-cell table:style-name='report-column-title'
office:value-type='string'>
<text:p tal:content="python:here.Localizer.erp5_ui.gettext(field.get_value ('title')).encode('utf-8')">
<text:p tal:content="python: field.get_value('title')" i18n:translate="">
</text:p>
</table:table-cell>
<tal:block tal:define="display python: field.get_value('image_display') "
......
......@@ -42,7 +42,7 @@
<tal:block tal:condition="python: is_report_tree_mode">
<table:table-cell table:style-name='report-column-title' table:number-columns-spanned='1' office:value-type='string' >
<tal:block tal:condition="listboxline/getSectionName">
<text:p tal:content="python: here.Localizer.erp5_ui.gettext(listboxline.getSectionName()).encode('utf-8')"/>
<text:p tal:content="listboxline/getSectionName" i18n:translate=""/>
</tal:block>
</table:table-cell>
</tal:block>
......
......@@ -20,7 +20,7 @@
</tal:block>
<tal:block tal:define="portal_object here/getPortalObject">
<tal:block tal:condition="not: sheet_per_report_section">
<table:table tal:attributes="table:name python:unicode(form.getProperty('title'), 'utf8')" i18n:attributes="table:name">
<table:table tal:attributes="table:name python: form.getProperty('title')" i18n:attributes="table:name">
<!-- at least one table-column element is required for ODF to validate -->
<table:table-column
table:style-name='co2'
......@@ -32,7 +32,7 @@
office:value-type='string'
table:number-columns-spanned='5'
table:number-rows-spanned='1'>
<text:p i18n:translate="" tal:content="python: unicode(form.getProperty('title'), 'utf8')" ></text:p>
<text:p i18n:translate="" tal:content="python: form.getProperty('title')" ></text:p>
</table:table-cell>
</table:table-row>
......@@ -95,7 +95,7 @@
<tal:block tal:condition="rendered_report_item_list">
<tal:block tal:repeat="report_item report_item_list">
<!-- FIXME: in deferred mode + sheet_per_report_section we do not have title -->
<table:table tal:attributes="table:name python: unicode('Sheet%s' % repeat['report_item'].index, 'utf-8')">
<table:table tal:attributes="table:name python:'Sheet%s' % repeat['report_item'].index">
<table:table-column table:style-name="co4" table:default-cell-style-name="text"/>
<tal:block tal:replace="structure report_item"/>
</table:table>
......@@ -105,7 +105,7 @@
<tal:block tal:condition="not: rendered_report_item_list">
<tal:block tal:repeat="report_item python: report_item_list">
<tal:block tal:condition="python: report_item.getFormId()">
<table:table tal:attributes="table:name python: unicode(report_item.getTitle() or 'Sheet%s' % repeat['report_item'].index, 'utf-8')">
<table:table tal:attributes="table:name python: report_item.getTitle() or 'Sheet%s' % repeat['report_item'].index">
<table:table-column table:style-name="co4" table:default-cell-style-name="text"/>
<tal:block metal:use-macro="here/report_view/macros/make_report_item_table"/>
</table:table>
......@@ -116,7 +116,7 @@
<!-- include the report header as last page -->
<table:table tal:condition="python: [field for field in form.get_fields()
if field.getRecursiveTemplateField().meta_type != 'ReportBox']"
tal:attributes="table:name python:unicode(form.getProperty('title'), 'utf8')" i18n:attributes="table:name">
tal:attributes="table:name python:form.getProperty('title')" i18n:attributes="table:name">
<table:table-column
table:style-name='co2'
table:number-columns-repeated='100'
......@@ -126,7 +126,7 @@
office:value-type='string'
table:number-columns-spanned='5'
table:number-rows-spanned='1'>
<text:p i18n:translate="" tal:content="python: unicode(form.getProperty('title'), 'utf8')" ></text:p>
<text:p i18n:translate="" tal:content="python:form.getProperty('title')" ></text:p>
</table:table-cell>
</table:table-row>
<!-- fields from the report form itself -->
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment