www.pudn.com > struts2.rar > Test2.java, change:2009-08-19,size:534b


package com.i18n; 
 
import java.util.Locale; 
import java.util.ResourceBundle; 
 
public class Test2 { 
 
	/** 
	 * @param args 
	 */ 
	public static void main(String[] args) { 
		// TODO Auto-generated method stub 
		 
//		Locale locale = Locale.getDefault();//取得当前locale 
		Locale locale = Locale.US;//取得美国locale 
		 
		ResourceBundle bundle = ResourceBundle.getBundle("hellofile",locale);//hellofile_zh_CN.properties 
		 
		String hellovalue = bundle.getString("hello"); 
		 
		System.out.println(hellovalue); 
 
	} 
 
}