locale

Number Normalization for Zend Framework 2

寵の児 提交于 2019-12-13 06:36:05
问题 I'm trying to normalize a number from a form, which will/could be in the local number format. e.g. Locale:en-US 1,234.56 -> 1234.56 Locale:nl-NL 1.234,56 -> 1234.56 Is there an equivalent in ZF2 to the ZF1 Zend_Locale_Format::getNumber ? Thanks in advance Aborgrove. 回答1: You mean something like the numberFormat Filter? 来源: https://stackoverflow.com/questions/17595260/number-normalization-for-zend-framework-2

QLocale::Language — traditional and simplified chinese?

独自空忆成欢 提交于 2019-12-13 05:49:25
问题 According to: http://doc.qt.io/qt-5/qlocale.html there is only one language for Chinese: QLocale::Chinese (value: 25). How to differentiate between traditional and simplified Chinese? 回答1: it's not about country. it's about script: QLocale::setDefault(QLocale(QLocale::Chinese, QLocale::SimplifiedChineseScript)); QLocale::setDefault(QLocale(QLocale::Chinese, QLocale::TraditionalChineseScript)); 回答2: You should use an alternative method by locale name. This: QLocale chiness("zh"); // for

printf output not affected by global locale?

淺唱寂寞╮ 提交于 2019-12-13 04:49:36
问题 I cannot get the printf functions in Visual-C++ (VS 2005) to output thousands separator in my integers. Note: Comments indicate that this is printf 's normal behaviour. However, C++ iostream does insert the thousands separator into numbers (tested with std::stringstream and imbue ) so is this purely a feature of iostreams and isn't present in the "C" formatting functions? Here's the test code: setlocale(LC_ALL, ""); // -> User locale _locale_t loc = _create_locale(LC_ALL, ""); // -> user

Android N - Change Locale in runtime

大兔子大兔子 提交于 2019-12-13 03:18:38
问题 I have an android app to which I want to add a simple preferences screen with a single option to switch between to languages (english and portuguese). I have already the proper string resources files in place. If I change the main language of the OS in the system preferences, and reload the app, it will use that language, however I would like to be able to do it via the preferences screen. I saw in other questions here that in this was a lot easier to do in previous Android versions, but that

Coldfusion: cfspreadsheet reading date incorrectly

徘徊边缘 提交于 2019-12-13 02:56:27
问题 Im using cfspreadsheet to read data from spreadsheets inside one of my applications. I've had a great deal of difficulty dealing with date columns. If I format the cell as date english (NZ) it displays right in the spreadsheet, but when I try to upload it switched the day and month. But If I change the format to a custom "dd/mm/yyyy" format it will upload without a problem. Why would using the default date formats within the spreadsheet mess up the format when a custom one doesn't? Is there a

Managing dynamic localisation resources

六月ゝ 毕业季﹏ 提交于 2019-12-13 02:01:43
问题 For the sake of this question, imagine my application helps users to practice foreign languages. They press a button to start the Text to Speech introduction, which speaks: <string name="repeat_after_me" translatable="true">Repeat after me</string> This string will be localised in the normal way, fetching the string from the appropriate res/values-lang/strings.xml file according to the device Locale. After the introduction, the app needs to speak any one of a random number of strings, in the

date string is showing question marks

折月煮酒 提交于 2019-12-13 00:57:41
问题 I am using Eclipse 4.5.1 Mars. I have a very simple program which just use Hindi as locale and print out the date in a format: But when run it, the console print out question marks. But if I remove the Hindi locale, it prints out correct date string. Why? How to fix the question mark problem? ====== CODE BELOW ======== public static void main(String[] args) { Locale.setDefault(new Locale("hi", "IN")); Calendar calendar = new GregorianCalendar(TimeZone.getDefault(), Locale.getDefault()); //

Example of date_time_period boost::locale::period::first_day_of_week(int v)

☆樱花仙子☆ 提交于 2019-12-12 19:09:12
问题 In boost::locale document it says: date_time_period boost::locale::period::first_day_of_week(int v) [inline] Get date_time_period for: First day of week, constant, for example Sunday in US = 1, Monday in France = 2 Those functions which return date_time_period can be used to create custom boost::locale::date_time objects. I tried to create one with std::locale set to "en_US.UTF-8" , so the first day of week is default to Sunday, and then modified it to Monday. Here's the code: #include

Why does the Java Extension Mechanism not check the classpath for an optional package implementing LocaleServiceProvider?

99封情书 提交于 2019-12-12 16:46:48
问题 I have created a maven project L and written a Java extension (i.e. an optional package) implementing (i.e. extending) the (abstract) service providers that implement (i.e. extend) LocaleServiceProvider, to support a dialect (let's call it xy ) that isn't normally supported by the JRE. (I do not want to use the CLDR extension that came with Java 8, even though I'm running 8.141.) The project compiles, and produces a jar with a META-INF/services folder that contains the provider-configuration

Manipulate the list of countries provided by Symfony Intl and the form choice type

一曲冷凌霜 提交于 2019-12-12 16:15:59
问题 Politics aside, I need to provide Kosovo as a form choice when selecting a country. What's the most elegant way of doing this with Symfony's built-in form choice type country , while also providing translations for the Kosovo name? Here's what I've done so far and it works but I'm concerned this might be a bit hack-ish. <?php namespace Acme\Bundle\DemoBundle\Form\Type; use Symfony\Component\Form\AbstractType; use Symfony\Component\Form\FormBuilderInterface; use Symfony\Component