Re: Striping out html tags from translation string?
Stephan Richter <[email protected]>
| Newsgroups | gmane.comp.web.zope.internationalization |
|---|---|
| Organization | Web2k |
| Message-ID | <[email protected]> |
On Friday 30 April 2004 13:55, Josef Albert Meile wrote:
> Hi,
>
> I'm playing with the i18n stuff and I have succeed with some things, but
> now I have a particular problem. Suppose that you want to translate this:
>
> <div i18n:translate="" i18n:domain="JMGeneric">optional fields are written
> in <i>italic</i></div>
>
> I added the following string to my message catalogs:
> "optional fields are written in italic"
>
> But the translation didn't succeed because of the <i></i> tags, which I
> don't want to add the my message catalog.
>
> I know you could also have mappings:
> "optional fields are written in ${tag1}italic${tag2}"
>
> but it is even more complicated than just including <i>...</i>
> Is it possible to strip the html characters when sending the string to the
> i18n workspace? I think it would be usefull when translated long html
> formated texts.
I think this is technically not possible. All apps I have seen leave the
markup in the translatable strings. Do you have any suggestions how to do it?
Clearly, just stripping does not work; you would need placeholders for it;
But then the translator sees this markup. What is better: a Zope-specific
markup or standard HTML tags?
For more complex cases I would play around with i18n:name till you find a
satisfactory splitup of the translation.
Regards,
Stephan
--
Stephan Richter
CBU Physics & Chemistry (B.S.) / Tufts Physics (Ph.D. student)
Web2k - Web Software Design, Development and Training