locale

getting list of languages supported by android keyboard

依然范特西╮ 提交于 2019-12-18 05:02:20
问题 I need to display the list of the all languages which are supported by android keyboard. Now I am using Locale.getAvailableLocales(); method but i am getting language and country constants. I need all language names only. Is it possible? and how ?. 回答1: How about using Locale.getDisplayName(Locale) on each Locale you get with Locale.getAvailableLocales(); ? Returns this locale's language name, country name, and variant, localized to locale. new Locale("en").getDisplayName(Locale.US) ->

lower case of turkish character dotted i

江枫思渺然 提交于 2019-12-18 05:01:41
问题 In Java 6, System.out.println(String.valueOf('\u0130').toLowerCase()); prints i ( u0069 ), but in Java 7 it prints i with double dots ( u0069 u0307 ). I understand it is a Turkish character, but how do I make Java 7 print the same output as v6 using this code? System.out.println(inputText.toLowerCase()); Also make sure that the code can handle international text without hardcoding the toLowerCase function to use only Turkish locale. 回答1: There is a quite detailed blog post about this i

string conversion with boost locale: different behaviour on windows and linux

筅森魡賤 提交于 2019-12-18 04:46:09
问题 This is my sample code: #pragma execution_character_set("utf-8") #include <boost/locale.hpp> #include <boost/algorithm/string/case_conv.hpp> #include <iostream> int main() { std::locale loc = boost::locale::generator().generate(""); std::locale::global(loc); #ifdef MSVC std::cout << boost::locale::conv::from_utf("grüßen vs ", "ISO8859-15"); std::cout << boost::locale::conv::from_utf(boost::locale::to_upper("grüßen"), "ISO8859-15") << std::endl; std::cout << boost::locale::conv::from_utf(boost

Get language name in that language from language code [closed]

懵懂的女人 提交于 2019-12-18 04:33:31
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 3 years ago . I have a list of language codes (as in "en", "es"...) I need to display in those language like this: English Español Français Deutsch 日本語 Is there any built-in API to get these in Android or should I map them myself? 回答1: The Locale class have a method for this: public String getDisplayLanguage(Locale locale) ,

Get language name in that language from language code [closed]

自作多情 提交于 2019-12-18 04:33:10
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 3 years ago . I have a list of language codes (as in "en", "es"...) I need to display in those language like this: English Español Français Deutsch 日本語 Is there any built-in API to get these in Android or should I map them myself? 回答1: The Locale class have a method for this: public String getDisplayLanguage(Locale locale) ,

Android - Get List of supported Locales

我怕爱的太早我们不能终老 提交于 2019-12-18 04:24:24
问题 I have to implement AutoComplete TextView for all the supported locales of Android Device. I tried the following: public class AutoCompleteView extends Activity{ public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); ArrayAdapter<String> adapter = new ArrayAdapter<String>(this, android.R.layout.simple_dropdown_item_1line, Locales); AutoCompleteTextView textView = (AutoCompleteTextView) findViewById(R.id.locale_list); textView.setAdapter(adapter); } static Locale

Set-up the application Language in Android Preferences

☆樱花仙子☆ 提交于 2019-12-18 04:17:11
问题 I would like the application language to be set according to the user preferences but up till now it doesn't work how I would like it to. I have set the default values: strings.xml and also values-es with a strings.xml inside in spanish. I have a menu option which brings the user to a Preference activity where he can amon gother things chose the language. So here are some extracts of the code: public class Preference extends PreferenceActivity implements OnSharedPreferenceChangeListener { ...

Retrieve active locale in Grails application

拜拜、爱过 提交于 2019-12-17 23:43:05
问题 I know I can use the "lang" parameter to automatically change the current locale as described in the docs, but how do I track those changes, for example to update the language stored in the current user domain object? request.locale does not work, since it does not reflect the changes done via " ?lang=xx " 回答1: Within your controller you can obtain the locale using the RequestContextUtils . import org.springframework.web.servlet.support.RequestContextUtils as RCU Then to resolve the locale

Retrieve active locale in Grails application

こ雲淡風輕ζ 提交于 2019-12-17 23:40:06
问题 I know I can use the "lang" parameter to automatically change the current locale as described in the docs, but how do I track those changes, for example to update the language stored in the current user domain object? request.locale does not work, since it does not reflect the changes done via " ?lang=xx " 回答1: Within your controller you can obtain the locale using the RequestContextUtils . import org.springframework.web.servlet.support.RequestContextUtils as RCU Then to resolve the locale

Design considerations for internationalization

跟風遠走 提交于 2019-12-17 21:24:47
问题 I've read Joel's article on Unicode and I feel that I have at least a basic grasp of internationalization from a character set perspective. In addition to reading this question, I've also done some of my own research on internationalization in regards to design considerations, but I can't help but suspect that there is a lot more out there that I just don't know or don't know to ask. Some of the things I've learned: Some languages read right-to-left instead of left-to-right. Calendar, dates,