Commit 35b0400d authored by Kazuhiko Shiozaki's avatar Kazuhiko Shiozaki

make ERP5Site_getToBeTranslatedMessageListFromEntireSystemAsPot working on Zope-2.12 too.

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@42600 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 0cf7249e
...@@ -53,10 +53,16 @@ def getActionTitleListFromAllActionProvider(portal): ...@@ -53,10 +53,16 @@ def getActionTitleListFromAllActionProvider(portal):
from StringIO import StringIO from StringIO import StringIO
from TAL.HTMLTALParser import HTMLTALParser try:
from TAL.TALParser import TALParser from TAL.HTMLTALParser import HTMLTALParser
from TAL.TALGenerator import TALGenerator from TAL.TALParser import TALParser
from TAL.DummyEngine import name_match from TAL.TALGenerator import TALGenerator
from TAL.DummyEngine import name_match
except ImportError:
from zope.tal.htmltalparser import HTMLTALParser
from zope.tal.talparser import TALParser
from zope.tal.talgenerator import TALGenerator
from zope.tal.dummyengine import name_match
def findStaticTranslationText(page_template, func_name_list): def findStaticTranslationText(page_template, func_name_list):
def iterate(node, target_name, function): def iterate(node, target_name, function):
if type(node) is list: if type(node) is list:
...@@ -125,8 +131,12 @@ def findStaticTranslationText(page_template, func_name_list): ...@@ -125,8 +131,12 @@ def findStaticTranslationText(page_template, func_name_list):
# #
# Utility class for findStaticTranslationText # Utility class for findStaticTranslationText
# #
from TAL.TALInterpreter import TALInterpreter try:
from TAL.DummyEngine import DummyEngine from TAL.TALInterpreter import TALInterpreter
from TAL.DummyEngine import DummyEngine
except ImportError:
from zope.tal.talinterpreter import TALInterpreter
from zope.tal.dummyengine import DummyEngine
class MyDummyEngine(DummyEngine): class MyDummyEngine(DummyEngine):
def evaluate(self, expression): def evaluate(self, expression):
...@@ -138,7 +148,7 @@ class MyDummyTALInterpreter(TALInterpreter): ...@@ -138,7 +148,7 @@ class MyDummyTALInterpreter(TALInterpreter):
_i18n_message_id_dict = None _i18n_message_id_dict = None
_currentTag = None _currentTag = None
def translate(self, msgid, default, i18ndict, obj): def translate(self, msgid, default=None, i18ndict=None, obj=None):
try: try:
self._i18n_message_id_dict[msgid] = None self._i18n_message_id_dict[msgid] = None
except TypeError: except TypeError:
......
638 639
\ No newline at end of file \ No newline at end of file
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