locale

How to format dates based on locale?

大兔子大兔子 提交于 2019-12-22 06:03:24
问题 In a template I display the day and month of a specific date : <div class="jour"><?php echo date('d',strtotime($content->getCreatedAt())) ?></div> <div class="mois"><?php echo date('M',strtotime($content->getCreatedAt())) ?></div> This works fine, problem is the month name is in English. Where do I specify that I want the month names in another locale, French for instance ? 回答1: Symfony has a format_date helper among the Date helpers that is i18n-aware. The formats are unfortunately badly

How to get boost::system::error_code::message in English?

懵懂的女人 提交于 2019-12-22 04:43:12
问题 On Win7 having localized UI, error_code::message() returns a non-English message. As far as I see (in Boost 1.54, for system_error_category ), the above function boils down to the following WinAPI call: DWORD retval = ::FormatMessageA( FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS, NULL, ev, MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), // Default language (LPSTR) &lpMsgBuf, 0, NULL ); How to get the above FormatMessage to return an English message?

How to get boost::system::error_code::message in English?

不想你离开。 提交于 2019-12-22 04:43:06
问题 On Win7 having localized UI, error_code::message() returns a non-English message. As far as I see (in Boost 1.54, for system_error_category ), the above function boils down to the following WinAPI call: DWORD retval = ::FormatMessageA( FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS, NULL, ev, MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), // Default language (LPSTR) &lpMsgBuf, 0, NULL ); How to get the above FormatMessage to return an English message?

how to get locale information on a GWT application

…衆ロ難τιáo~ 提交于 2019-12-22 04:12:28
问题 In GWT I have to specify what locales are supported in my application. The code get compiled in various files, one for each locale (beside other versions), but I have to give my clients one only URL. This URL is supposed to be a page that should be displayed according to the locale preferred by the browser. I dont't want to have an HTTP parameter for the locale since I want to forse the locale preferred by the browser. How can this be coded in GWT? Should I try to to this using apache rewrite

C++ reset locale to “C” globally?

我是研究僧i 提交于 2019-12-22 04:10:51
问题 In a project I am currently working on I link to a proprietary dynamic library. As soon as I run the library's initialize function, the behavior of logging and printing of numbers changes. Commas have been inserted at every third decimal. Ie. cout << 123456789 << endl used to print out 123456789 and now it prints 123,456,789 . This is horribly annoying, because this behavior is not what I want. This issue is not only apparent in the binary I am compiling, but also shows up in all the couts

C++ reset locale to “C” globally?

时间秒杀一切 提交于 2019-12-22 04:10:48
问题 In a project I am currently working on I link to a proprietary dynamic library. As soon as I run the library's initialize function, the behavior of logging and printing of numbers changes. Commas have been inserted at every third decimal. Ie. cout << 123456789 << endl used to print out 123456789 and now it prints 123,456,789 . This is horribly annoying, because this behavior is not what I want. This issue is not only apparent in the binary I am compiling, but also shows up in all the couts

Get English exception message instead of local language

孤者浪人 提交于 2019-12-22 04:08:51
问题 On Windows 8 using Visual Studio 2012 RC on a german system, I get all my Exceptions localized to german, which effectively means I can't google anything useful for them. To solve this, I already used the following to change my IDE to english language: Tools --> Options --> Internetional Settings --> Language --> English Nevertheless, I get my exceptions in the localized german language. I tried changing the ThreadUI Culture in code using this code: Thread.CurrentThread.CurrentUICulture = new

JSF Locale Change Listener not persistent

て烟熏妆下的殇ゞ 提交于 2019-12-22 01:32:07
问题 In my WebApp I created a managed Bean that allows me to change the Locale from French to english and vice versa using Event Change Listener. package beans; import java.util.Locale; import javax.faces.bean.ManagedBean; import javax.faces.bean.SessionScoped; import javax.faces.context.FacesContext; @ManagedBean @SessionScoped public class LocaleBean { private Locale locale = FacesContext.getCurrentInstance().getViewRoot().getLocale(); public Locale getLocale() { return locale; } public String

python / will c local change string.punctuation

僤鯓⒐⒋嵵緔 提交于 2019-12-21 21:25:08
问题 According to the docs, string.punctuation contains: String of ASCII characters which are considered punctuation characters in the C locale. If I print string.punctuation I get !"#$%&'()*+,-./:;<=>?@[]^_`{|}~ Can I rely on that this string is always the same because it contains all ASCII punctuation characters or is the locale setting somehow important for this? (I am using Python 2.7 on Xubuntu 12.04 with LANG=en_US.UTF-8 ) 回答1: Yes - barring (very unlikely) future changes to ASCII or the C

Converting language names to ISO 639 language codes

早过忘川 提交于 2019-12-21 17:41:42
问题 I need to convert language names like 'Hungarian', 'English' to ISO 639 codes. ISO 639-6 would be the best but ISO 639-2 is good enough. What's the best way to achieve this? I should convert the English to locale and get the language with getLanguage()? If thats the only way how can I convert a string like 'English' to a java locale? My goal is to store book language info using the ISO 639 codes. 回答1: You can get a list of ISO 639-2 codes by passing a regular expression of language names to