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

Version 1 Next »

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 messages.properties file in your config.xml file in "messages" elements. 

Example

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

Example:

messages.properties:

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

messages_fr.properties:

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

  • No labels