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
3
votes
2 answers

Manipulate the list of countries provided by Symfony Intl and the form choice type

Politics aside, I need to provide Kosovo as a form choice when selecting a country. What's the most elegant way of doing this with Symfony's built-in form choice type country, while also providing translations for the Kosovo name? Here's what I've…
Adam Elsodaney
  • 7,722
  • 6
  • 39
  • 65
3
votes
1 answer

String to wstring conversion on OS X

I'm trying to convert a C++ string to a wstring. I found the following code, that seems to deal with accents, which is what I'm looking for. std::wstring widen(const std::string& s) { std::vector buffer(s.size()); std::locale…
Klaus
  • 1,241
  • 4
  • 14
  • 31
3
votes
2 answers

Locale: Language name to Country / Language code

EDIT: I have a language name in English, nothing else. How do I get the code for it. e.g.: English -> en German -> de Spanish -> es Chinese -> zh
paulgavrikov
  • 1,883
  • 3
  • 29
  • 51
3
votes
0 answers

Setting locale settings in Google App Engine

I'm trying to parse a string to a date object on Google App Engine. The string is formatted locally and I thereby either need to set the locale setting before parsing the string or find a third part module that does international formatting. In…
TJ-
  • 116
  • 10
3
votes
1 answer

Changing the locale of my application context dynamically

I'm a .NET dev new to Java and Android. I'm beginning with the platform by working on some unit tests and I have a date method I want to test that takes the current context as a parameter. I want to moc this context and specify a locale of my…
earthling
  • 5,084
  • 9
  • 46
  • 90
3
votes
1 answer

Difference in performance between calling .localeCompare on string objects and constructing a purpose-made Intl.Collator object?

Background: So I need to sort lots of strings. Arrays of strings, actually, but that's besides the point. What isn't is that I need to implement my own sorter function, as detailed in the linked question.Performance is quite important to me. …
user2958725
  • 1,355
  • 3
  • 12
  • 16
3
votes
3 answers

Unable to speak languages except English

In my android TTS application, I tried to speak out Japanese. So, I set the language to Japanese. result = tts.setLanguage(Locale.JAPAN); finalText = textField.getText().toString(); tts.speak(finalText , TextToSpeech.QUEUE_ADD, null); This didn't…
PeakGen
  • 21,894
  • 86
  • 261
  • 463
3
votes
2 answers

Serializing java.lang.Locale

Got a class that serializes into xml with XMLEncoder nicely with all the variables there. Except for the one that holds java.util.Locale. What could be the trick?
yanchenko
  • 56,576
  • 33
  • 147
  • 165
3
votes
1 answer

How to use localization while developing magento extension?

Currently i am developing a magento extension. I want to use the localization option which will translate data which is related to extension to other languages. But i dont know how to use it. I have tried the following. config.xml
vinothavn
  • 547
  • 1
  • 5
  • 19
3
votes
1 answer

postgres - cannot create collation

I have a postgres 9.2 database running on debian wheezy. If I execute in pgadmin: CREATE COLLATION en ( LOCALE = 'en_US.UTF-8') I get the following error message. ERROR: could not create locale "en_US.UTF-8": Datei oder Verzeichnis nicht…
markus
  • 6,258
  • 13
  • 41
  • 68
3
votes
2 answers

Auto-detection of locales from WWW browser and testing with Cucumber

I test my application with Cucumber and it worked before I've added auto-detection of locales from WWW browser in application_controller.rb: before_filter :set_locale private def set_locale xxx =…
Voldy
  • 12,829
  • 8
  • 51
  • 67
3
votes
1 answer

Convert date string value from U.S. to native Date with current locale <> U.S.?

As in Convert month name into number, I want to use DateValue to create a date from a date string. However, the string I have is guaranteed to be in U.S. format, while the PC executing the code is running on German locales. Example: DateValue fails…
TheBlastOne
  • 4,291
  • 3
  • 38
  • 72
3
votes
2 answers

UTF-16 codecvt facet

Extending from this questions about locales And described in this question: What I really wanted to do was install a codecvt facet into the locale that understands UTF-16 files. I could write my own. But I am not a UTF expert and as such I am sure I…
Martin York
  • 257,169
  • 86
  • 333
  • 562
3
votes
2 answers

UTF-8 encoding not working with Eclipse java application

I've got a little encoding problem somewhere that I can't fix. I've got the next java file: public class Main { public static void main(String[] args) { System.out.println("áéíàèì€aei"); } } The file charset encoding is UTF-8 and…
MiGU
  • 382
  • 3
  • 17
3
votes
2 answers

Grails - Change locale behavior to use dash instead of underscore

I'm writing a Grails application that get's it's locale from a 3rd party like so: my.app.com?lang=en-US since Grails uses en_US it throws the exception Error intercepting locale change: Locale part "en-US" contains invalid characters How can I…
Shlomi Schwartz
  • 8,693
  • 29
  • 109
  • 186