locale

Changing app locale sometimes doesn't change direction of layouts

泪湿孤枕 提交于 2020-07-23 07:32:08
问题 I'm changing locale of my app programmatically using the following method. It works fine but when I start an already existing singleTask activity using Intent.FLAG_ACTIVITY_CLEAR_TOP flag. Then application loses the layout direction but translation is correct. For example, if application language is Arabic then all views direction is changed to English locale (left-to-right). What could be the reason? I'm calling following method in attachBaseContext of BaseActivity and Application class.

What is setlocale() for?

做~自己de王妃 提交于 2020-07-22 18:16:31
问题 I'm studying c++ and I have found this function of C++ library: setlocale (http://www.cplusplus.com/reference/clocale/setlocale/) but I'm not able to understand what is it for. I have used on Ubuntu: printf ("Locale is: %s\n", setlocale(LC_ALL,"") ); it prints Locale is: en_US.UTF-8 but on macOs it prints: Locale is: C what does means this C? In what context and how should it be used? 回答1: Read on Linux the setlocale(3) and locale(7) man pages. Read also the internationalization and

What is setlocale() for?

ぃ、小莉子 提交于 2020-07-22 18:16:12
问题 I'm studying c++ and I have found this function of C++ library: setlocale (http://www.cplusplus.com/reference/clocale/setlocale/) but I'm not able to understand what is it for. I have used on Ubuntu: printf ("Locale is: %s\n", setlocale(LC_ALL,"") ); it prints Locale is: en_US.UTF-8 but on macOs it prints: Locale is: C what does means this C? In what context and how should it be used? 回答1: Read on Linux the setlocale(3) and locale(7) man pages. Read also the internationalization and

How to get all Java supported Locales

南笙酒味 提交于 2020-07-07 09:57:45
问题 When Google you will find lot of materials to find all the supported Locales by Java. But its all confusing. For example [http://sanjaal.com/java/tag/java-locale-tutorial/] show an output of 210 locales. But when I run the same program I get only 155. I don;t get for example ta_IN. si_LK is not output by any program. Can someone please clear the air? I use JDK/JRE 1.7 http://www.oracle.com/technetwork/java/javase/javase7locales-334809.html gives 111 entries. I have a Spring Application which

How do I get the formula separator in a script?

末鹿安然 提交于 2020-07-03 05:16:24
问题 I have a basic Google Sheets script and as part of the HTML sidebar I show the user the formula to type in; e.g. =myformula("bob", "ross") . This works for people in the U.S. and a lot of other countries but there are quite a few countries that use ; instead, so the formula looks like =myformula("bob"; "ross") . I know I can probably get the locale of the spreadsheet via a script but is there a way to get whether I should put a , or a ; ? Thanks! 回答1: ; is universally accepted(except in case

Convert Japanese wstring to std::string

坚强是说给别人听的谎言 提交于 2020-06-29 06:44:19
问题 Can anyone suggest a good method to convert a Japanese std::wstring to std::string ? I used the below code. Japanese strings are not converting properly on an English OS. std::string WstringTostring(std::wstring str) { size_t size = 0; _locale_t lc = _create_locale(LC_ALL, "ja.JP.utf8"); errno_t err = _wcstombs_s_l(&size, NULL, 0, &str[0], _TRUNCATE, lc); std::string ret = std::string(size, 0); err = _wcstombs_s_l(&size, &ret[0], size, &str[0], _TRUNCATE, lc); _free_locale(lc); ret.resize

Flutter internationalization for Japanese failed

限于喜欢 提交于 2020-06-29 05:05:12
问题 I am new to flutter. I want to get the support for Japanese language for the application. I followed the example listed here; https://medium.com/flutter-community/flutter-internationalization-the-easy-way-using-provider-and-json-c47caa4212b2 It works perfectly for Arabic language listed there, but when i try the same for Japanese. It does not work. Only thing I did was modify to include 'jp' locale return MaterialApp( locale: model.appLocal, supportedLocales: [ Locale('en', 'US'), Locale('jp'

Flutter internationalization for Japanese failed

血红的双手。 提交于 2020-06-29 05:05:11
问题 I am new to flutter. I want to get the support for Japanese language for the application. I followed the example listed here; https://medium.com/flutter-community/flutter-internationalization-the-easy-way-using-provider-and-json-c47caa4212b2 It works perfectly for Arabic language listed there, but when i try the same for Japanese. It does not work. Only thing I did was modify to include 'jp' locale return MaterialApp( locale: model.appLocal, supportedLocales: [ Locale('en', 'US'), Locale('jp'

Howto get the language name for a given locale in linux

北城余情 提交于 2020-06-27 08:46:40
问题 This is pretty much This question with a bit more information. My goal is to work out the languages installed in the system. The following command locale -a displays all the languages (in a format such as en_AU.utf8). This seems to correspond to the contents of /usr/lib/locale. Furthermore, invoking LANG=fr_FR.utf8 locale -ck LC_IDENTIFICATION Gives information of that particular locale which includes the language name (Which in this case is French). This seems to be the information contained

C++ What is the role of std::ctype<char>::widen()?

蓝咒 提交于 2020-06-27 06:57:35
问题 According to the C++ standard (§30.7.5.2.4 of C++17 draft (N4659)), out << ch will not perform a widening operation on ch , if ch is a char and out is a std::ostream . Does this imply that std::ctype<char>::widen() (i.e., char -> char ) is guaranteed by the standard to be an identity function ( widen(ch) == ch ) for all characters in the basic source character set? If so, does this, in turn, imply that all locales are required by the standard to use the same non-wide (or multi-byte) encoding