HTMLForms and localization

classic Classic list List threaded Threaded
6 messages Options
Stephen Retchford Stephen Retchford
Reply | Threaded
Open this post in threaded view
|

HTMLForms and localization

I have an HTMLForm with many labels and text elements that must support both Spanish and English.  I realize that I can use the translations tag at the top of my form, but this really clutters up the html due to the number of labels.  Is it possible to store the labels in separate properties files for each language, and reference them in the HTMLForm?  I also need a more flexible way to retrieve the labels (other than using obs labelcode), because the labels are not always tied to an observation.  Any suggestions would be appreciated.

Thanks,
Steve

[hidden email] from OpenMRS Implementers' mailing list
Tobin Greensweig Tobin Greensweig
Reply | Threaded
Open this post in threaded view
|

Re: HTMLForms and localization

As a related follow-up question, is it possible for a user to change the language a form is displayed within the form or only based on their users' default locale?

Thanks,

Tobin

On Mon, Apr 16, 2012 at 6:06 AM, Stephen Retchford <[hidden email]> wrote:
I have an HTMLForm with many labels and text elements that must support both Spanish and English.  I realize that I can use the translations tag at the top of my form, but this really clutters up the html due to the number of labels.  Is it possible to store the labels in separate properties files for each language, and reference them in the HTMLForm?  I also need a more flexible way to retrieve the labels (other than using obs labelcode), because the labels are not always tied to an observation.  Any suggestions would be appreciated.

Thanks,
Steve

[hidden email] from OpenMRS Implementers' mailing list



--
Tobin

[hidden email] from OpenMRS Implementers' mailing list
Mark Goodrich-2 Mark Goodrich-2
Reply | Threaded
Open this post in threaded view
|

FW: [OPENMRS-IMPLEMENTERS] HTMLForms and localization

 

Steve & Tobin—

 

There is no build-in way to localize a form beyond the translations tag.  I don’t know if anyone has come up with any creative solutions.  If you have an idea of how you’d like it to work, go ahead and enter a ticket as a feature request…

 

I believe here at PIH when we’ve needed to have a form in multiple languages, we’ve either created multiple versions of the form, or included both languages side-by-side on the form.

 

To Tobin’s question, you are able to change your locale using the links in the OpenMRS footer.  This should change the language within the form… if it doesn’t, this is bug.

 

Mark

 

 

 

 

From: [hidden email] [hidden email] On Behalf Of Tobin Greensweig
Sent: Monday, April 16, 2012 12:47 AM
To: [hidden email]
Subject: Re: [OPENMRS-IMPLEMENTERS] HTMLForms and localization

 

As a related follow-up question, is it possible for a user to change the language a form is displayed within the form or only based on their users' default locale?


Thanks,

 

Tobin

On Mon, Apr 16, 2012 at 6:06 AM, Stephen Retchford <[hidden email]> wrote:

I have an HTMLForm with many labels and text elements that must support both Spanish and English.  I realize that I can use the translations tag at the top of my form, but this really clutters up the html due to the number of labels.  Is it possible to store the labels in separate properties files for each language, and reference them in the HTMLForm?  I also need a more flexible way to retrieve the labels (other than using obs labelcode), because the labels are not always tied to an observation.  Any suggestions would be appreciated.

Thanks,
Steve


[hidden email] from OpenMRS Implementers' mailing list



 

--
Tobin


[hidden email] from OpenMRS Implementers' mailing list


[hidden email] from OpenMRS Implementers' mailing list
Ellen Ball Ellen Ball
Reply | Threaded
Open this post in threaded view
|

Re: HTMLForms and localization

In reply to this post by Stephen Retchford
At PIH, we normally provide multiple languages (English and French) on our
paper and html forms.  The translation tag is available, but we rarely use it.  
Since screen real-estate is cheap, many of our htmlforms show the text in
both languages.  We might show French in black font followed by the English
in italicized grey.  If the paper has enough space, we also include both
languages on the form.  It's not a perfect system, but the simplest to maintain.

It would be great to have a cleaner method.

Regards,

Ellen Ball
Partners In Health

_________________________________________

To unsubscribe from OpenMRS Implementers' mailing list, send an e-mail to [hidden email] with "SIGNOFF openmrs-implement-l" in the  body (not the subject) of your e-mail.

[mailto:[hidden email]?body=SIGNOFF%20openmrs-implement-l]
Michael Seaton Michael Seaton
Reply | Threaded
Open this post in threaded view
|

Re: HTMLForms and localization

I'm pretty sure the way that we implemented the translations in
HtmlFormEntry is that tags that support localization will:

1. Look for a translation in the <translations> section.  If nothing
found, then:
2. Look for a translation in across all of the OpenMRS message
properties.  If nothing found, then:
3. Return the text as is.

So, if you can find a way to manage all of your messages in separate
messages.properties files (eg. in a module), you should be able to refer
to these messages from your htmlforms and have the translations appear
as specified.  I haven't tried this myself, but I think in theory it
should work...

Mike


On 04/17/2012 12:26 PM, Ellen Ball wrote:

> At PIH, we normally provide multiple languages (English and French) on our
> paper and html forms.  The translation tag is available, but we rarely use it.
> Since screen real-estate is cheap, many of our htmlforms show the text in
> both languages.  We might show French in black font followed by the English
> in italicized grey.  If the paper has enough space, we also include both
> languages on the form.  It's not a perfect system, but the simplest to maintain.
>
> It would be great to have a cleaner method.
>
> Regards,
>
> Ellen Ball
> Partners In Health
>
> _________________________________________
>
> To unsubscribe from OpenMRS Implementers' mailing list, send an e-mail to [hidden email] with "SIGNOFF openmrs-implement-l" in the  body (not the subject) of your e-mail.
>
> [mailto:[hidden email]?body=SIGNOFF%20openmrs-implement-l]

_________________________________________

To unsubscribe from OpenMRS Implementers' mailing list, send an e-mail to [hidden email] with "SIGNOFF openmrs-implement-l" in the  body (not the subject) of your e-mail.

[mailto:[hidden email]?body=SIGNOFF%20openmrs-implement-l]
Stephen Retchford Stephen Retchford
Reply | Threaded
Open this post in threaded view
|

Re: HTMLForms and localization

Thank you for all the info.  I will try using a properties file as Mike suggested and report back what I find.  If the properties file works, then the only feature I would like to see is the ability to use a standalone tag (ie. not the labelcode attribute of the obs tag), so as to have more flexibility in presenting the translated text.

Thanks again,
Steve

On Tue, Apr 17, 2012 at 1:18 PM, Michael Seaton <[hidden email]> wrote:
I'm pretty sure the way that we implemented the translations in HtmlFormEntry is that tags that support localization will:

1. Look for a translation in the <translations> section.  If nothing found, then:
2. Look for a translation in across all of the OpenMRS message properties.  If nothing found, then:
3. Return the text as is.

So, if you can find a way to manage all of your messages in separate messages.properties files (eg. in a module), you should be able to refer to these messages from your htmlforms and have the translations appear as specified.  I haven't tried this myself, but I think in theory it should work...

Mike



On 04/17/2012 12:26 PM, Ellen Ball wrote:
At PIH, we normally provide multiple languages (English and French) on our
paper and html forms.  The translation tag is available, but we rarely use it.
Since screen real-estate is cheap, many of our htmlforms show the text in
both languages.  We might show French in black font followed by the English
in italicized grey.  If the paper has enough space, we also include both
languages on the form.  It's not a perfect system, but the simplest to maintain.

It would be great to have a cleaner method.

Regards,

Ellen Ball
Partners In Health

_________________________________________

To unsubscribe from OpenMRS Implementers' mailing list, send an e-mail to [hidden email] with "SIGNOFF openmrs-implement-l" in the  body (not the subject) of your e-mail.

[mailto:[hidden email]?body=SIGNOFF%20openmrs-implement-l]

_________________________________________

To unsubscribe from OpenMRS Implementers' mailing list, send an e-mail to [hidden email] with "SIGNOFF openmrs-implement-l" in the  body (not the subject) of your e-mail.

[mailto:[hidden email]?body=SIGNOFF%20openmrs-implement-l]



--
Thank you,
Stephen Retchford

[hidden email] from OpenMRS Implementers' mailing list