locale

Symfony's NumberType as HTML5 input field and a custom locale setting

我是研究僧i 提交于 2019-12-12 04:15:37
问题 My application prefers de as locale to show numbers like 1.234.567,89 instead of 1,234,567.89 (or 1234567,89 instead of 1234567.89). So i have changed the local parameter in the config.yml : parameters: locale: de Furthermore i use the NumberType to generate my form fields: class MyFormType extends AbstractType { public function buildForm(FormBuilderInterface $builder, array $options) { $builder->add('myNumber', NumberType::class, [ 'label' => 'Tax [EURO]', 'required' => false, 'scale' => 2,

Localizing apps for non-standard locales

别说谁变了你拦得住时间么 提交于 2019-12-12 03:29:32
问题 I am writing an app which should support a language which is not in the list of available (40?) languages on the device, but the region format is. I want to localize the name of days as well as "yesterday...". The problem is, that days (Monday,...) are fetched using NSLocale and therefore work on any device, but words like "yesterday" have to be localised to a language amongst the 40 or so. Even though XCode lets me localize for the wanted region, the device uses the standard language, in my

Why does android:label's text not changing when user changes language within my app?

余生长醉 提交于 2019-12-12 03:03:58
问题 So within my app, the very first Activity that user sees is to choose language. Lets say if user chooses french and then goes to ActivityB, then to ActivityC. Now decides to changes language. So goes back to ActivityB and then to very first Activity and choses language as Spanish. Now again when user goes to ActivityB, all other text within the fragment/activity is changed to Spanish, but android:label still remains in French. how to fix this? This is how my ActivityA looks public View

How to access GetLocaleInfo from C#

馋奶兔 提交于 2019-12-12 02:44:50
问题 I'm converting a routine from VB6 (a language I do not know) to C#. In the VB6 code it has . . . LCID = GetThreadLocale rc = GetLocaleInfo(LCID, LOCALE_SDECIMAL, data, dataLen) So in my C#, in the class body, I've added [DllImport("kernel32.dll", SetLastError = true)] static extern int GetThreadLocale(); . . . which seems to allow me to make the first call. But in Googling GetLocaleInfo() I see conflicting information. On the web, in addition to the plain, vanilla GetLocaleInfo() , there's

How to change the locale of a formatted date in Powerpoint VBA

删除回忆录丶 提交于 2019-12-11 23:44:37
问题 in a powerpoint vba application I want to format a date according to the current spell-check language (which may or may not be the same as the system locale language). e.g. Locale is German(Austria) but the document is in English for an english customer, hence the date format should be "1st January 2015" and not "01. Jänner 2015" I found a solution for excel on this site: How to change the locale of a formatted date? trying the same technique in powerpoint vba does not appear to work: debug

Setting Language for Addthis Share Buttons

主宰稳场 提交于 2019-12-11 19:14:20
问题 When I click one of the share buttons, the popups and new pages are in English. Is there a way I can set them to be a different language? I have set the ui_language in addthis_conf but seeing as I am using custom images, I don't think that really matters. var addthis_conf = { ui_language: "fr" }; I know, for instance, that the native Twitter button uses the data-lang attribute to set the language of the popup content (https://dev.twitter.com/docs/tweet-button). Is there something like that I

Change language programatically in Android with country

徘徊边缘 提交于 2019-12-11 18:25:04
问题 I try to change my locale in an android application. If I use only language all is ok, but today I added portuguese-br translation to my app. Code: Locale locale; if(language.contains("-")) // In this case, the locale specify also the country { String[] country_locale = language.split("-"); locale = new Locale(country_locale[0], country_locale[1]); } else locale = new Locale(language); Locale.setDefault(locale); Configuration config = new Configuration(); config.locale = locale;

Localtion of pattern for date formats in java

蹲街弑〆低调 提交于 2019-12-11 18:22:46
问题 In java you can get the date format based for a specific locale by doing: Locale locale = new Locale("en", "UK"); DateFormat format = DateFormat.getDateInstance(DateFormat.MEDIUM, locale); System.out.println( ((SimpleDateFormat)format).toPattern()); This prints dd-MMM-yyyy Is this pattern hardcoded in a properties file somewhere? Is there any way I can extend the java mechanism and apply my own pattern (locale dependent) so when I run the above code I get: dd-MM-yyyy 回答1: The idea is to work

Fabric, can't get default locale on django

a 夏天 提交于 2019-12-11 18:18:32
问题 I have the following django management command: fabrictest.py from django.core.management.base import NoArgsCommand import locale class Command(NoArgsCommand): def handle_noargs(self, **options): print locale.getdefaultlocale() Which I can run locally: $ /home/user/env/bin/python manage.py fabrictest ('en_US', 'UTF-8') However, when I run the command remotely using the following fabric task @task def test(): # run manage.py using the python bin from the virtualenv with cd(env.project_root):

Changing the pattern for CHF currency in Java using icu package?

旧城冷巷雨未停 提交于 2019-12-11 17:44:04
问题 I wrote a java function that shows the locale pattern for each currency. See the function below. What I am interested to know is that why when the currency is CHF, the 2nd decimal is hardcoded to 5? Note that I am using icu package and this issue doesn't exist with java.util.Currency package. I am using the default locale of en_US. Here is the output of the function which is related to USD and CHF currencies: Analyzing currency: [USD] localePattern: [¤#,##0.00;(¤#,##0.00)] Currency symbol [$]