Příklad

public static void main(String[] args){
int version = 6;
String applicaiton = "Rational Developer "; //$NON-NLS-1$

String edition = "Pro Javu "; //$NON-NLS-1$
String message = "Toto je verze"; //$NON-NLS-1$
message += String.valueOf(version);
message += " produktu "; //$NON-NLS-1$
message += applicaiton;
message += edition;
message += "\"."; //$NON-NLS-1$
System.out.println(message);
}
Řešení
Pro přeložitelné řetězce použijte formátu java.text.MessageFormat.

public static void main(String[] args){
final String MSG_FORMATSTRING="Rational Developer {0} verze {1}"; //$NON-NLS-1$
final String VERSION = "verze"; //$NON-NLS-1$
final String EDITION = "edice"; //$NON-NLS-1$
final String JAVA = "Pro Javu"; //$NON-NLS-1$
final String MOJE_PROSTREDKY = "mojeProstredky"; //$NON-NLS-1$

ResourceBundle mojeProstredky = ResourceBundle.getBundle(MOJE_PROSTREDKY, Locale.US );
String version = mojeProstredky.getString(VERSION);
String edition = mojeProstredky.getString(EDITION);

MessageFormat form = new MessageFormat(MSG_FORMATSTRING);
Object[] testArgs = {new Integer(6), JAVA};
System.out.println(form.format(testArgs));
}