locale

Android - Listening to a locale change without static variables

◇◆丶佛笑我妖孽 提交于 2019-12-25 15:53:55
问题 I have a BroadcastReceiver that listens to a locale change. Here's my problem: I navigate to an Activity and then want to change locale (language setting) which I do by going to the settings app. The BroadcastReceiver then listens in onReceive() once a change is made. I then navigate back to the app and when I do so I'd like to take a user to another Activity . Also, a locale modification corresponds to a change in configuration which means an Activity will be destroyed and created again.

Android - Listening to a locale change without static variables

半世苍凉 提交于 2019-12-25 15:52:57
问题 I have a BroadcastReceiver that listens to a locale change. Here's my problem: I navigate to an Activity and then want to change locale (language setting) which I do by going to the settings app. The BroadcastReceiver then listens in onReceive() once a change is made. I then navigate back to the app and when I do so I'd like to take a user to another Activity . Also, a locale modification corresponds to a change in configuration which means an Activity will be destroyed and created again.

Postgres lc_numeric not working as expected

落爺英雄遲暮 提交于 2019-12-25 08:20:35
问题 I'm on a project that involves a database that uses Danish numeric settings (the decimal separator is a comma). I'm trying to figure out how I can store values in the database as decimal/number/anything but text, but have them keep the comma separator. I've updated the lc_numeric setting in the AWS Parameter group to da_DK, which I found online to be the Danish locale setting, but values are still showing with the period instead of the decimal. What changes need to be made/is this possible?

Include user locale to the Keycloak ID token

别等时光非礼了梦想. 提交于 2019-12-25 07:54:24
问题 I would like Keycloak (1.4.0) to include the users' chosen locale to the ID token. I have come as far as creating a user attribute mapper, which was supposed to map the locale attribute to the token, but it does not work. Does anybody know how to do this? Thanks in advance. Edit: I have learnt what I know abput Keycloak Locales from this class: http://grepcode.com/file/repository.jboss.org/nexus/content/repositories/releases/org.keycloak/keycloak-forms-common-freemarker/1.2.0.Final/org

What does constitute one character for regcomp? Which multibyte encoding does determine this?

血红的双手。 提交于 2019-12-25 07:51:02
问题 regcomp (from glibc) is a POSIX function for compiling regular expressions. int regcomp(regex_t *restrict preg, const char *restrict pattern, int cflags); There are some constructions in regular expressions which depend on the idea of a single character, for example [abc] . If a multibyte encoding is used and a multibyte letter is used in the expression, the interpretation would be different if it treated either as a byte-sequence or a sequence of multibyte letters. Here I illustrate this

How can I print a day of the week in a locale-friendly way using NSDateFormatter?

陌路散爱 提交于 2019-12-25 06:26:50
问题 I noticed NSDateFormatter allows for an enum called .FullStyle that will print Tuesday, April 12, 1952 AD . But how do I just print Tuesday in a locale-safe way? 回答1: You need to use NSDateFormatter dateFormat = "cccc" . If you need a reference for date format patterns you can take a look at this link: extension NSDate { struct Formatter { static let dayOfWeek: NSDateFormatter = { let formatter = NSDateFormatter() formatter.dateFormat = "cccc" // Stand Alone local day of week return formatter

How to parse “1,234.56” in Java as Double?

百般思念 提交于 2019-12-25 05:33:30
问题 I am having trouble parsing "1,234.56" in Java, a similar question recommend using French locale in number formatting, but it is parsing the result incorrectly. Here is what I have: NumberFormat format = NumberFormat.getInstance(Locale.FRANCE); Number number = format.parse("1,234.56"); System.out.println(number.doubleValue()); // Should get 1234.56, got 1.234 instead Number number = format.parse("1,234,567.89"); System.out.println(number.doubleValue()); // Should get 1234567.89 回答1: 1,234.56

How to set Locale on GSON (for decimal number separators)

最后都变了- 提交于 2019-12-25 05:13:31
问题 I know you can set date formatting, but how do you set other locale specific stuff like decimal number formatting? (I mean comma vs. dot) 回答1: Short answer: you don't. You seem to be somewhat confusing the textual representation of a number and an actual numeric value. While JSON is a text-based data interchange format, a number (vs. a string) in JSON is a numeric value and is not affected by locale. Section 2.4 of the JSON specification provides the specific definition (emphasis mine): 2.4.

How to change LOCALE language on Lumen

故事扮演 提交于 2019-12-25 03:42:37
问题 I saw this question, but it don't answers me. I have set APP_LOCALE=fr in the .env file, but I still get date in english format : string 'Thursday, 09h00' (length=15) And I would like to get : string 'Jeudi, 09h00' (length=12) How to change from english to french on Lumen Framework ? (Added PHP tag to be more seen) 回答1: In lumen you cannot set the locale in your config. You can however change the locale in code by using app('translator')->setLocale($locale); . In my own projects I set the

how to set default value of the spinnerlist

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-25 02:34:42
问题 In Android I am fetching json data from web.I the list is like {Name,dial,code} I have this countryinfo = new ArrayList<CountryInfo>(); Countrylist = new ArrayList<String>(); try { for (String line : result) { jsonarray= new JSONArray(line); for (int i = 0; i < jsonarray.length(); i++) { jsonobject = jsonarray.getJSONObject(i); CountryInfo conpop = new CountryInfo(); conpop.setName(jsonobject.optString("Name")); conpop.setIso(jsonobject.optString("dial")); conpop.setItu(jsonobject.optString(