[z3-five] Re: First steps cont'd - i18n with Five 1.1b
Philipp von Weitershausen
philipp at weitershausen.de
Thu Jul 21 23:02:06 CEST 2005
David Pratt wrote:
> I have got everything installed in my CMF. My index_html now gives me
> the following traceback. So went back and read i18.txt and sure enough
> I will need a configure.zcml to correct this. So I put the following
> line in CMFDefault's configure.zcml (since it had one) at its base:
>
> <i18n:registerTranslations directory="locales" />
>
> added a locales directory, made an en folder in locales and added a
> cmf_default.po (just copied and renamed it from Sfive's .po) and used
> msgfmt to make cmf_default.mo
You need your 'locales' directory to look exactly like Sfive's one
(locales/<lang>/LC_MESSAGES/<domain>.mo).
> but I still get the error so its obviously not happy about translation
> support. I have PTS installed but don't want to use it. What should i
> try next?
Run Five/browser/tests/pts_test_languages.py and see whether it passes...
As for debugging, I think testing a problem in the simplest environment
you can think of is always a good idea. Then complicate the setup until
you see where the erronous component comes in.
If you want to spend some time on debugging, I suggest you take out PTS
for a moment and use zopectl debug to test whether translation works at
all (use the zope.i18n.translate function at the interpreter prompt; see
the doctests in Five (tests/test_i18n.py) for an example of how it
works). Now test translation with a *simple* ZPT (no macros, no other
stuff, just one line with an i18n:translate="" in it; see
Five/browser/tests/pts_test_languages.pt for example). If all that works
and it doesn't when you add PTS back in, I'd like to know where the
problem is.
> # Module TAL.TALInterpreter, line 190, in __call__
> # Module TAL.TALInterpreter, line 234, in interpret
> # Module TAL.TALInterpreter, line 671, in do_useMacro
> # Module TAL.TALInterpreter, line 234, in interpret
> # Module TAL.TALInterpreter, line 409, in do_optTag_tal
> # Module TAL.TALInterpreter, line 394, in do_optTag
> # Module TAL.TALInterpreter, line 389, in no_tag
> # Module TAL.TALInterpreter, line 234, in interpret
> # Module TAL.TALInterpreter, line 650, in do_defineMacro
> # Module TAL.TALInterpreter, line 234, in interpret
> # Module TAL.TALInterpreter, line 613, in do_loop_tal
> # Module TAL.TALInterpreter, line 234, in interpret
> # Module TAL.TALInterpreter, line 407, in do_optTag_tal
> # Module TAL.TALInterpreter, line 389, in no_tag
> # Module TAL.TALInterpreter, line 234, in interpret
> # Module TAL.TALInterpreter, line 560, in do_insertTranslation
> # Module TAL.TALInterpreter, line 623, in translate
> # Module Products.PageTemplates.TALES, line 261, in translate
> # Module Products.Five.i18n, line 39, in translate
> # Module zope.component, line 79, in queryUtility
> # Module zope.component, line 68, in getService
> # Module zope.component.service, line 109, in getService
That isn't the full traceback. The actual error is missing. That makes
it hard for us to actually see at what it fails.
Regards
Philipp
More information about the z3-five
mailing list