Commit c1a8de7c authored by Yoshinori Okuji's avatar Yoshinori Okuji

Make sure that translated messages are encoded in unicode.

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@8085 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 32d230e1
...@@ -2035,22 +2035,22 @@ class ListBoxHTMLRenderer(ListBoxRenderer): ...@@ -2035,22 +2035,22 @@ class ListBoxHTMLRenderer(ListBoxRenderer):
list_action = self.getListActionUrl(), list_action = self.getListActionUrl(),
selection_name = self.getSelectionName(), selection_name = self.getSelectionName(),
field_id = self.getId(), field_id = self.getId(),
field_title = Message(domain = ui_domain, message = self.getTitle()), field_title = unicode(Message(domain = ui_domain, message = self.getTitle())),
record_number = Message(domain = ui_domain, message = '${number} record(s)', record_number = unicode(Message(domain = ui_domain, message = '${number} record(s)',
mapping = dict(number = str(self.total_size))), mapping = dict(number = str(self.total_size)))),
item_number = Message(domain = ui_domain, message = '${number} item(s) selected', item_number = unicode(Message(domain = ui_domain, message = '${number} item(s) selected',
mapping = dict(number = str(len(self.getCheckedUidList())))), mapping = dict(number = str(len(self.getCheckedUidList()))))),
flat_list_title = Message(domain = ui_domain, message = 'Flat List'), flat_list_title = unicode(Message(domain = ui_domain, message = 'Flat List')),
report_tree_title = Message(domain = ui_domain, message = 'Report Tree'), report_tree_title = unicode(Message(domain = ui_domain, message = 'Report Tree')),
domain_tree_title = Message(domain = ui_domain, message = 'Domain Tree'), domain_tree_title = unicode(Message(domain = ui_domain, message = 'Domain Tree')),
change_page_title = Message(domain = ui_domain, message = 'Change Page'), change_page_title = unicode(Message(domain = ui_domain, message = 'Change Page')),
previous_page_title = Message(domain = ui_domain, message = 'Previous Page'), previous_page_title = unicode(Message(domain = ui_domain, message = 'Previous Page')),
next_page_title = Message(domain = ui_domain, message = 'Next Page'), next_page_title = unicode(Message(domain = ui_domain, message = 'Next Page')),
check_all_title = Message(domain = ui_domain, message = 'Check All'), check_all_title = unicode(Message(domain = ui_domain, message = 'Check All')),
uncheck_all_title = Message(domain = ui_domain, message = 'Uncheck All'), uncheck_all_title = unicode(Message(domain = ui_domain, message = 'Uncheck All')),
ascending_display_title = Message(domain = ui_domain, message = 'Ascending Display'), ascending_display_title = unicode(Message(domain = ui_domain, message = 'Ascending Display')),
descending_display_title = Message(domain = ui_domain, message = 'Descending Display'), descending_display_title = unicode(Message(domain = ui_domain, message = 'Descending Display')),
action_title = Message(domain = ui_domain, message = 'Action'), action_title = unicode(Message(domain = ui_domain, message = 'Action')),
context_url = self.getContext().getUrl()) context_url = self.getContext().getUrl())
# This is the start of HTML. Embed a selection name. # This is the start of HTML. Embed a selection name.
...@@ -2084,7 +2084,7 @@ class ListBoxHTMLRenderer(ListBoxRenderer): ...@@ -2084,7 +2084,7 @@ class ListBoxHTMLRenderer(ListBoxRenderer):
html_list.append("""\ html_list.append("""\
<option %s value="%s">%s</option> <option %s value="%s">%s</option>
""" % (selected, c[0], Message(domain = ui_domain, message = c[1]))) """ % (selected, c[0], unicode(Message(domain = ui_domain, message = c[1]))))
html_list.append("""\ html_list.append("""\
</select> </select>
...@@ -2186,8 +2186,8 @@ class ListBoxHTMLRenderer(ListBoxRenderer): ...@@ -2186,8 +2186,8 @@ class ListBoxHTMLRenderer(ListBoxRenderer):
html_list.append("""\ html_list.append("""\
<option %s value="%d">%s</option> <option %s value="%d">%s</option>
""" % (selected, p * self.getMaxLineNumber(), """ % (selected, p * self.getMaxLineNumber(),
Message(domain = ui_domain, message = '${page} of ${total_pages}', unicode(Message(domain = ui_domain, message = '${page} of ${total_pages}',
mapping = dict(page = p + 1, total_pages = self.total_pages)))) mapping = dict(page = p + 1, total_pages = self.total_pages)))))
html_list.append("""\ html_list.append("""\
</select> </select>
...@@ -2260,7 +2260,7 @@ class ListBoxHTMLRenderer(ListBoxRenderer): ...@@ -2260,7 +2260,7 @@ class ListBoxHTMLRenderer(ListBoxRenderer):
if c[0] in sort_column_id_set: if c[0] in sort_column_id_set:
html_list.append("""\ html_list.append("""\
<a href="portal_selections/setSelectionQuickSortOrder?selection_name=%s&sort_on=%s">%s</a>\ <a href="portal_selections/setSelectionQuickSortOrder?selection_name=%s&sort_on=%s">%s</a>\
""" % (self.getSelectionName(), c[0], Message(domain = ui_domain, message = c[1]))) """ % (self.getSelectionName(), c[0], unicode(Message(domain = ui_domain, message = c[1]))))
try: try:
if sort_dict[c[0]] == 'ascending': if sort_dict[c[0]] == 'ascending':
...@@ -2274,7 +2274,7 @@ class ListBoxHTMLRenderer(ListBoxRenderer): ...@@ -2274,7 +2274,7 @@ class ListBoxHTMLRenderer(ListBoxRenderer):
except KeyError: except KeyError:
pass pass
else: else:
html_list.append('%s' % (Message(domain = ui_domain, message = c[1]),)) html_list.append('%s' % (unicode(Message(domain = ui_domain, message = c[1]),)))
html_list.append("""\ html_list.append("""\
</td> </td>
...@@ -2317,7 +2317,7 @@ class ListBoxHTMLRenderer(ListBoxRenderer): ...@@ -2317,7 +2317,7 @@ class ListBoxHTMLRenderer(ListBoxRenderer):
&nbsp;-&nbsp;<a href="%s?selection_name=%s&selection_index=%s&is_report_opened:int=%d">%s</a>\ &nbsp;-&nbsp;<a href="%s?selection_name=%s&selection_index=%s&is_report_opened:int=%d">%s</a>\
""" % (self.getUrl(), self.getRequestedSelectionName(), self.getSelectionIndex(), """ % (self.getUrl(), self.getRequestedSelectionName(), self.getSelectionIndex(),
not is_report_opened, not is_report_opened,
Message(domain = ui_domain, message = is_report_opened and 'Hide' or 'Show'))) unicode(Message(domain = ui_domain, message = is_report_opened and 'Hide' or 'Show'))))
html_list.append("""\ html_list.append("""\
</td> </td>
...@@ -2395,7 +2395,7 @@ class ListBoxHTMLRenderer(ListBoxRenderer): ...@@ -2395,7 +2395,7 @@ class ListBoxHTMLRenderer(ListBoxRenderer):
if self.isReportTreeMode(): if self.isReportTreeMode():
# Get the title or the id of the context. # Get the title or the id of the context.
if line.getContext() is not None: if line.getContext() is not None:
section_name = str(Message(domain = context_domain, message = line.getContext().getTitleOrId())) section_name = unicode(Message(domain = context_domain, message = line.getContext().getTitleOrId()))
else: else:
section_name = '' section_name = ''
......
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