如何在android中显示bahasa马来西亚语

时间:2013-10-22 10:29:41

标签: android localization

我有两个问题:

  1. 我需要在android的
  2. 中看到一个旋转器上的Bahasa Malaysia语言翻译
  3. 如何拨打其他节目;谷歌在应用程序中的环聊?
  4. 我已经在values-ms中获得了翻译 我真的需要这个感谢

1 个答案:

答案 0 :(得分:0)

我找到了答案

String[] language= { "English", "Chinese (Simplified)", "Bahasa Malaysia"};

ArrayAdapter<String> adapter = new ArrayAdapter<String

(this,android.R.layout.simple_spinner_item,language);

adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
    spinner.setAdapter(adapter);

    spinner.setOnItemSelectedListener(new OnItemSelectedListener() {

        public void onItemSelected(AdapterView<?> arg0, View arg1,
                int arg2, long arg3) {
        Configuration config = new Configuration();
        Locale applang = new Locale ("ms");
        switch (arg2){
        case 0:
            config.locale = Locale.ENGLISH;
        break;
        case 1:
            config.locale = Locale.SIMPLIFIED_CHINESE;
        break;
        case 2:
            config.locale = applang;
        break;
        default:
            config.locale = Locale.ENGLISH;
        break;
        }
        getResources().updateConfiguration(config, null);       
        }

        public void onNothingSelected(AdapterView<?> arg0) {
            // TODO Auto-generated method stub      
        }
    });