/*
Pro Spring
By Rob Harrop
Jan Machacek
ISBN: 1-59059-461-4
Publisher: Apress
*/
///////////////////////////////////////////////////////////////////////////////////////
buttons
labels
///////////////////////////////////////////////////////////////////////////////////////
import java.util.Locale;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.FileSystemXmlApplicationContext;
public class MessageSourceDemo {
public static void main(String[] args) {
ApplicationContext ctx = new FileSystemXmlApplicationContext(
"build/messageSource.xml");
Locale english = Locale.ENGLISH;
Locale czech = new Locale("cs", "CZ");
System.out.println(ctx.getMessage("msg", null, english));
System.out.println(ctx.getMessage("msg", null, czech));
System.out.println(ctx.getMessage("nameMsg", new Object[] { "Rob",
"Harrop" }, english));
}
}
MessageSource.zip( 1,197 k)