Hi,
i'm using selectInputMethod(new Locale("ar", "AE")) to set the locale for my application. this works fine but the problem is that i should specify the country code as well e.g. "AE", without this it will not work e.g. new Locale("ar")
Arabic language is the same for all countries so the country is not a matter here. i don't know which country code language is installed in the user PC. i want the application to select any Arabic language installed in the user PC.
Locale.getAvailableLocales() is not giving me what i need. it gives all the supported languages in the OS but not the ones that are enabled by the user.
i ended up duplicating selectInputMethod for all the country codes i.e.:
this.getInputContext().selectInputMethod(new Locale("ar", "DZ"));
this.getInputContext().selectInputMethod(new Locale("ar", "IQ"));
this.getInputContext().selectInputMethod(new Locale("ar", "JO"));
this.getInputContext().selectInputMethod(new Locale("ar", "LB"));
this.getInputContext().selectInputMethod(new Locale("ar", "LY"));
this.getInputContext().selectInputMethod(new Locale("ar", "MA"));
this.getInputContext().selectInputMethod(new Locale("ar", "OM"));
this.getInputContext().selectInputMethod(new Locale("ar", "SD"));
this.getInputContext().selectInputMethod(new Locale("ar", "SY"));
this.getInputContext().selectInputMethod(new Locale("ar", "TN"));
this.getInputContext().selectInputMethod(new Locale("ar", "YE"));
this.getInputContext().selectInputMethod(new Locale("ar", "QA"));
this.getInputContext().selectInputMethod(new Locale("ar", "KW"));
this.getInputContext().selectInputMethod(new Locale("ar", "BH"));
this.getInputContext().selectInputMethod(new Locale("ar", "EG"));
this.getInputContext().selectInputMethod(new Locale("ar", "SA"));
this.getInputContext().selectInputMethod(new Locale("ar", "AE"));
this will pick certainly one Arabic language in the user PC.
Is there any other better way?
i'm using selectInputMethod(new Locale("ar", "AE")) to set the locale for my application. this works fine but the problem is that i should specify the country code as well e.g. "AE", without this it will not work e.g. new Locale("ar")
Arabic language is the same for all countries so the country is not a matter here. i don't know which country code language is installed in the user PC. i want the application to select any Arabic language installed in the user PC.
Locale.getAvailableLocales() is not giving me what i need. it gives all the supported languages in the OS but not the ones that are enabled by the user.
i ended up duplicating selectInputMethod for all the country codes i.e.:
this.getInputContext().selectInputMethod(new Locale("ar", "DZ"));
this.getInputContext().selectInputMethod(new Locale("ar", "IQ"));
this.getInputContext().selectInputMethod(new Locale("ar", "JO"));
this.getInputContext().selectInputMethod(new Locale("ar", "LB"));
this.getInputContext().selectInputMethod(new Locale("ar", "LY"));
this.getInputContext().selectInputMethod(new Locale("ar", "MA"));
this.getInputContext().selectInputMethod(new Locale("ar", "OM"));
this.getInputContext().selectInputMethod(new Locale("ar", "SD"));
this.getInputContext().selectInputMethod(new Locale("ar", "SY"));
this.getInputContext().selectInputMethod(new Locale("ar", "TN"));
this.getInputContext().selectInputMethod(new Locale("ar", "YE"));
this.getInputContext().selectInputMethod(new Locale("ar", "QA"));
this.getInputContext().selectInputMethod(new Locale("ar", "KW"));
this.getInputContext().selectInputMethod(new Locale("ar", "BH"));
this.getInputContext().selectInputMethod(new Locale("ar", "EG"));
this.getInputContext().selectInputMethod(new Locale("ar", "SA"));
this.getInputContext().selectInputMethod(new Locale("ar", "AE"));
this will pick certainly one Arabic language in the user PC.
Is there any other better way?