Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Page title capitalization

...

Note

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

Prefixing with your module's id

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

...

Code Block
openmrs.property.ALLOW_KEYS_OUTSIDE_OF_MODULE_NAMESPACE = true

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

Example

The main english file should be named messages.properties.  Each other language will be messages_fr.properties (for frenchFrench)

Example:

messages.properties:

...

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 messages.properties file and wait for another language speaker to help you out.