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

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…
jack
  • 17,261
  • 37
  • 100
  • 125
3
votes
1 answer

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…
knuton
  • 3,537
  • 3
  • 24
  • 23
3
votes
2 answers

UIDatePicker locale does nothing?

I'm creating a UIDatePicker programmatically, and setting its locale with the following code: datePicker.locale = [[[NSLocale alloc] initWithLocaleIdentifier:@"es_ES"] autorelease]; The datepicker still appears in English (or whatever language I've…
DougW
  • 28,776
  • 18
  • 79
  • 107
3
votes
3 answers

I18n.locale getting reset to :en in between controller and the view

I'm trying to internationalize a Rails/Spree app using spree's own spree_i18n gem, but I can't get it to work. I made a minimal app which recreates the problem here. To cut a long story short, I have the following code in my…
GMA
  • 5,816
  • 6
  • 51
  • 80
3
votes
1 answer

Why is valgrind reporting errors for libstdc++'s std::locale?

Related question: wifstream with imbue, locale produces valgrind errors I am using cppreference's (potentially flawed) examples, in particular the one present on their imbue page. Using the command line on the coliru online compiler: clang++…
user3920237
3
votes
1 answer

ksort doesn't respects LC_COLLATE

I have an array which keys are words in portuguese and I'm trying to sort the keys without consider accents. I have the following, code but it doesn't work. $array = array('ábaco' => 1, 'aéreo' => 2, 'abecedário'…
javsmo
  • 1,337
  • 1
  • 14
  • 23
3
votes
1 answer

Pecl / Python: unsupported locale setting - Ubuntu 13.10

I want to install pecl ssh2 extension. But when i try: Sorry, command-not-found has crashed! Please file a bug report at: https://bugs.launchpad.net/command-not-found/+filebug Please include the following information with the…
Canser Yanbakan
  • 3,780
  • 3
  • 39
  • 65
3
votes
1 answer

change locale (language) inside the app in an SettingsActivity

I want that the user is able to change the app language (strings are in folders like strings-de/strings.xml or strings-zh/strings.xml). It works fine when i change the phone settings to chinese or whatever, but what I am trying to do is the…
Marcus Mondel
  • 618
  • 1
  • 5
  • 10
3
votes
2 answers

Wrong File Encoding in JVM after Linux Update

After updating linux and java (1.6.0.13->1.6.0.45), Java processes use different file encoding (System Property file.encoding) New OS Version. Unfortunately I don't know the previous version anymore. But I can tell, that the update got wrong. My…
tejoe
  • 163
  • 1
  • 14
3
votes
1 answer

How can I make a case-insensitive regexp match for Russian letters?

I have list of catalog paths and need to filter out some of them. My match pattern is in a non-Unicode encoding. I tried the following: require 5.004; use POSIX qw(locale_h); my $old_locale = setlocale(LC_ALL); setlocale(LC_ALL,…
jonny
  • 1,326
  • 9
  • 44
  • 62
3
votes
1 answer

Is there in locale/codecvt a proper facet to test for character specifics

Well in C++ codecvt/locale library is there a proper facet one could use to test if a character "is" something? IE to test if a character is any form of linebreaking character, or represents a numeric or a whitespace etc etc? Or would one have to go…
paul23
  • 8,799
  • 12
  • 66
  • 149
3
votes
1 answer

How to configure Symfony2 sticky locale during session

I would like to translate my website thanks to an link on the right top. I found out that, since Symfony 2.1, the locale is not stored in the session anymore. So, I followed this Symfony documentation: Making the Locale "Sticky" during a User's…
Keysersoze
  • 184
  • 1
  • 12
3
votes
1 answer

Is there any easy methods to convert from ASCII to UTF8? (using boost::locale)

I'm trying convert some strings from ASCII to UTF8. And, i searched many things, but i can't found it. So i coded this. std::string ASCII("ASCII string"); auto utf8 = boost::locale::conv::to_utf(ansi, std::locale("en_US.UTF8")); Is this…
Joy Hyuk Lee
  • 756
  • 11
  • 22
3
votes
2 answers

Gradle - change Java compiler output locale or encoding

Can one configure Gradle to change java compiler output locale or encoding? The problem: gradle in run on Windows with non English default Local (in particular it is Chinese) There is possibility to do that configuring Java, e.g. Setting java locale…
Paul Verest
  • 60,022
  • 51
  • 208
  • 332
3
votes
1 answer

Defaulting locale if locale missing in Rails

I have my web app translated into english and croatian. English being set as default locale in my config/application.rb and enabled all fallbacks: config.i18n.load_path += Dir[Rails.root.join('my', 'locales',…
Marko Ćilimković
  • 734
  • 1
  • 8
  • 22