package com.fgkj.actions;
|
|
import java.util.Locale;
|
import com.opensymphony.xwork2.ActionContext;
|
|
public class I18nAction extends ActionUtil{
|
private String lanuage;
|
private String key;
|
private String value;
|
|
public String findValue(){
|
//System.out.println(key+"&&&&&&&&&&&&");
|
value=this.getText(key);
|
//value=ActionUtil.tojson(value);
|
//System.out.println(value+"$$$$$$$");
|
return SUCCESS;
|
}
|
|
//切换中英文环境
|
public String SetLocale(){
|
Locale local = Locale.getDefault();
|
if(lanuage!=null){
|
if("US".equalsIgnoreCase(lanuage)){
|
local = Locale.US;
|
|
}else if("CH".equalsIgnoreCase(lanuage)){
|
local = Locale.CHINA;
|
}
|
//System.out.println(local.getCountry());
|
}
|
ActionContext.getContext().setLocale(local);
|
getSession().setAttribute("WW_TRANS_I18N_LOCALE", local);
|
return SUCCESS;
|
}
|
|
public String getValue() {
|
return value;
|
}
|
|
public String getKey() {
|
return key;
|
}
|
|
public void setValue(String value) {
|
this.value = value;
|
}
|
|
public void setKey(String key) {
|
this.key = key;
|
}
|
|
public void setLanuage(String lanuage) {
|
this.lanuage = lanuage;
|
}
|
|
}
|