Version 8.3.4

Dealing with Literals inside Your Adapter

Use method replaceLiteral of the inherited Adapter class to replace messages:

...
this.outputMessage("S",replaceLiteral("APP1","successFileSaved"));
...

The first parameter is an abbreviation - the file name of the multi language file. The second parameter is the text ID that should be translated into text as described previously.

It is also possible to pass parameters of your application to the multi language management. For example, if you want to show a success message which informs that file "xyz" was saved, proceed as follows:

...
String fileName = "xyz";
this.outputMessage("S",replaceLiteral("APP1","successFileSaved",fileName));
...

The corresponding line in the CSV file (APP1.csv) in the \en directory for English looks like:

...
successFileSave;File &1 was saved successfully
...

The "&1" is automatically replaced with the file name. There are other variants of the replaceLiteral() method available to pass 2 or 3 parameters. In this case, use &1, &2 and &3 in the text definition.

Top of page