Wiki Spaces


Get Help from Others

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


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

These files are used by Spring to internationalize all strings in your module.  It is highly recommended you use these.

The files should be in /omod/src/main/resources.

You need to list your file in your config.xml file in "messages" elements. 

Prefixing with your module's id

Typically they keys you define in a module's file should start with your module's id, and any keys that do not start with your module's id will have it prepended.

For example:

title = My Module  # will be converted to mymodule.title = My Module

Starting in OpenMRS 1.9.3 you are allowed to override this behavior, and let your module define message keys outside of its namespace. To do this, you need to include a special entry in the properties file like: = true

mymodule.title = My Module's Title  # explicitly inside mymodule namespace
othermodule.othercode = Some Other Value  # defines a code in another module's namespace


The main english file should be named  Each other language will be (for French)


mymodule.doSomething=You should do something here
mymodule.somethingElse=Something else happens when you use this.

mymodule.doSomething=Vous devriez faire quelque chose ici
mymodule.somethingElse=Quelque chose d'autre qui se passe quand vous l'utilisez.

Now in your jsp files you can use <spring:message code="mymodule.doSomething"/> and it will be translated when the user chooses to use the French locale.

What if I don't know another language?

Most developers only know a single language.  It is acceptable to only fill out the english file and wait for another language speaker to help you out.

  • No labels