In this example we'll get Maximo's greeting message.
psdi.util.MXSession mxSession = (...);
(...)
// LANGCODE
String langCode = "PT";
// Name of the user currently logged in, to present in the message.
String usrDisplayName[] = { mxSession.getUserInfo().getDisplayName() };
// MAXMESSAGE object constructor with the target langcode.
psdi.mbo.MaxMessage message = new MaxMessage(langCode);
// Message group
message.setGroup("login");
// Message key
message.setKey("welcomeusername");
// Obtain Maximo's message text using the MXSession instance used to connect to Maximo.
msgS = mxSession.getMessage("login", "welcomeusername");
// Fill in the messages parameters
message.setValue(msgS);
// Get the translated text.
msgS = message.getMessage(usrDisplayName);
// Print the message
System.out.println(msgS);
![Reblog this post [with Zemanta]](http://img.zemanta.com/reblog_e.png?x-id=e3bfa3c0-33ba-4a83-b779-2d4dedab0c1b)
0 comments:
Post a Comment