locale

VB.net Decimal.toString() for any Region

I have an app that deals with currency. For display purposes I use the nifty VB FormatCurrency function which will format based on the OS's region setting. So, if in France you might get 123,45 where in the US you would get 123.45. To perform calculation on these amounts I use CDec() to convert to decimal. My problem is that when I c...

Is it possible to add languages/locales to SQL Server 2005?

The contents of sys.syslanguages lists several languages/locales, however is it possible to add languages? For example, I'd like to add Australian English and Canadian French. Any help is appreciated! ...

iPhone - how to get user's date format

Hi, How can I know what date format user prefers? Is there a way to read it from phone's local settings? Does the user prefer to read date in format "dd/mm/yyyy" or "mm/dd/yyyy"? Thank you in advance. ...

Locale date format in PHP5

Hi, my site changes its locale dependent upon either user settings or browser settings (where the user hasn't set their preference). I am using amline charts, the stock chart specifically, which requires the date format in 'MM/DD/YYYY' or 'DD-MM-YYYY', I guess so the chart knows how to understand the dates. There are many ways to format ...

Java/Servlet: get current sql.Date

What I need to do is: 1) Get user's locale from request. 2) Create new sql.Date object with current date and time, based on user's locale 3) Write it in MySQL db, column type: TIMESTAMP What I got is: java.util.Locale locale = request.getLocale(); java.text.DateFormat dateFormat = java.text.DateFormat.getDateTimeInstance( ...

Is there a naming convention for locale-specific static files?

I have some static resources (images and HTML files) that will be localized. One piece of software I've seen do this is Apache, which appends the locale to the name; for example, test_en_US.html or test_de_CH.html. I'm wondering whether this naming scheme is considered standard, or whether every project does it differently. ...

Locale-aware JavaScript validation

Can you suggest a locale-aware way to validate a currency value on the client using Javascript? Obvious issue to consider: 1,234.56 in the US and UK is the same as 1.234,56 in most of Europe Sri ...

how do you read locale information from session?

The following bit of code sets the Locale from lang param on querystring. <c:if test="${param['lang'] != null}"> <fmt:setLocale value="${param['lang']}" scope="session"/> </c:if> How do I now read that variable? I know its a bit noobish. I need a bit of conditional logic to display one language link if the local hasn't been set ...

Java Locale Font question..?

[EDIT] this happend on OSX with Java 1.5! (but may also happen on Windows!) It seems japanese users of my Java Swing program cannot write japanese symbols in JTextFields. Actually they can write them but do not see them. They only see blocks which somehow indicates I think that the font does not support these symbols. I set my own font...

Setting the locale via RCP-Designer...

Hello! Is there an option in the reportfiles for BIRT to enforce a locale? I want my reports to have a german number formating no matter what. Thanks in advance!:-) ...

How do you convert character case in UNIX accurately? (assuming i18N)

I'm trying to get a feel for how to manipulate characters and character sets in UNIX accurately given the existance of differing locales - and doing so without requiring special tools outside of UNIX standard items. My research has shown me the problem of the German sharp-s character: one character changes into two - and other problems....

Find out the language windows was installed as

I have a problem where the user has set their locale (German) which is different that the Language Windows was installed as (English). Is there a way to discover what language windows was installed to use vs. what locale the user has set? I should note the issue is I am creating a Share and I set the permissions based on the Locale so if...

In Java, is there any way to get a Locale given its display name?

That is, if I have "English (United States)" I'd like to get "en-US", or an appropriate java.util.Locale. It looks like the API is a one-way street, but perhaps I'm not looking in the right place. Thanks in advance. ...

Calculate user’s time using TimezoneOffset

Hi, I am trying the get the user’s local time to store into my database. I cannot use PHP function now() as it returns the server’s time. I have got the TimezoneOffset by using JavaScript: d = new Date(); alert(d.getTimezoneOffset()/60); How can I calculate the time by using this? And what type should I use for MySQL data type? Than...

Locale date formatting in Python

How do I get datetime.datetime.now() printed out in the native language? >>> session.deathDate.strftime("%a, %d %b %Y") 'Fri, 12 Jun 2009' I'd like to get the same result but in local language. ...

double string conversion and locale

A common international issue is the conversion of double values represented in strings. These stuff is found in a lot of areas. Starting with csv files which are either called comma separated or character separated because sometimes they are stored like 1.2,3.4 5.6,6.4 in English regions or 1,2;3,4 5,6;6,4 in for example Ger...

JSpinner editor locale

I'm creating a JSpinner and setting a NumberEditor with a custom format. But no matter what I do the format uses "." instead of ",", not according to my locale (pt_BR). priceSpinner = new JSpinner(); priceSpinner.setEditor(new JSpinner.NumberEditor(priceSpinner, "0.00")); Is it possible to use "," instead of "." as a decimal separato...

How can I convert an Integer to localized month name in Java?

I get an integer and I need to convert to a month names in various locales: Example for locale en-us: 1 -> January 2 -> February Example for locale es-mx: 1 -> Enero 2 -> Febrero ...

Source of data for "official" country/region list

Hi everyone, Lately we've started getting issues with outdated countries / regions list being presented to users of our web-application. We currently have a few DB tables to store localized country names along with their regions (states). However as the planet goes, that list is in constant evolution and it's proving to be a pain to...

IsValidLocale returns FALSE - how to overcome this?

When run on a Spanish version of Windows XP my program invokes LANGID langId = (LANGID) MAKELANGID( LANG_ENGLISH, SUBLANG_DEFAULT ); LCID locale = MAKELCID( language, SORT_DEFAULT ); BOOL isValid = IsValidLocale( locale, LCID_INSTALLED ); IsValideLocale() return FALSE when asked about English locale. Obviously something must be tuned...