forrest-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Konstantin Piroumian" <kpiroum...@apache.org>
Subject Re: Multilingual sites
Date Fri, 14 Jun 2002 11:19:38 GMT
From: "Sylvain Wallez" <sylvain.wallez@anyware-tech.com>
> Konstantin Piroumian wrote:
> >From: "Sylvain Wallez" <sylvain.wallez@anyware-tech.com>
> >
> >>Hi forresters,
> >>
> >>I'm currently considering the use of Forrest to rebuild the static part
> >>of my company's website. However, our site needs to be multilingual (at
> >>least french and english), and I'd like to share some thoughts and have
> >>your opinion.
> >>
> >>An important hypothesis is that the site will provide the same content
> >>for all languages. So my idea is to have each xdoc file contain the same
> >>content in the different languages in order to both ease translation
> >>work and ensure structural consistency.
> >>
> >>
> >
> >Why not to use i18n transformer and have translations in separate
dictionary
> >files? How would having all translations in content ease the translation
> >work? Your translators should go through all the xdocs and duplicate all
the
> >elements. And how would you translate attributes (sometimes you'll need
it
> >too)?
> >
> >
>
> I use a lot i18n transformer, but for data-oriented pages which contain
> text elements that do not constitute a document (button, form input
> labels, table column title, error messages, etc).
>
> >Of course, if the number of pages is not big then your approach is Ok,
but I
> >wouldn't recommend to mix translations and the content.
> >
> >
>
> But translations *are* the content !
>

One small problem with the below snippet: how would you validate your
content against the DTD that permits only one title element? I don't know
how XML specification interpret elements with xml:lang attribute.

> >>Here's an example :
> >><document>
> >>  <section>
> >>    <title xml:lang="en">A multilingual document</title>
> >>    <title xml:lang="fr">Un site multilingue</title>
> >>    <p xml:lang="en">Here's a paragraph</p>
> >>    <p xml:lang="fr">Voici un paragraphe</p>
> >>  <section>
> >></document>
> >>
> >>
> >
> >i18n transformer version of the same doc:
> >
> ><document>
> >  <section>
> >    <title><i18n:text>A multilingual document</i18n:text></title>
> >    <p><i18n:text>Here's a paragraph</i18n:text></p>
> >  <section>
> ></document>
> >
> >Note, that you can use shorter keys instead of the text itself.
> >
> >
>
> That's exacly what I'd like to avoid : the document structure is defined
> in one place, and the text in another one. Maintaining documents this
> way seems very difficult to me.

Yes, maybe you are right. I won't argue much, cause I myslef usually advise
to use i18n transformer for things that you've mentioned above (forms, error
messages, labels) and use something else for large texts and information
based sites ;)

>
> >>Note that the above couldn't have been possible with the section title
> >>as an attribute (referring to the recent vote on this).
> >>
> >>
> >
> >It could be translated by the i18n transformer, though:
> ><section title="mydoc.title" i18n:attr="title">...</section>
> >
> >
>
> Granted. But there were some comments (from Stefano, IIRC) during the
> vote explaining that titles can contain inline elements. Moreover, I
> don't think it's good to have text that gets displayed to the user
> modelled as attributes (dico keys are perfectly ok, however).

You could adjust your page layout using some translated attributes depending
on the language, but I don't think that something like that would be needed
for English/French site (no long words as in German, no right-to-left
direction as in Arabic, etc.).

>
> >>Building the site for a particular language will then be a simple matter
> >>of filtering elements belonging to that language before formatting by a
> >>language-agnostic skin.
> >>
> >>
> >
> >Yes, quite simple. I have to think if such functionality will be useful
in
> >i18n transformer too.
> >
> >
> >
> >>Any comments and criticisms are welcome.
> >>
> >>
> >
> >Just take a look at i18n samples and please tell me if it suits your
needs
> >or your still prefer your approach. If you choose my version than I have
a
> >new more advanced implementation of i18n transformer that I have no time
to
> >test a little more and commit.
> >
> >
>
> As said above I18n transformer seems to me more suited to small
> autonomous text snippets that also can be reused in several places (e.g.
> translation of the "Cancel" button label), but inadequate to documents
> where each block appears only once.

The mentioned above 'advanced' implementation of the transformer has inline
translations capability that could be used instead, but I like the xml:lang
syntax more, so have to think a little would it be better to change i18n
transformer to act as a filter or leave it as is and wait for your filtering
transformer.

What do you think, if one will need current i18n transformer features and
filtering based on xml:lang at the same time?

Konstantin

>
> Sylvain
>
> --
> Sylvain Wallez
>   Anyware Technologies                  Apache Cocoon
>   http://www.anyware-tech.com           mailto:sylvain@apache.org
>
>
>


Mime
View raw message