locale

Android - Comma as decimal separator on Numeric Keyboard

送分小仙女□ 提交于 2020-08-24 06:34:50
问题 We need to have a numeric keyboard for an EditText . The Keyboard should have decimal separator based on the device's selected locale. We implemented this by setting the custom DigitsKeyListener to the EditText public class NumericDigitsKeyListener extends DigitsKeyListener { @Override protected char[] getAcceptedChars() { char[] acceptedCharacters = null; acceptedCharacters = new char[] { '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', new DecimalFormatSymbols(Locale.getDefaultLocale())

Carbon locale not respected?

穿精又带淫゛_ 提交于 2020-08-19 16:57:33
问题 In my Laravel 6 app, I have Carbon::now()->locale() returning it as it should be. As confirmation that the locale is loaded, Carbon::now()->monthName correctly outputs febbraio . BUT Carbon::now()->format('F') and Carbon::now()->formatLocalized('%B') both return the english version February . Why does the first function output the correct localized month while the others do not? 回答1: Apparently, formatLocalized() is somehow deprecated or not working as intended. From the Carbon docs: You also

Changing app locale sometimes doesn't change direction of layouts

♀尐吖头ヾ 提交于 2020-07-23 07:34:19
问题 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.

Changing app locale sometimes doesn't change direction of layouts

萝らか妹 提交于 2020-07-23 07:33:16
问题 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.