[Zope] Announce: ZBabel a Translation Assistant for Zope

Andrew Kenneth Milton akm@mail.theinternet.com.au
Wed, 19 Jul 2000 11:29:29 +1000 (EST)


+----[ Albert Langer ]---------------------------------------------
[Charset iso-8859-1 unsupported, filtering to ASCII...]
| [Andrew]
| Yes you can embed DTML inside the block and it will resolve all of the
| DTML before translating the result. You can turn this behaviour off.
| This is why I opted for a container tag, rather than a simple tag.
| 
| [Albert]
| That is what I am still not clear on. Noticed the container, but still
| confused about "literal" and about "before", "after", "off" and "on".
| 
| Suppose web site in source language has something like this:
| 
| 'Click <A href="{fieldX(someVar.A)}">here</A>, for {fieldY(someVar.B)}'
| 
| With suitably horrific DTML instead of ' ' and {}.
| 
| Rendered english result would be, for some particular dynamic instance of
| someVar:
| 
| 'Click <A href="http://www.zope.org/">here</A> for Zope'
| 
| Translator for language X decides to reverse the positions of fieldA and
| fieldB and use 3 separate substrings, because it is too abrupt for that
| language, so translates to something like:
| 
| 'If you would like {fieldY(someVar.B)}, click <A
| href="{fieldX(someVar.A)}">this link</A>, please'

Aha! This is not translation d8) This is re-wording and then translating,
which is a bit of fine hair splitting I know. If you reached a point
where something couldn't be translated, you would have to revisit the source.

| There are now 3 substrings in the translation because it would be rude not
| to start or end with something like "please" in language X, and it reads
| better with the fields reversed in that language.
| 
| Final rendered result becomes (in language X):
| 
| 'If you would like Zope, click <A href="http://www.zope.org/">this link</A>,
| please'
| 
| depending on the particular value of someVar at the time.
| 
| Does ZBabel allow this? If so, that's *exactly* what I was hoping for.


I think it does what you want to do...

<dtml-babel src="langA" dst="langX"><dtml-var GreetAndLink></dtml-babel>

GreetAndLink...
Click <a href="&dtml-langXUrl;"> For <dtml-var AJollyRogering>


You would end up with the following to be translated:-

Click <a href="the.langx.url"> For a good langX clicking

So you would end up with a phrase that would be partially
translated ready for translating because your langXUrl and
AJollyRogering already do some localisation.

However if langXUrl and AJollyRogering are dynamic you should probably 
not wrap them in <dtml-babel> tags.

| [Andrew]
| I have another project on my TO DO list which is a dynamic components
| product which this would integrate well with.
| 
| Any "Form Generation" products would probably be able to integrate
| the same stuff as well fairly easily.
| 
| It is rather intrusive I know, but, there are few if any options that
| don't require massive amounts of effort to achieve the same thing.
| Especially building the catalogs. I know of another ASP based system
| that's pretty much the same as this, but, they have to go through
| and change the source code after translating (they have to provide a
| dummy 'phrase id' which is then altered). It is really really ugly.
| 
| [Albert]
| The lack of a dummy "phrase id" is what I thought was really great about
| your approach. Thanks!
| 
| I regard HTML/DTML as possibly avoidable clutter in the same way that a
| "phrase id" is.
| 
| If ZBabel already does what I asked above, my question about something
| closer to Zwiki structured text might be more clear in terms of wondering
| whether anything can be done to hide the HTML/DTML tagging and field coding
| from the translator by giving them some sort of template like this:
| 
| 'Click [here] for {Zope}'
| 
| So that they would translate it to:
| 
| 'If you would like {Zope} click [this link[here]], please'
| 
| Note that the two original substrings of ordinary text AND the [bracketed]
| text all denote elements to be translated, while the text in {braces} does
| not, but is sample data visible in the UI as a prototype example for the
| translator.

You can do this by nesting <dtml-babel> calls...

<dtml-babel><dtml-babel>Click here</dtml-babel> <dtml-babel>for Zope</dtml-babel></dtml-babel>

Would yield the following to be translated:-
o Click here
o for Zope
o Click here for Zope

| Then the magic which extracted the HTML (and DTML) tagging and field names
| etc to give the translator something more understandable, would just stick
| it back in, replacing "here" with "this link", but ALSO restoring the
| surrounding DTML/HTML for that element and for the {Zope} element, in much
| the same way that you already do not need a "phrase id" but work directly
| with the text. Translators understand prototypes much more easily than they
| understand web pages.
| 
| (Also useful for content managers cf HTML/DTML designers and convenient for
| HTML/DTML designers too ;-).
| 
| Any possibility of doing that automatically? By clicking "generate
| template", a web developer might be able to generate simplified template
| strings like above for the translator, using a sample prototype from actual
| data. Then, when the translator has processed it, a web developer or content
| manager could just click "import translation".
| 
| Otherwise either the web developer might still need to generate such
| prototypes manually to make life easier for translators, or the translators
| need to understand some HTML/DTML as well as understanding translation.

This is another project... d8)

-- 
Totally Holistic Enterprises Internet|  P:+61 7 3870 0066   | Andrew Milton
The Internet (Aust) Pty Ltd          |  F:+61 7 3870 4477   | 
ACN: 082 081 472 ABN: 83 082 081 472 |  M:+61 416 022 411   | Carpe Daemon
PO Box 837 Indooroopilly QLD 4068    |akm@theinternet.com.au|