locale

locale Facet Constructor Ignored

人盡茶涼 提交于 2019-12-12 07:27:13
问题 The locale Facet constructor: Constructs a copy of other except for the facet of type Facet (typically deduced from the type of the argument) which is installed from the argument facet. If facet is NULL, the constructed locale is a full copy of other. The locale constructed in this manner has no name. I try to construct using my Facet here, but when I put a break-point in my do_decimal_point and do_thousands_sep they are never called :( I can see the Facet being passed in, but it's passed

Get local currency in swift

这一生的挚爱 提交于 2019-12-12 07:25:24
问题 I am setting up an little in app purchase store for muliple countries. How can I figure out that I have to show up the price in Dollar, Euro etc... I think it have to do with the localeIdentifier but I am not sure how to handle this 回答1: You can get the currency symbol and code from (NS)Locale with Swift 1 and 2 let locale = NSLocale.currentLocale() let currencySymbol = locale.objectForKey(NSLocaleCurrencySymbol)! let currencyCode = locale.objectForKey(NSLocaleCurrencyCode)! Swift 3 let

Android Localization

被刻印的时光 ゝ 提交于 2019-12-12 07:14:46
问题 The following code is for changing app locale into Spanish is working fine in some devices, but in some devices it is enlarging (zooming) the views in the app. Does anyone have a the solution? Configuration config = getResources().getConfiguration(); // change this to a different Locale than your device Locale locale = new Locale("es", "es_ES"); config.locale = locale; Locale.setDefault(locale); getBaseContext().getResources().updateConfiguration(config, getResources().getDisplayMetrics());

How to convert Euro currency string to float number?

怎甘沉沦 提交于 2019-12-12 05:37:28
问题 I need to convert a string currency string in Continental Europe format into a float number: Input: '6.150.593,22 €' Realize that decimal point is comma, and thousands separators are period characters. Output: 6150593.22 I'd read these questions, but they only works for US dollar currency and locale: How do I convert a currency string to a floating point number in Python? python: how to convert currency to decimal? currency_euros='6.150.593,22 €' float(currency_euros[:-2]) Traceback (most

Android - Change app locale manually on button click

放肆的年华 提交于 2019-12-12 05:24:06
问题 I want to change the application's Locale (language) to change programmatically when user wants to switch between Hindi and English using change language button. I have a code to change language in place but it works only when I call in in the onCreate() of an activity before setContentView() method. Any help is much appreciated. 回答1: See here my answer Android Font in more then one langauge on single screen for example if you want your application to support both English and Arabic strings

Convert da-DK to Danish (Denmark) etc

≡放荡痞女 提交于 2019-12-12 05:15:12
问题 How do I convert locale ids into display languages and countries in Java. For instance, I have a list of locales in this format: "da-DK" and I want them all to show as "Danish (Denmark)". Here is my code so far: public void getAvailableLocales() { systemLanguages = Resources.getSystem().getAssets().getLocales(); Arrays.sort(systemLanguages); for (int i = 0; i < systemLanguages.length; i++) { String sL = systemLanguages[i]; Locale loc = new Locale(sL); String locDisplayResults = loc

Silex redirect changing the locale

你说的曾经没有我的故事 提交于 2019-12-12 05:05:16
问题 I am using Silex 2 and I would like to redirect to homepage with default locale if any url is loaded using an invalid locale. // homepage / root $this->get('{_locale}/', function (Request $request) use ($app) { return $app['twig']->render('index/index.html.twig', array()); })->bind('homepage'); Before middleware: // i18n Control $locale = $request->getLocale(); $allowLocale = ['en','es','de']; if (!in_array($locale, $allowLocale)) { $request->setLocale('en'); $response = new \Symfony

Locale-dependent PHP functions

◇◆丶佛笑我妖孽 提交于 2019-12-12 05:01:38
问题 I’m moving a PHP website to a hosting that unfortunatelly doesn’t support ru_RU.cp1251 locale which the site uses extensively. The only way out of the problems I can see is to refactor the code such that it becomes locale-independent. Is there a way to safely do this? For example is there a list of all native PHP functions that can depend on current locale? 来源: https://stackoverflow.com/questions/12942088/locale-dependent-php-functions

PHP: Get current locale using timezone

最后都变了- 提交于 2019-12-12 04:37:47
问题 I am using timezone to get exact time of a user according to his timezone. I have a drop down list to select timezone for users and showing their current time as they selected their timezone. The code i am using is: $timezone = 'America/New_York'; date_default_timezone_set($timezone); echo date('H:i:s A'); It is working fine. I want to get locale of that user using timezone in the same way I am getting current time for that timezone. How can I achieve the current locale using timezone? Does

Liferay: changing locales for a site programmatically

杀马特。学长 韩版系。学妹 提交于 2019-12-12 04:18:03
问题 Is there a way to change the status of site´s locales programatically? I have to make a script that implies changing locales for some sites of our portal. In other words, having an object Group, I´d like to change the locales in its settings. http://i.stack.imgur.com/Xypas.png Note we are using Liferay Portal 6.2. Thanks in advance. EDIT for clarifying: I´m executing the script through Control Panel -> Server admin -> Script. Here is where I have the problem commented: /