locale

In C#, how to get the “Country or region” selected under “Region & language” in Windows 10?

China☆狼群 提交于 2019-12-22 18:32:53
问题 I am running Windows 10. When I open "Region & language settings" from the start menu, I can select a "Country or region". I am trying to get this value in a C# program. I am in Denmark. I have tried changing my country to Germany (see screenshot), but I cannot get my code to return Germany. Rebooting the computer did not help. I have written some code inspired by this thread. My code looks like this (trying various things at once, getting all the region/culture things I can think of):

zend locale with url routing

懵懂的女人 提交于 2019-12-22 18:31:49
问题 Is there a simple way of using zend routes and locales in the URL to force the loading of a particular locale? e.g. - http://domain.com/en-US/controller1/action So the language-Region should prefix all URL calls and just set the locale in the bootstrap but let the rest of the MVC routing work as normal. ideally it could detect if no language-Region is in the URL and attempt to autodetect from the browser. e.g. - http://domain.com/ (if no locale is found - defaults to en-US/index) I've seen

zend locale with url routing

我与影子孤独终老i 提交于 2019-12-22 18:30:19
问题 Is there a simple way of using zend routes and locales in the URL to force the loading of a particular locale? e.g. - http://domain.com/en-US/controller1/action So the language-Region should prefix all URL calls and just set the locale in the bootstrap but let the rest of the MVC routing work as normal. ideally it could detect if no language-Region is in the URL and attempt to autodetect from the browser. e.g. - http://domain.com/ (if no locale is found - defaults to en-US/index) I've seen

How to add multilanguage support to a Yocto build?

给你一囗甜甜゛ 提交于 2019-12-22 18:15:26
问题 I'm trying to add multilanguage support to a Yocto build. Reading the official documentation I've found that the build options that controls locale settings are: GLIBC_GENERATE_LOCALES IMAGE_LINGUAS Link: http://www.yoctoproject.org/docs/1.8/mega-manual/mega-manual.html#var-GLIBC_GENERATE_LOCALES After a build with the following options: GLIBC_GENERATE_LOCALES="en_GB.UTF-8 en_US.UTF-8" IMAGE_LINGUAS?="en-gb" if I ask to "localectl" the list of available locales, nothing is displayed (command:

List all the installed or supported languages in an android phone

℡╲_俬逩灬. 提交于 2019-12-22 13:59:32
问题 How to get list of all the installed or supported languages that are listed under "Language and Input settings" programmatically in android. I have used Resources.getSystem().getAssets().getLocales() but it gives me only code of that language like en, en_us but I need both code and display name. I have also tried with Locale.getAvailableLocales() but it gives me repeated items and too big list. Please tell me what is the correct way of doing this. 回答1: getAvailableLocales() gives you all

symfony2 detect locale based on domain name

梦想的初衷 提交于 2019-12-22 10:47:19
问题 i want to setup a new website with 2 locales and the locale should detected by the domain name that's used. Any idea how to do this? for example locales: nl and fr when www.somenldomainname.be is used then the nl locale should be detected when www.somefrdomainname.be is used then the fr locale should be detected it would also be great if i generate an url in nl or fr the right domain name is selected. kind regards, Daan 回答1: You can create an event listener to detect your domain name: class

How to get 12 hour format time string when system is set to use 24 hour format

眉间皱痕 提交于 2019-12-22 10:38:17
问题 I want to get a time string like "10:00 PM", and I use the NSDateFormatterShortStyle to achieve this. However when the system is set to use 24-hour format, what I got is "22:00". Besides, I want to get a localized time string. For example, in Chinese, I want to get "下午10:00" instead of "10:00 PM". So I have to use the [NSLocale currentLocale], and can't use the en_US_POSIX locale. Please help me to get a localized 12-hour format time string. I need not only the hour part, and also the am/pm

Is there a way to get locale from country or timezone?

戏子无情 提交于 2019-12-22 09:37:50
问题 I was programming a program in Python, where I need to output date as per user's locale: Get a list of timezones in a country specified as per user input (did that using pytz) Get the locale of the user (which I am unable to figure out how to do) Is there a way to get locale from county/timezone or some other method needs to be followed? Or do I need to get the locale input from user itself? EDIT The program is to be a web-app. The user can provide me his country. But does he have to

Ordering differences between Postgres instances on different machines (same locale)

自闭症网瘾萝莉.ら 提交于 2019-12-22 09:04:10
问题 I have two Postgres 9.1 instances: one local, installed via Postgres.app on OS X, and one remote, on Heroku. I've ensured that lc_collate is en_US.UTF-8 on both machines but am still seeing different behavior between the two. On my local instance, SELECT 'i' > 'N' returns t whereas remotely it returns f . Given that I've already checked lc_* on both systems, what explains the difference I'm seeing? 回答1: From the point of view of Unicode, the case ordering is a customization. Excerpt from http

How do I get locale day and month?

柔情痞子 提交于 2019-12-22 08:26:15
问题 I'm using the following function to retrieve date and time: function formatEventTime($time, $type, $locale = 'nb_NO') { setlocale(LC_TIME, $locale); switch($type) { case 'date' : $format = '%d.%m'; break; case 'dm' : $format = '%d. %B'; break; case 'time' : $format = '%H:%M'; break; case 'dmy' : $format = '%d.%m.%Y'; break; } return strftime($format, strtotime($time)); } wher $time = 2010-12-03 10:00:00 . The problem is that my days and months are still in English. How do I change this to e.g