|
package resources;
import com.ibm.xtq.xslt.runtime.Hashtable;
public class Utilities {
/**
* Script Name : <b>utilities</b>
* Generated : <b>2005-10-25 16:51:51</b>
* Description : Functional Test Script
* Original Host : WinNT Version 5.1 Build 2600 (S)
*
* @since 2005/10/25
* @author zhangguojun
*/
public static String EN_LOCALE = "en";
public static String CN_LOCALE = "cn";
public String CurrentLocale = EN_LOCALE;
private Hashtable textRepositoryForEN = new Hashtable();
private Hashtable textRepositoryForCN = new Hashtable();
private static Utilities _instance = null;
private Utilities(){
textRepositoryForEN.put("Search","Search");
textRepositoryForEN.put("IBMurl","www.ibm.com");
textRepositoryForCN.put("Search","搜索");
textRepositoryForCN.put("IBMurl","www.ibm.com/cn");
}
public static Utilities getInstance() {
if (null == _instance)
_instance = new Utilities();
return _instance;
}
public void setCurrentLocale(String locale)
{
CurrentLocale=locale;
}
public String getLocalText(String textId)
{
return getLocalText(CurrentLocale,textId);
}
public String getLocalText(String locale, String textId)
{
String returnVal = null;
if(locale.equals(EN_LOCALE))
returnVal = (String)textRepositoryForEN.get(textId);
else if(locale.equals(CN_LOCALE))
returnVal = (String)textRepositoryForCN.get(textId);
if(null==returnVal)
return textId;
else
return returnVal;
}
}
为什么提示找不到 Search~
高手解答下啊 |
|