Wiki Spaces

Documentation
Projects
Resources

Get Help from Others

Q&A: Ask OpenMRS
Discussion: OpenMRS Talk
Real-Time: IRC Chat | Slack

Projects

Page tree
Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 4 Next »

Primary mentor

~bmamlin

Backup mentor

Rafal Korytkowski

Assigned to

Mykola Vorobey

Overview

With use Spring's message taglib for putting strings onto our web pages.  This gives us the ability to translate openmrs very easily.  If you want to put a string into a jsp page into openmrs you put this spring:message in your jsp:

<spring:message code="MyPage.personSearchFieldPrompt" />: <input type="text" value="personId" />

And then you find the messages.properties file and add this:

MyPage.personSearchFieldPrompt=Enter the person id

And if you're bilingual and not too lazy you find the messages_es.properties file and append this:

MyPage.personSearchFieldPrompt=Entra el id de la persona

Now the text can be is displayed automatically in Spanish if the user has set their locale as Spanish.  If the user is in the English locale or any other, they will see the english translation.

Problems:

  • Its inefficient to have to edit two files to add a simple string.
  • Many devs only know english and so will only ever edit the one file.
  • When translating message bundles, the translator lacks the context of the message within the application.

Solution:

Allow for in-line adding/editing of the translated text.

Design

  • Create an OpenMRS JSTL tag for messages – i.e., openmrs:message – allowing us to control the output and enhance messaging within OpenMRS.
    • This can extend the existing spring:message tag; however, we will want to add the ability to output special HTML to support in-line localization as well as allow for locale & message to be specified in the web page.
    • At the same time, we'd like to enhance the utility for referencing messages within Java code to include a locale and message for that locale.
  • Create a module that enables in-line localization.
    • When translation is enabled, render messages in a manner that support in-line changes.
    • Persist those changes back to the message bundles.
  • Create a workflow that ensures that local changes to the message bundles are not lost when OpenMRS is upgraded.

Extra credit:

  • Create a script to identify embedded messages in web pages and code and bring those into the appropriate message bundle(s).
  • Create a script to take the default bundles (i.e., en) and import those messages into web pages and code as the default message.

See Also

Interested Parties

  •  
  • No labels