51Testing软件测试论坛

标题: RFT多国化查询 [打印本页]

作者: lg1318617    时间: 2010-6-4 10:41
标题: RFT多国化查询
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~
高手解答下啊




欢迎光临 51Testing软件测试论坛 (http://bbs.51testing.com/) Powered by Discuz! X3.2