Questions tagged [locale]

In computing, locale is a set of parameters that defines the user's language, country and any special variant preferences that the user wants to see in their user interface. Usually a locale identifier consists of at least a language identifier and a region identifier.

Examples of variable output controlled by a locale is whether a date is displayed as 25/12/2012 or 12/25/2012 or some other format, and whether a decimal number is displayed as 123,456.78 or 123.456,78

5203 questions
4
votes
1 answer

Access the Locale in Ruby in CSS files

So i am using CSS, JS and Ruby for a project. Now i have my location set etc, in ruby but i want to access them on my css files. This is to customize views for a particular locale. I have done the following in my controller. before_filter…
CodeGeek123
  • 4,341
  • 8
  • 50
  • 79
4
votes
1 answer

Currency: number of fraction digits unexpectedly zero

I am trying to parse and store currency amounts as BigDecimal values. I am given the locale of the currency in question, and in most cases it works fine, but I'm getting unexpected results when the currency is the Costa Rican colón. I am informed by…
Graham Borland
  • 60,055
  • 21
  • 138
  • 179
4
votes
3 answers

Python locale settings on Heroku

I'm developing a python web application on Heroku and I'm facing a problem with the locale settings. My aim ist to format a python datetime object as a string like this import datetime now = datetime.datetime.now() print now.strftime('%a %d %B %Y') …
verbit
  • 485
  • 8
  • 16
4
votes
2 answers

Retrieve time zone based on locale country information (OS-independent)

Yet another date/time related question ;-) Before you aim and shoot Things are kind of messed up with a Germany + MS Windows + R combination as the following yields an invalid time zone: > Sys.timezone() [1] "MST" Warning message: In…
Rappster
  • 12,762
  • 7
  • 71
  • 120
4
votes
1 answer

boost::locale to_utf function for string encoding, likes to throw

I'm having trouble using boost to convert between different string encoding. After reading this, I tried doing this: boost::locale::generator gen; std::locale loc = gen.generate("");// encoding local to the computer. //std::locale loc =…
DiscoStu
  • 559
  • 6
  • 15
4
votes
2 answers

Is the PHP Intl extension thread safe?

I've been reading about locales in PHP and it seems setlocale() has problems with threads. (I'm not too familiar with threads - the docs mention it is not thread safe) I'd like to give my project the ability to deal with certain number formats and…
RS7
  • 2,341
  • 8
  • 34
  • 57
4
votes
1 answer

Working with UTF8

It seems like a rather complicated issue to work with std::string and UTF8 and I cannot find a good explanation of do's and dont's. How can I properly work with UTF8 in C++? It is rather confusing. I've found boost::locale and I set the global…
ronag
  • 49,529
  • 25
  • 126
  • 221
4
votes
3 answers

How to get the Current Locale in GWT using LocaleInfo

I have tried to get the current locale on the client using the LocaleInfo class and the method getCurrentLocale(). However it always returns the value default locale no matter what regional and locale settings I have on the client machine. The Date…
snowstreams
  • 575
  • 2
  • 13
  • 23
4
votes
3 answers

How to use Hindi(Indian Mother Tongue) language in Text-To-Speech?

I am creating an application for student. I need to enter data in Hindi or Marathi. When user clicks on specific topic then user should be able to listen this topic in Hindi Or Marathi. I know How to set Language in TextToSpeech…
user1294970
3
votes
2 answers

How to get styled language/country code from the Java Locale

I was wondering if anyone knows how to get formatted or styled codes from the Locale class. What i would like to see is "en_US" for English for US. For example, if i detect a language from Firefox it comes back as "en-us,en;q=0.5". Later when I want…
SpaceBear
  • 832
  • 3
  • 8
  • 22
3
votes
1 answer

Rails 3: i18n locale doesn't change on production environment

I have been searching for hours to internationalise my application on the "production environment". Everything works fine on the development environment. Here are my codes: in view
  • <%= link_to "العربية", :locale=>'ar' %>
  • PeaceDefener
    • 618
    • 2
    • 8
    • 22
    3
    votes
    2 answers

    No locale when tomcat processes error pages?

    I have a strange problem, where localization is working great, except on our error pages. I am using the Stripes framework, resource bundles and the JSTL tag to localize my pages. The locale is determined by the Stripes framework. According to the…
    JBCP
    • 13,109
    • 9
    • 73
    • 111
    3
    votes
    2 answers

    How to print UTF-8 strings without using platform specific functions?

    Is it possible to print UTF-8 strings without using platform specific functions? #include #include #include using namespace std; int main() { ios_base::sync_with_stdio(false); …
    Pietro M
    • 1,905
    • 3
    • 20
    • 24
    3
    votes
    1 answer

    How do I get the currency symbol of a currency as it would appear in one of its native locales?

    Currency currency = Currency.getInstance(currencyCode); How do I get the symbol of the currency as it would appear in one of its native locales as opposed to the default locale? currency.getSymbol() won't work because that will be based of the…
    Gabriel
    • 1,679
    • 3
    • 16
    • 37
    3
    votes
    1 answer

    Is there a way to list installed locales on Android?

    I'm aware of java.util.Locale and Locale.getAvailableLocales() and I'm also aware of the Settings.ACTION_LOCALE_SETTINGS intent. Neither of these accomplish what I need. Locale.getAvailableLocales() returns all languages supported by the Android…
    J.R. Garcia
    • 639
    • 5
    • 20