Dear Orbeon Community,
I am evaluating Orbeon and currently trying to find out how to handle l10n. I know that I can: - statically configure formatting app-wide using properties-xforms.xml - including localized, static text using xforms instances for the resources What I want to do is to configure l10n at runtime and per servlet session (the one from properties-xforms.xml)... btw, I am working in a separate deployment scenario with my XForm included (jsp:include) inside a JSP application How I think it should work: - user logs in and chooses his locale (in JSP) - JSP puts some "locale" attribute inside the servlet session / sets the locale and or formatting for Orbeon programmatically for this servlet session - Orbeon should now render the XForm in the user's locale This way I would not have to consider the users locale in my XForms... Thanks! Baschir -- You receive this message as a subscriber of the [hidden email] mailing list. To unsubscribe: mailto:[hidden email] For general help: mailto:[hidden email]?subject=help OW2 mailing lists service home page: http://www.ow2.org/wws |
Baschir,
Form Runner does something like this already: you can switch locale from the UI, and that is stored into the user's session and picked as default the next time the user loads a page. There is no persistence of that preference yet but that could be added. Form runner reads the locale (in fact here just the language) preference into an instance, and then uses that instance to load the resources specific to that locale (e.g. "en" or "fr"). All localizable resources in the form point to that resources instance. I can't say that this is trivial but not so bad either. Here is the model Form Runner uses: http://github.com/orbeon/orbeon-forms/blob/master/src/resources/apps/fr/i18n/resources-model.xml -Erik On Thu, Sep 10, 2009 at 5:00 AM, Baschir Jaghoori <[hidden email]> wrote: > Dear Orbeon Community, > > I am evaluating Orbeon and currently trying to find out how to handle l10n. > I know that I can: > - statically configure formatting app-wide using properties-xforms.xml > - including localized, static text using xforms instances for the resources > > What I want to do is to configure l10n at runtime and per servlet session > (the one from properties-xforms.xml)... > > btw, I am working in a separate deployment scenario with my XForm included > (jsp:include) inside a JSP application > > How I think it should work: > - user logs in and chooses his locale (in JSP) > - JSP puts some "locale" attribute inside the servlet session / sets the > locale and or formatting for Orbeon programmatically for this servlet > session > - Orbeon should now render the XForm in the user's locale > > This way I would not have to consider the users locale in my XForms... > > > Thanks! > Baschir > > > -- > You receive this message as a subscriber of the [hidden email] mailing > list. > To unsubscribe: mailto:[hidden email] > For general help: mailto:[hidden email]?subject=help > OW2 mailing lists service home page: http://www.ow2.org/wws > > -- You receive this message as a subscriber of the [hidden email] mailing list. To unsubscribe: mailto:[hidden email] For general help: mailto:[hidden email]?subject=help OW2 mailing lists service home page: http://www.ow2.org/wws |
Many thanks for the tip with form runner, Erik.
In the mean time I chose the following approach for i18n resources (see below). My goal was to minimize i18n specific code in my XForms. Btw: Currently, one problem remains: The YUI calendar reads the locale from <html xml:lang=".."> - which conflicts with my servlet session approach - Is there something I can do about that? I don't want to create / generate different XForms for each locale... Here is what I did: 1. Define an instance for resources: <xf:instance id="resources" src="resourcesForLanguage.jsp" /> resourcesForLanguage.jsp reads the locale from the servlet session (defined somewhere in our application) and returns the respective resource XML for that language. 2. bind the resource instance to a variable: <xxf:variable name="resources" select="instance('resources')" /> 3. use the resources: <xf:output value="$resources/title" /> Thanks again Baschir Erik Bruchez schrieb: > Baschir, > > Form Runner does something like this already: you can switch locale > from the UI, and that is stored into the user's session and picked as > default the next time the user loads a page. There is no persistence > of that preference yet but that could be added. > > Form runner reads the locale (in fact here just the language) > preference into an instance, and then uses that instance to load the > resources specific to that locale (e.g. "en" or "fr"). All localizable > resources in the form point to that resources instance. > > I can't say that this is trivial but not so bad either. Here is the > model Form Runner uses: > > http://github.com/orbeon/orbeon-forms/blob/master/src/resources/apps/fr/i18n/resources-model.xml > > -Erik > > On Thu, Sep 10, 2009 at 5:00 AM, Baschir Jaghoori > <[hidden email]> wrote: >> Dear Orbeon Community, >> >> I am evaluating Orbeon and currently trying to find out how to handle l10n. >> I know that I can: >> - statically configure formatting app-wide using properties-xforms.xml >> - including localized, static text using xforms instances for the resources >> >> What I want to do is to configure l10n at runtime and per servlet session >> (the one from properties-xforms.xml)... >> >> btw, I am working in a separate deployment scenario with my XForm included >> (jsp:include) inside a JSP application >> >> How I think it should work: >> - user logs in and chooses his locale (in JSP) >> - JSP puts some "locale" attribute inside the servlet session / sets the >> locale and or formatting for Orbeon programmatically for this servlet >> session >> - Orbeon should now render the XForm in the user's locale >> >> This way I would not have to consider the users locale in my XForms... >> >> >> Thanks! >> Baschir >> >> >> -- >> You receive this message as a subscriber of the [hidden email] mailing >> list. >> To unsubscribe: mailto:[hidden email] >> For general help: mailto:[hidden email]?subject=help >> OW2 mailing lists service home page: http://www.ow2.org/wws >> >> -- You receive this message as a subscriber of the [hidden email] mailing list. To unsubscribe: mailto:[hidden email] For general help: mailto:[hidden email]?subject=help OW2 mailing lists service home page: http://www.ow2.org/wws |
Administrator
|
Baschir,
What about generating the language on the HTML root element with something like: <html xml:lang="<%= ... %>">? Alex On Monday, November 2, 2009, Baschir Jaghoori <[hidden email]> wrote: > Many thanks for the tip with form runner, Erik. > > In the mean time I chose the following approach for i18n resources (see below). My goal was to minimize i18n specific code in my XForms. > > > Btw: Currently, one problem remains: The YUI calendar reads the locale from <html xml:lang=".."> - which conflicts with my servlet session approach - Is there something I can do about that? I don't want to create / generate different XForms for each locale... > > > Here is what I did: > > 1. > Define an instance for resources: > <xf:instance id="resources" > src="resourcesForLanguage.jsp" /> > > resourcesForLanguage.jsp reads the locale from the servlet session (defined somewhere in our application) and returns the respective resource XML for that language. > > 2. > bind the resource instance to a variable: > > <xxf:variable > name="resources" > select="instance('resources')" /> > > 3. > use the resources: > > <xf:output value="$resources/title" /> > > > Thanks again > Baschir > > > Erik Bruchez schrieb: > > Baschir, > > Form Runner does something like this already: you can switch locale > from the UI, and that is stored into the user's session and picked as > default the next time the user loads a page. There is no persistence > of that preference yet but that could be added. > > Form runner reads the locale (in fact here just the language) > preference into an instance, and then uses that instance to load the > resources specific to that locale (e.g. "en" or "fr"). All localizable > resources in the form point to that resources instance. > > I can't say that this is trivial but not so bad either. Here is the > model Form Runner uses: > > http://github.com/orbeon/orbeon-forms/blob/master/src/resources/apps/fr/i18n/resources-model.xml > > -Erik > > On Thu, Sep 10, 2009 at 5:00 AM, Baschir Jaghoori > <[hidden email]> wrote: > > Dear Orbeon Community, > > I am evaluating Orbeon and currently trying to find out how to handle l10n. > I know that I can: > - statically configure formatting app-wide using properties-xforms.xml > - including localized, static text using xforms instances for the resources > > What I want to do is to configure l10n at runtime and per servlet session > (the one from properties-xforms.xml)... > > btw, I am working in a separate deployment scenario with my XForm included > (jsp:include) inside a JSP application > > How I think it should work: > - user logs in and chooses his locale (in JSP) > - JSP puts some "locale" attribute inside the servlet session / sets the > locale and or formatting for Orbeon programmatically for this servlet > session > - Orbeon should now render the XForm in the user's locale > > This way I would not have to consider the users locale in my XForms... > > > Thanks! > Baschir > > > -- > You receive this message as a subscriber of the [hidden email] mailing > list. > To unsubscribe: mailto:[hidden email] > For general help: mailto:[hidden email]?subject=help > OW2 mailing lists service home page: http://www.ow2.org/wws > > > > > Orbeon Forms - Web forms, open-source, for the Enterprise Orbeon's Blog: http://www.orbeon.com/blog/ My Twitter: http://twitter.com/avernet -- You receive this message as a subscriber of the [hidden email] mailing list. To unsubscribe: mailto:[hidden email] For general help: mailto:[hidden email]?subject=help OW2 mailing lists service home page: http://www.ow2.org/wws
--
Follow Orbeon on Twitter: @orbeon Follow me on Twitter: @avernet |
BTW Alex's suggestion is exactly what Form Runner does, except it uses
AVTs and directly in XForms: <xhtml:html lang="{instance('fr-language-instance')}"> Just FYI to say that a similar approach should work. -Erik On Tue, Nov 10, 2009 at 1:09 PM, Alessandro Vernet <[hidden email]> wrote: > Baschir, > > What about generating the language on the HTML root element with > something like: <html xml:lang="<%= ... %>">? > > Alex > > On Monday, November 2, 2009, Baschir Jaghoori > <[hidden email]> wrote: >> Many thanks for the tip with form runner, Erik. >> >> In the mean time I chose the following approach for i18n resources (see below). My goal was to minimize i18n specific code in my XForms. >> >> >> Btw: Currently, one problem remains: The YUI calendar reads the locale from <html xml:lang=".."> - which conflicts with my servlet session approach - Is there something I can do about that? I don't want to create / generate different XForms for each locale... >> >> >> Here is what I did: >> >> 1. >> Define an instance for resources: >> <xf:instance id="resources" >> src="resourcesForLanguage.jsp" /> >> >> resourcesForLanguage.jsp reads the locale from the servlet session (defined somewhere in our application) and returns the respective resource XML for that language. >> >> 2. >> bind the resource instance to a variable: >> >> <xxf:variable >> name="resources" >> select="instance('resources')" /> >> >> 3. >> use the resources: >> >> <xf:output value="$resources/title" /> >> >> >> Thanks again >> Baschir >> >> >> Erik Bruchez schrieb: >> >> Baschir, >> >> Form Runner does something like this already: you can switch locale >> from the UI, and that is stored into the user's session and picked as >> default the next time the user loads a page. There is no persistence >> of that preference yet but that could be added. >> >> Form runner reads the locale (in fact here just the language) >> preference into an instance, and then uses that instance to load the >> resources specific to that locale (e.g. "en" or "fr"). All localizable >> resources in the form point to that resources instance. >> >> I can't say that this is trivial but not so bad either. Here is the >> model Form Runner uses: >> >> http://github.com/orbeon/orbeon-forms/blob/master/src/resources/apps/fr/i18n/resources-model.xml >> >> -Erik >> >> On Thu, Sep 10, 2009 at 5:00 AM, Baschir Jaghoori >> <[hidden email]> wrote: >> >> Dear Orbeon Community, >> >> I am evaluating Orbeon and currently trying to find out how to handle l10n. >> I know that I can: >> - statically configure formatting app-wide using properties-xforms.xml >> - including localized, static text using xforms instances for the resources >> >> What I want to do is to configure l10n at runtime and per servlet session >> (the one from properties-xforms.xml)... >> >> btw, I am working in a separate deployment scenario with my XForm included >> (jsp:include) inside a JSP application >> >> How I think it should work: >> - user logs in and chooses his locale (in JSP) >> - JSP puts some "locale" attribute inside the servlet session / sets the >> locale and or formatting for Orbeon programmatically for this servlet >> session >> - Orbeon should now render the XForm in the user's locale >> >> This way I would not have to consider the users locale in my XForms... >> >> >> Thanks! >> Baschir >> >> >> -- >> You receive this message as a subscriber of the [hidden email] mailing >> list. >> To unsubscribe: mailto:[hidden email] >> For general help: mailto:[hidden email]?subject=help >> OW2 mailing lists service home page: http://www.ow2.org/wws >> >> >> >> >> > > -- > Orbeon Forms - Web forms, open-source, for the Enterprise > Orbeon's Blog: http://www.orbeon.com/blog/ > My Twitter: http://twitter.com/avernet > > > -- > You receive this message as a subscriber of the [hidden email] mailing list. > To unsubscribe: mailto:[hidden email] > For general help: mailto:[hidden email]?subject=help > OW2 mailing lists service home page: http://www.ow2.org/wws > > -- You receive this message as a subscriber of the [hidden email] mailing list. To unsubscribe: mailto:[hidden email] For general help: mailto:[hidden email]?subject=help OW2 mailing lists service home page: http://www.ow2.org/wws |
Free forum by Nabble | Edit this page |