Exemple #1
0
    // Use this for initialization
    void Start()
    {
        Log.d(LOG_TAG, "start()");
        rw = WaveVR_Resource.instance;

        Log.d(LOG_TAG, "system default language is " + rw.getSystemLanguage());
        Log.d(LOG_TAG, "system default country is " + rw.getSystemCountry());

        Log.d(LOG_TAG, "get string by system default language");

        string tmp = rw.getString("allow");

        Log.d(LOG_TAG, "get allow by system default language : " + tmp);

        tmp = rw.getString("demo");
        Log.d(LOG_TAG, "get demo by system default language : " + tmp);

        tmp = rw.getString("reject");
        Log.d(LOG_TAG, "get reject by system default language : " + tmp);

        tmp = rw.getString("test");
        Log.d(LOG_TAG, "get test by system default language : " + tmp);

        bool ret = rw.setPreferredLanguage("zh", "CN");

        Log.d(LOG_TAG, "set preferred lanuage to simplized chinese and get string = " + ret);

        tmp = rw.getString("allow");
        Log.d(LOG_TAG, "get allow by preferred lanuage(zhCN) : " + tmp);

        tmp = rw.getString("demo");
        Log.d(LOG_TAG, "get demo by preferred language(zhCN) : " + tmp);

        tmp = rw.getString("reject");
        Log.d(LOG_TAG, "get reject by preferred language(zhCN) : " + tmp);

        tmp = rw.getString("test");
        Log.d(LOG_TAG, "get test by preferred language(zhCN) : " + tmp);

        Log.d(LOG_TAG, "get string in dedicated language");
        tmp = rw.getStringByLanguage("demo", "zh", "TW");
        Log.d(LOG_TAG, "get demo by zhTW : " + tmp);
        tmp = rw.getStringByLanguage("demo", "en", "US");
        Log.d(LOG_TAG, "get demo by enUS : " + tmp);
        tmp = rw.getStringByLanguage("demo", "ja", "JP");
        Log.d(LOG_TAG, "get demo by jaJP : " + tmp);
        rw.getStringByLanguage("demo", "xx", "xx");
        Log.d(LOG_TAG, "get demo by xxxx: " + tmp);

        Log.d(LOG_TAG, "set back to default language ");
        rw.useSystemLanguage();

        tmp = rw.getString("allow");
        Log.d(LOG_TAG, "get allow from native : " + tmp);

        tmp = rw.getString("demo");
        Log.d(LOG_TAG, "get demo from native : " + tmp);

        tmp = rw.getString("reject");
        Log.d(LOG_TAG, "get reject from native : " + tmp);

        tmp = rw.getString("test");
        Log.d(LOG_TAG, "get test from native : " + tmp);
    }