locale

Get localized language name from locale code

How can I get localized language name by specified locale code in python? For example: >> get_language_name('ja') >> ('Japanese', u'日本語') ...

gcc, UTF-8 and limits.h

My OS is Debian, my default locale is UTF-8 and my compiler is gcc. By default CHAR_BIT in limits.h is 8 which is ok for ASCII because in ASCII 1 char = 8 bits. But since I am using UTF-8, chars can be up to 32 bits which contradicts the CHAR_BIT default value of 8. If I modify CHAR_BIT to 32 in limits.h to better suit UTF-8, what do I ...

Using a locale-dependent sorting function in Ruby/Rails

What is a good approach to sorting an array of strings in accordance with the current locale? For example the standard Array#sort puts "Ä" after "Z", which is not correct in German. I would have expected the gem I18n to offer a hook for defining my own sorting algorithms or providing collation strings or objects. In my imagination, pas...

How to change default locale in BIRT

Hi everybody, I am working with the BIRT reporting engine and my current task is to implement internationalization for reports. We are using the webviewer to generate and download pdf reports. There is a parameter (__locale) which allows me to specify the locale that should be used to generate a report. So far everything works fine. T...

How to retrieve actual Locale/Language

Hi, can anyone tell me how I programmatically retrieve the actual Locale and/or Language in Android ? ...

Django's check_for_language always returns False

I have compiled Indonesian locale's .PO file into .MO file and installed it correctly with other locales. The problem is all other locales is working but when I tried to switch to id locale, get_language() always return "en". Any ideas about the reason? ...

How to make Date locale-independent?

I have a db, that stores dates in OleDateTime format, in GMT timezone. I've implemented a class, extending Date in java to represent that in classic date format. But my class is locale-dependent (I'm in GMT+2). Therefore, it converts the date in the db as date - 2 hours. How do I make it convert the date correctly? I want my class to be ...

Various country's "currency decimal places width" in the iPhone-SDK

I read about NSLocaleCurrencySymbol, but where would I find the variable used to determine the "number of decimal places" used in a country's currency? I.E. In the USA, it's common to see dollar amounts written with 2 decimal places: $1.23 What about many other countries? Thanks. ...

Django's makemessages creates a lot of fuzzy entries

Each time I added some strings to a Django project, I run "django-admin.py makemessages -all" to generate .PO files for all locales. The problem is even I only added 5 news strings, the makemessages command will mark 50 strings as fuzzy in .PO files which brings a lot of extra work for our locale maintainers. This also makes the entire...

Is it possible to create your own custom locale

Since Windows doesnt have a C++ locale with UTF8 support by default, i would like to construct a custom locale object which supports UTF8 (by creating it with a custom ctype facet). How can i construct a locale object with a my own ctype implementation (i only found functions to construct a locale using an already existing locale as bas...

SQL Server Collation / ADO.NET DataTable.Locale with different languages

Hi all, we have WinForms app which stores data in SQL Server (2000, we are working on porting it in 2008) through ADO.NET (1.1, working on porting to 4.0). Everything works fine if I read data previsouly written in Western-European locale (E.g.: "test", "test ù"), but now we have to be able to mix Western and non-Western alphabets as we...

How to force .NET4 & it's tools to use English for exceptions and other messages.

I would like for my Win7-x64 dev box to remain in the current locale (pl-PL), but at the same time for whole .NET tools to run in English locale. I previous releases this could be achieved by not installing a language pack add-on that came up in windows update. This time it did sneak up and I cannot find it in windows update history and...

Why doesn't ${locale} resolve in my <compc> Ant task?

I've seen a number of examples, e.g. here, where people are including locale resource bundles by referencing the locale attribute in the element. For some reason this doesn't work for me. Here's what I have for the task: <compc output="${deploy.dir}/myfrmwrk.swc" locale="en_US"> <source-path path-element="${basedir}/src/main/fle...

Django's logout function remove locale settings

When I use Django's logout function to log out an authenticated user, it switched locale to en_US, the default one. from django.contrib.auth import logout def someview(request): logout(request) return HttpResponseRedirect('/') How to keep user's locale after logged out? ...

Django's USE_L10N does not work

I already set USE_L10N = True in settings.py But in following view: from django.contrib.humanize.templatetags.humanize import intcomma dev view_name(request): output = intcomma(123456) Output is always "123,456" for all locales. ...

setlocale having no effect in PHP

I have the following snippet of code: setlocale(LC_ALL, "de"); print(strftime("%A %e %B %Y", time())); and it's printing Tuesday 4 May 2010 instead of Dienstag 4. Mai 2010 Any ideas why? How to fix? ...

gcc error messages

I was trying to get error messages in spanish. I have changed the locale to es_EC.utf8 .... i get messages in spanish when I run apt-get etc.. but gcc gives me errors in english..can anybody help me? I'm using ubuntu10.04 gcc-4.3.4 ...

How do you obtain a formatted date and time for the current locale in C?

What C function should I call to obtain a formatted date and time for the locale where the program is being executed? I'm asking this question because I have run into a problem using the ClamAV daemon API. The VERSION command returns the date and time of the latest virus definitions, but the code uses a call to ctime to format it. As fa...

How to add a control to a resource file in C# for localizing a winform application.

I want to add culture to window application so that it can be used globally. For this I want to use Only one Resource File. Right now what I do is adds control manually to that file and reads them at page load. I want this thing to become automated. How should I proceed ...

Does timezone count differ by locale?

Will TimeZone.getAvailableIDs(); get the same number of timezones regardless of what locale I'm running in? ...