W3C home > Mailing lists > Public > www-forms@w3.org > July 2006

Re: i18n, componentized forms and multiple models

From: Erik Bruchez <ebruchez@orbeon.com>
Date: Mon, 24 Jul 2006 16:29:07 +0200
Message-ID: <44C4D933.80207@orbeon.com>
To: www-forms@w3.org


 > I'm testing the form on both Orbeon's Presentation Server (current
 > release) along with Mozilla XForms 0.5 (0.6 said it had an invalid
 > checksum and wouldn't install for me) in case it matters.  I don't
 > really think it does, because one of the points in Dubinko's book
 > was "options for cross-model communication are limited."
 > Unfortunately, I can't find much on what those options are.  I
 > suppose I could resort to using some JavaScript to solve the
 > problem, but I would really rather not do it that way.

If you download the latest OPS nightly build [1], go to the DMV Forms
example, and open a form, you will see there what I think is a really
cool illustration of i18n with a dropdown allowing you to switch at
runtime between English and French resources (he he, this is not
something you see often, to say the least, and XForms makes it a
breeze to achieve).

As suggested by others, simply load your initial resources into an
instance (alternatively, you can run a submission upon xforms-ready):

   <xforms:instance id="resources-instance" src="resources_en.xml"/>

There is another instance holding the current language:

   <xforms:instance id="language-instance">
       <language xmlns="">en</language>

There is an xforms:select1 to change the language:

   <xforms:select1 ref="instance('language-instance')">
       <xforms:send ev:event="xforms-value-changed" 

which runs a submision that updates the resources:

   <xforms:submission id="update-language-submission" 
           action="/forms/service/resources/{.}" validate="false"
           method="get" replace="instance" instance="resources-instance"/>

All the internationalized resources in the page are referred to with 
things like:

   <xforms:output ref="instance('control-instance')/message"/>

This is much more flexible than to hardcode xml:lang in the page, and
it works like a charm.

I hope this helps,


[1] http://forge.objectweb.org/nightlybuilds/ops/ops/

Orbeon - XForms Everywhere:
Received on Monday, 24 July 2006 14:29:13 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 6 January 2015 21:36:18 UTC