locale

Thread.CurrentThread.CurrentCulture not working in a thread inside a threadpool

拈花ヽ惹草 提交于 2019-12-23 09:16:42
问题 I have a method which will be called inside a thread and those threads are managed by threadpool. The method is calling a DLL's method which unfortunately requires a specific locale for being performed correctly. Before puting this method to be ran by threadpool, I've tested it while running in application's main thread and also while I manually manage the threads and it works fine, but when I put it into work inside a threadpool, locale is not applied and consequently the method does not

Character classification

南笙酒味 提交于 2019-12-23 08:53:26
问题 The simple question again: having an std::string , determine which of its characters are digits, symbols, white spaces etc. with respect to the user's language and regional settings (locale). I managed to split the string into a set of characters using the boost locale boundary analysis tool: std::string text = u8"生きるか死ぬか"; boost::locale::boundary::segment_index<std::string::const_iterator> characters( boost::locale::boundary::character, text.begin(), text.end(), boost::locale::generator()(

How to format numbers and dates based on user locale settings?

微笑、不失礼 提交于 2019-12-23 08:09:08
问题 I need a way to automatically format Date and Number objects based on locale settings of my users. So far, I've been using toLocaleString() function for dates. For numbers, toLocaleString() is also available, but as you can see in the jsFiddle I've prepared, results vary greatly between browsers. With English (United States) locale on my Windows machine, I get this: IE9: 15,000.00 Firefox: 15,000 Chrome: 15000 In Chrome, it seems like toLocaleString() does not work at all for numbers. Except

How to format numbers and dates based on user locale settings?

北慕城南 提交于 2019-12-23 08:09:03
问题 I need a way to automatically format Date and Number objects based on locale settings of my users. So far, I've been using toLocaleString() function for dates. For numbers, toLocaleString() is also available, but as you can see in the jsFiddle I've prepared, results vary greatly between browsers. With English (United States) locale on my Windows machine, I get this: IE9: 15,000.00 Firefox: 15,000 Chrome: 15000 In Chrome, it seems like toLocaleString() does not work at all for numbers. Except

Modify main window's locale after user changes settings in Control Panel->Regional and Language Options

丶灬走出姿态 提交于 2019-12-23 03:56:12
问题 INTRODUCTION AND RELEVANT INFORMATION: I have MS Access 2007 database which I fill using ADO . Among other data types ( string , integer ...) I also have a double . Since I work on Windows XP and use pure Win32 API to create GUI, I collect data from edit controls with GetDlgItemText API and then I convert that text into double using _wtof_l . PROBLEM: Everything works well if the user sets English or Serbian ( we use European notation for decimal and group separator ) locale and then starts

Change locale in android app (onto Hindi)

我只是一个虾纸丫 提交于 2019-12-23 03:47:24
问题 Creating multi languages support for the app with possibility to change language in App settings. As for now everything works fine for English, Spanish, Franch, Russian languages, but doesn't work for Hindi and Chineese. 1) I specify the language name in original language but in the app instead of हिन्दी I can see "Hindi". \res\values-hi\arrays.xml <?xml version="1.0" encoding="utf-8"?> <resources> <string-array name="languages"> <item name="english">English</item> <item name="russian"

Performant way of formatting numbers according to the user's locale with iostream?

 ̄綄美尐妖づ 提交于 2019-12-23 03:39:35
问题 In one part of our application there is the requirement to format numbers according to the user's locale. The interface essentially looks like this: std::string format_number(double number); The old implementation looked like this: std::string format_number(double number) { using namespace std; static const locale user_loc(""); ostringstream fmtstream; fmtstream.imbue(user_loc); fmtstream << std::fixed; fmtstream << number; return fmtstream.str(); } We have now noticed that with our compiler

android strings.xml in various languages, scenario

六眼飞鱼酱① 提交于 2019-12-23 03:07:20
问题 I have a strings.xml question My app is in english. values/strings.xml is in English there are many other languages in the app too my latest string key additions are in values-en/strings.xml , the english locale folder , but not in values the default language folder how will this affect a non-english user that loads a view which tries to access the strings only defined in values-en ? will the OS find the string in that one file and display it in english? this is tricky to me because it is not

Spring localechangeinterceptor not working

核能气质少年 提交于 2019-12-23 02:17:16
问题 I searched many topics but I couldnt find a solution.My internalization works when i set defaultlocale in spring-servlet.xml, but I cannot change locale when i clicked link and set new locale. English My xml is below ; <?xml version="1.0" encoding="UTF-8"?> <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:c="http://www.springframework.org/schema/c" xmlns:cache="http://www.springframework.org/schema/cache" xmlns:context=

How to get Geocoder’s results on the LatLng’s country language?

廉价感情. 提交于 2019-12-23 02:09:19
问题 I use reverse geocoding in my app to transform LatLng objects to string addresses. I have to get its results not on device’s default language, but on the language of the country where given location is settled. Is there a way to do this? Here’s my code: Geocoder geocoder = new Geocoder(context, Locale.getDefault()); List addresses; try { addresses = geocoder.getFromLocation(location.latitude, location.longitude, 1); } catch (IOException | IndexOutOfBoundsException | NullPointerException ex) {