FAQ Database Discussion Community


How do I use Angular i18n for languages it doesn't appear to support?

javascript,angularjs,internationalization,locale,angular-translate
I am using Angular i18n for German, English, Spanish, French, Italian, Portuguese, Russian, Ukrainian, Japanese, Korean, and Chinese. These are all supported locales, but I've been tasked to include translations for Cebuano, Samoan, Tagalog, and Tongan. These do not appear to be supported locales in Angular i18n. How do I...

Isabelle: locale interpration about record fails in proof

locale,record,isabelle,interpretation
Using the Algebra library, I encountered the following problem. In a proof I wanted to interpret the additive structure of a ring as a group. Here is a sample code: theory aaa imports "~~/src/HOL/Algebra/Ring" begin lemma assumes "ring R" shows "True" proof- interpret ring R by fact interpret additive: comm_group...

How to change the library locale as well when I change the app locale in android

android,localization,locale,android-support-library,android-location
I created an app that utilize the google map , and I use the google play service library in android. The problem is the library does not change the locale when I change the locale in my app. But it use the locale of the phone device. Here is how...

Detect changes in user locale setting (Control Panel -> Clock,Language and Region) in child dialog box

winapi,locale,regional-settings,control-panel
I have dialog box made in resource editor that behaves as a child control of the main window. In normal mode, when behaving as a popup, dialog can receive WM_SETTINGCHANGE message that notifies dialog box about user changing locale settings, but as a child it does not seem to receive...

How to display checkbox on the left when change language of Android app to Arabic?

android,checkbox,settings,locale,arabic
In Settings of my Android app, I use many of checkboxPreferences. When the locale selected is English, text appears at the Left side and Check box at the right side. Text ------------------Checkbox When I change locale to Arabic, I want to get this format: Checkbox---------------Text But it keeps the same...

Is it bad that LANG and LC_ALL are empty when running `locale -a` on Mac OSX Yosemite?

c,osx,locale
I use Mac OSX Yosemite. When I run locale I get this: locale LANG= LC_COLLATE="C" LC_CTYPE="UTF-8" LC_MESSAGES="C" LC_MONETARY="C" LC_NUMERIC="C" LC_TIME="C" LC_ALL= Question 1: Does the emptiness of LANG and LC_ALL bad/normal/prefered? Normally, I wouldn't care that much about it, but I've got a warning (process:16182): Gtk-WARNING **: Locale not supported...

Android app Locale variable comparison with String

android,if-statement,locale
I'm currently trying to test (with an if statement) the value of the current Locale variable. but the result returned (by checking in Debug mode) is false. This is the code I'm using: Locale frLocale = new Locale("fr"); Locale usLocale = new Locale("en"); Locale currentLocale = Locale.getDefault(); Toast.makeText(this, frLocale.toString(), Toast.LENGTH_SHORT).show();...

Get dates from AUT?

date,vbscript,locale,qtp,hp-uft
My Web-based application (like most) follows the browser locale to format dates. So if you configure British English as the preferred language in the browser, the app will display dates in "DD/MM/YYYY" format. Now QTP (ok, it´s VBScript that is the culprit) does not know about this. It strictly follows...

Angular Filter Service inside Controller

javascript,angularjs,service,filter,locale
first post ever so be gentle!! Got an issue inside Angular 1.3 and using a Stateful Filter within a controller. In short when you use the $filter('custom')(data) method as a pose to the {{ data | custom }} method - and the cutom filter updates (say a service updates), only...

Effect of Locale on Android Geocoder

android,locale,geocoding
I'm trying to remotely troubleshoot an app for a client. The app creates its Geocoder and looks up addresses like this: Geocoder gc = new Geocoder(context, Locale.getDefault()); List<Address> addresses = gc.getFromLocationName(nextWaypoint, 5); The waypoint is a Canadian street address. The client reports that the app can geocode addresses on some...

Angular Dynamic Locale not working instantly

angularjs,localization,datepicker,locale,angular-ui-bootstrap
I use angular-dynamic-locale to change the language of UI Bootstrap's datepicker (I do not want to add the right localization source file at the server side. Hence, I need something more dynamic). The localization file is loaded. However, when I open a datepicker on my page, the localization takes place...

Python parsing date and find the correct locale_setting

python,datetime,internationalization,locale,datetime-parsing
I have the following date string: '3 févr. 2015 14:26:00 CET' datetime.datetime.strptime('03 févr. 2015 14:26:00', '%d %b %Y %H:%M:%S') Parsing this failed with the error: ValueError: time data '03 f\xc3\xa9vr. 2015 14:26:00' does not match format '%d %b %Y %H:%M:%S' I tried to loop over all locales with locale.locale_alias: for...

What information do browsers use to create the Accept-Language string?

google-chrome,http,firefox,locale
I'm trying to get as much regional information as possible about users visiting a website. Mapping the IP to a country using e.g. ipinfo.io is one method, but I'm also exploring the Accept-Language header. Getting this using HTTP_ACCEPT_LANGUAGE in PHP. I would like to ask if someone knows how this...

Android - Support Multilanguage app in a ViewPager

android,android-viewpager,locale,multilanguage,screen-rotation
I have a ViewPager with FragmentPagerAdapter and five tabs that is called from my MainActivity. I want to change dynamically the language of my App. To do this, i saved my language preference in my onSavedInstanceState like this: @Override protected void onSaveInstanceState(Bundle outState) { super.onSaveInstanceState(outState); SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(getApplicationContext()); String...

Django: How to upload file without UnicodeEncodeError on save()?

python,django,file-upload,locale,python-unicode
IM try to upload a file but when the file name have caracters like "ó" have a 'ascii' codec can't encode character u'\xf3' in position 59: ordinal not in range(128) im try to obj.file = smart_unicode(form.cleaned_data["file"]) before save() on views.py and def file(instance, filename): i = datetime.now() filename = smart_unicode(filename)...

Get wrong Date from parsing time string by SimpleDateFormat. (1 hour offset) [Android/Java]

java,android,timezone,locale,simpledateformat
First of all, I would like to make clear that it is not daylight saving issue. Second, after trying hard, it seems related to the locale used in SimpleDateFormat. Third, it seems only to occur with PST/PDT timezone. UTC is ok. Here is the test code. Use US and ENGLISH...

How to get the currency symbol for particular country using locale?

java,locale,currency
I have tried this code and it gives me the Country Codefor some countries instead of the currency symbol I want the currency symbol not the code The array resourseList contains all the countries with it's code String m= (String) Array.get(recourseList,i); String[] ma=m.split(","); Locale locale=new Locale("en", ma[1]); Currency currency= Currency.getInstance(locale);...

.NET Application looking for DLLs in locale specific sub-folder

.net,dll,locale,app-config,subfolder
My company have some internal utility libraries containing things like base services, useful extension methods etc. I have recently completely re-written these from the ground up and have packaged them as nu-get packages, hosted on our internal network. When I've added added a NuGet reference to the packages in a...

Tornado Localisation, set default language

localization,internationalization,locale,tornado
I want to set my default language in my web client to be 'de' when the browser language is 'en' or 'en_US'. I am using tornado localisation. I tried this solution, tornado.locale.set_default_locale('de') but it still shows the web client in english.

get current windows keyboard layout in Java

java,windows,locale,keyboard-layout
On windows I want to get the code I see in language bar on windows. I need to get this current keyboard layout at any given time. If I use this in a thread: InputContext is = InputContext.getInstance(); System.out.println(is.getLocale()); I'll get layout that was active when the program was started....

Converting a number from a string to an int with decimals separated by comma or dot

c#,.net,xaml,numbers,locale
I have a string which contains a number. It can be one with decimals, followed by either a comma or a dot, depending on the user's locale. The numbers are actually hundredths and I want to convert them to plain old ints. For example, I want strings "14.5" and "14,5000"...

How do I set the locale for an ASP.NET 5 application?

c#,asp.net,locale,asp.net-5
I’m trying to do a blanket override of the host locale for an ASP.NET 5 web application. Most solutions refer to the <globalization/> web.config element, but this is IIS-specific and doesn't seem to fit the new ASP.NET model. I tried: app.Use(next => context => { Thread.CurrentThread.CurrentCulture = CultureInfo.GetCultureInfo("en-AU"); Thread.CurrentThread.CurrentUICulture =...

Formatting number in European format with two decimals

javascript,formatting,locale,culture
Trying to format a number to two decimals format in European culture. So that comma is decimal separator and space thousands separator. In example 213245 should be formatted as 213 245,00 How can I do that? 213245.toFixed(2).toLocaleString(); gives 213245.00 but it should be 213 245,00 however 213245.toLocaleString() gives 213 245...

Thymeleaf compare #locale expression object with string

conditional,locale,thymeleaf,spring-el
I want to set a th:class attribute depending on the context locale using the expression object #locale. I have tried th:class="${#locale}=='en'?'active':''" th:class="${#locale=='en'}?'active':''" Both of them results in false, but whent I print it with th:text="${#locale}, I got the correct locale code (en,es). Any idea of how to compare the #locale...

Swift ISO-8601 date formatting with iOS7

ios,date,swift,locale
I really need your help guys. The following piece of code works fine in a Swift Playgound and with any iOS8 or 8.1 simulator. But with iOS7 and 7.1, the NSDate object is always set to nil. The object dateString contains a JSON string (ISO 8601 format) like 2015-02-28T20:15:00+0100 I'm...

How to get weekends vs weekdays in Cocoa?

cocoa,locale,nsdateformatter,nscalendar
What is the correct calendar-agnostic way (in either iOS or OS X) to get standard business days of the week (e.g. weekdays) versus non-working days of the week? This is taking into account that some parts of the world doesn't follow the Monday through Friday working day routine. E.g. the...

Is there a locale code for informal German (de_DE-informal?)

wordpress,localization,locale,transifex
In German there is a formal ("Sie") and an informal ("Du") form. I would like to translate some software into informal German, notably woocommerce using transiflex, but new languages can only be added using their locale code. There only seems to be de_DE as a locale. What's best to differentiate...

Symfony2 - Locale in unit tests

unit-testing,locale,symfony-2.1
I'm from Germany and at work we use an old Symfony2 Version (2.1). I wrote a twig filter named "GermanDateExtension". public function getGermanDateFilter($date, $format) { setlocale(LC_TIME, 'de_DE.utf8'); return strftime($format, $date); } Locale is set via setlocale() and the formatted date will be returned. I also wrote some unit tests for...

Identifyng the date format

java,date,locale
Consuming a webs service, which is returning date in a format that is not able to identify. <Date>1140711</Date> <Time>94255</Time> Its in Century +yy+MM+dd format, if the date is 20140711 (yyyyMMdd) then it will be 1140711. So how can I convert these date like 1140711to 07/11/2014(MM/dd/yyyy) ...

I want my string to converted to a day [duplicate]

java,locale
This question already has an answer here: How to determine day of week by passing specific date? 7 answers I have this string String s = "29/04/2015" And I want it to produce the name of that day in my language, which is Norwegian. For example: 29/04/2015 is "Onsdag"...

Two records in database on 1 form

php,symfony2,doctrine2,entity,locale
I have an entity Page with fields: pageID (PK) and tag. I have an entity PageLocale with fields: pagelocaleid (PK), description, content, locale, translated and pageID (FK). My Database Structure: My entity PageLocale: <?php namespace DX\MyBundle\Entity; use Doctrine\ORM\Mapping as ORM; use Symfony\Component\HttpFoundation\File\UploadedFile; /** * Pagelocale * * @ORM\Table(name="pageLocale", [email protected]\Index(name="fk_pageLocale_page1_idx", columns={"pageID"})})...

“Gtk-WARNING **: Locale not supported by C library. Using the fallback 'C' locale.” on OSX

c,osx,gtk,locale
Background information: I use Mac OSX Yosemite. I've installed gtk+ using brew install gtk+ and fixed the errors using export PKG_CONFIG_PATH=/opt/X11/lib/pkgconfig. I've build my program using make but when I try to run it I get a warning like this: (process:16182): Gtk-WARNING **: Locale not supported by C library. Using...

Laravel: Locale Session: Controller gets Parameter to change it but it cant. U have to hardcode it

session,laravel,locale
I tried to create a Form and do away with Ajax. Yes, the form at least does send the parameter down to the Controller as I var_dumped it and exited in order to see if it had gotten the new value, and yes it did, but guess what? and here...

DBCC USEROPTIONS server/client

sql-server,locale
We are using MS SQL server 10.0, and running the DBCC options in two different user accounts, we get two different results. One has language us_english other as british. Where is the information stored on the server, is it possible to change it? textsize 2147483647 language us_english dateformat mdy datefirst...

Filter listview in other language beyond english

android,listview,locale
I have a ListView populated by String[]. I have an EditText to filter the listview and search. The thing is that when i search in English and the Strings are in English everything is fine, but when i translate the Strings in other language(e.g. Greek) the filter does not work....

How should one redirect locale-less URIs to locale-full ones in Symfony-CMF?

php,symfony2,routes,locale,symfony-cmf
Background We have a (fairly typical?) arrangement for a multilingual Symfony CMF website, where resource paths are prefixed by the desired locale—for example: http://www.example.com/en/path/to/english-resource.html; and http://www.example.com/fr/voie/à/ressource-française.html. We are using RoutingAutoBundle to store such routes in the content repository, and DynamicRouter to utilise them: simple and easy. If a GET request...

DoctrineExtensions translatable in ZF2 - how and where can I setDefaultLocale

php,zend-framework2,locale,doctrine-extensions
I stuck with the $defaultLocale of the TranslatableListener. https://github.com/Atlantic18/DoctrineExtensions/blob/master/doc/translatable.md#default-locale I found only setup possibilities for Symphony, but not for Zend Framework 2. There is an extension bundle for doctrine for easy setup of DoctrineExtensions named "StofDoctrineExtensionsBundle", but I didn't found something like that for ZF2. The following link shows a...

How to add more locale (Switzerland) to android

android,locale
In the Android Locale file I do not see Switzerland. But I would like to display the currency (CHF) is someone is using my application from Switzerland. The problem is I never see the swiss locale even if I want to add it programatically. Anyone knows how to add Swiss...

Where is the LANGUAGE environment variable set?

linux,environment-variables,locale,configuration-files,archlinux
I'm using zsh on my archlinux. My LANGUAGE environment variable was set to fr but I wanted to set it back to en_US.UTF-8 so I did it in my ~/.zshrc file. But was it the best place to set it? Isn't it dirty? This works but only for my user's...

Can I split up language files in Laravel to organize my locale file(s)?

php,laravel,locale
I would really like to split up my messages.php locale file into more meaningfull files to get a better, more functional, organized set of language files. Is this in any way possible to achieve? Thanks....

Spring MVC 3.1 change language i18n based on the request locale language

java,spring,spring-mvc,internationalization,locale
What I would like to do it to display the appropriate language to the user based on his request.getLocale().getLanguage(); So here is what I already have and which is already working fine. Meaning that when I type ?lang=en or ?lang=cn at the end of the URL it displays the appropriate...

How to find current QLocale in Qt/PyQt/PySide?

python,qt,pyqt,locale,pyside
How can I find the currently active QLocale? We can find the default system locale with QLocale.system(), but I want something like QLocale.current(), to check if the locale changes I am trying to make are actually working. The documentation has lots of methods for setting locales, or finding the properties...

What is the correct way to get a LOCALE_SSHORTDATE that is guaranteed to have a full (4-digit) year number?

c,winapi,locale
I want to create a date-time picker control that shows both date and time, as a combination of the DTS_SHORTDATECENTURYFORMAT and DTS_TIMEFORMAT styles. Since there is no such style built into the date-time picker, I have to do it myself with GetLocaleInfoEx(). I notice that by default, GetLocaleInfoEx(LOCALE_SSHORTDATE) seems to...

Android Notifications Locale specific message with Unicode

android,unicode,locale
Hi I want to use local regional language text in notification , i could send the unicode of text and it works properly where device supports the language. but to support on all the devices i want to set the type face (custom fonts) to notification text..I tried with RemoteView...

Symfony2, get locale in repository class

php,symfony2,repository,locale
In my project with symfony2 (2.0) I have a repository class with all querys inside. But in this querys I need the locale (from session?) but inside the repository I can't get this variable (in the controller I havn't any problem) In the repository class I tried this: $request =...

Locale error when adding a space after each character for a unicode file?

bash,unicode,utf-8,sed,locale
I want to add spaces to each character in a textfile in.txt 在吗?? 嗯 你让我看的那款手提是不是11寸的,很小的? 看来还是美国的便宜啊 应该是吧 out.txt 在 吗 ? ? 嗯 你 让 我 看 的 那 款 手 提 是 不 是 1 1 寸 的 , 很 小 的 ? 看 来 还 是 美 国...

FacesContext#getViewRoot() returns null while setting for first time

jsf,locale,jsf-2.2,mojarra
I am trying to change my JSF application locale in one page and that has to change all my pages locale. I have followed this link, and it works well JSF locale is set per request/view, not for session If I run the application I can change the locale in...

How to read Cyrillic Unicode file in C++?

c++,unicode,locale,getline,cyrillic
I'm trying to read lines from .txt files, that have been saved as Unicode. That's how i'm doing it: wifstream input; string path = "test.txt"; input.imbue(locale(input.getloc(), new codecvt_utf16<wchar_t, 0x10ffff, consume_header>)); input.open(path); if (input.is_open()) { wstring line; input.seekg( 1 , ios_base::beg); getline(input, line); } It works fine for files with Latin...

Why is wstring_convert throwing a range_error?

c++,c++11,locale,wstring
I'm writing some code that needs to convert between byte strings and wide strings, using the system locale. When reading from a file, this is incredibly easy to do. I can use std::wifstream, imbue it with std::locale(""), and then just use std::getline. According to cppreference's codecvt page, wifstream just uses...

laravel default localizations for other languages?

locale,default,laravel-5
A new Laravel project already comes with some localizations, in english. . └── en ├── auth │   ├── form.php │   └── message.php ├── button.php ├── general.php ├── groups │   ├── form.php │   ├── message.php │   ├── modal.php │   ├── table.php │   └── title.php ├── pagination.php ├── passwords.php ├── reminders.php ├──...

getting Locale session on Laravel and selecting query accordingly

laravel,locale
I am trying to just select a sql query depending on the session set for the locale language. Yet, as simple as it should be, now I am getting at the View an "invalid argument for the foreach array", that is, it is not passing arguments. Before having the check...

date() does not respect the current locale, while strftime() does

php,date,locale,strftime
This is the full content of my test file: <?php setlocale(LC_ALL, 'de_DE'); echo date('F'); // => "February" (wrong) echo strftime('%B'); // => "Februar" (correct) ?> Any ideas why this might be happening? I have already verified that the de_DE locale is installed, using locale -a in the shell....

What is wrong with my mongodb?

django,mongodb,locale,virtualbox,ubuntu-14.04
I have a django project that requires mongo. When setting up my dev environment I get some error related to locale and mongo that I couldn't resolve. $ bash -c ". ./host-install.sh && restore_mongodb ./social ~/Desktop/dump" ./host-install.sh: line 329: warning: setlocale: LC_ALL: cannot change locale (sv_SE.UTF-8): No such file or...

JSF 2 - Independent locale settings for different pages

java,jsf-2,locale
I've followed this tutorial to support internationalization in my JSF web application. I have now a page that should have its own language, independent from the other pages language. The problem is that changing the locale from this page changes also the locale of the others pages (and the other...

What is this error about perllocale in Perldoc?

osx,perl,debugging,documentation,locale
I was discussing here about setting no locales in Perl and was recommended to run this perldoc perllocale in OSX Yosemite 10.10.3 but I get the error: Error while formatting with Pod::Perldoc::ToMan: at /System/Library/Perl/5.18/Pod/Perldoc.pm line 1346. at /usr/bin/perldoc5.18 line 11. Got a 0-length file from /System/Library/Perl/5.18/pods/perllocale.pod via Pod::Perldoc::ToMan!? at /usr/bin/perldoc5.18...

Change locale in android app (onto Hindi)

android,locale,hindi
Creating multi languages support for the app with possibility to change language in App settings. As for now everything works fine for English, Spanish, Franch, Russian languages, but doesn't work for Hindi and Chineese. 1) I specify the language name in original language but in the app instead of हिन्दी...

GCC, std::ctype specialisation & streams

c++,unicode,locale,iostream,facet
I've written my own specialisation of each virtual member function of std::ctype<char16_t>, so that this now works: #include <string> #include <locale> #include "char16_facets.h" // Header containing my ctype specialisation #include <sstream> #include <iostream> // Implemented elsewhere using iconv std::string Convert(std::basic_string<char16_t>); int main() { std::basic_string<char16_t> s("Hello, world."); std::basic_stringstream<char16_t> ss(s); ss.imbue(std::locale(ss.getloc(), new...

GWT: how to use Locale.ENGLISH in client side?

java,gwt,locale,emulation
I have a legacy class which contains toLowerCase( Locale.ENGLISH ) And when I use this class in my client side, I gets [ERROR] [onboardingtool] Line 37: The method toLowerCase() in the type String is not applicable for the arguments (Locale) But when I check GWT doc, it seems like ROOT,...

Display current local time in Sofia in Hours : Minutes 24h format

javascript,asp.net,arrays,locale
I'm trying to display Sofia Local Time for every user that enters my website so that it does not matter what's the time of the user or the server of my website deployed. This is JS but it displays the user's time.How to display current time in Sofia/Bulgaria .I use...

How to get date and time formatted using the device locale language?

android,locale,simpledateformat
I am trying to get the date and time using Date(), and display it in a TextView. is it possible to format it using the device locale? for Example: Arabic locale device خميس 2\2\2015 Turkish locale device Çar 2\2\2014 English locale device Wed 2\2\2014...

ZF2, I18n and dynamic locale not working anymore after update

php,dynamic,zend-framework2,locale,zend-translate
After finally updating Apache 2.2 -> 2.4 and php 5.4 -> 5.5 translation in view is not dynamic anymore. My app is bilingual with english as fallback. The locale is set i.e. by user's profile using ::onBootstrap class Module { public function onBootstrap($events) { $translator = $events->getApplication()->getServiceManager()->get( 'translator' ); $authSvc...

How to parse “1,234.56” in Java as Double?

java,double,locale
I am having trouble parsing "1,234.56" in Java, a similar question recommend using French locale in number formatting, but it is parsing the result incorrectly. Here is what I have: NumberFormat format = NumberFormat.getInstance(Locale.FRANCE); Number number = format.parse("1,234.56"); System.out.println(number.doubleValue()); // Should get 1234.56, got 1.234 instead Number number = format.parse("1,234,567.89");...

Switching language (locale) in ActiveAdmin without passing a parameter

ruby-on-rails-4,locale,activeadmin,rails-i18n
I want to be able to switch my locale in an ActiveAdmin app of mine. So far I've followed this guide on switching-locale, which actually mentions the problem I'm having: You will notice, however, that all links keep the default locale of your app. So in my case, once I...

Codecvt doesn't work in gcc

c++,g++,locale,codecvt
I'm trying to use my own codecvt with standard iostreams. I'm using this line: std::cout.imbue(std::locale(std::locale("C"), new rot13codecvt())); rot13codecvt is just an example, shamelessly lifted verbatim from the interwebs. A full runnable example is here. My real codecvt does something different. As you can see in the linked live example, this...

How do I get current application locale?

ios,objective-c,localization,locale,nslocale
I need to get current locale. Not user locale but my application locale. Let's say my application has two localizations (in project settings): English (default) and French. If user sets French language on iPhone then my application will display French interface. If user sets German language on iPhone then my...

Get Selenium WebDriver locale

java,selenium,webdriver,locale
How can I get current browser locale from WebDriver? There is the way to set locale, e.g. FirefoxProfile profile = new FirefoxProfile(); profile.setPreference("intl.accept_languages", "en"); m_webDriver = new FirefoxDriver(profile); But the problem is that it doesn't always work for some reason (not sure, but seems it doesn't work for Windows 8)....

utf-8 characters get lost when converting from list to data.frame in R

r,utf-8,character-encoding,data.frame,locale
I am using R 3.2.0 with RStudio 0.98.1103 on Windows 7 64-bit. The Windows "regional and language settings" of my computer is English (United States). For some reason the following code replaces my Czech characters "č" and "ř" by "c" and "r" in the text "Koryčany nad přehradou", when I...

Change language of the Terminal's output in linux

linux,locale
Is there a way to change the language of o/p returned by any command in linux? Just take for example /sbin/service cloudstack-usage status cloudstack-usage は停止しています I want to translate the Japanese text returned. Why i need this :- I have some in-house script which will check if the service is...

Cakephp 3.0.0-RC2 I18n::locale() doesn't works

php,cakephp,internationalization,locale,cakephp-3.0
I am using Cakephp 3.0.0-RC2. It work's fine but I can't change du language of the user at login. My login function doesn't work. It do nothing : public function login() { if ($this->request->is('post')) { $user = $this->Auth->identify(); if ($user) { $this->Auth->setUser($user); I18n::locale($user['lang']); return $this->redirect($this->Auth->redirectUrl()); } $this->Flash->error(__("Nom d'utilisateur ou mot...

How to set a double format by locale

java,locale,number-formatting,decimalformat
I those input strings: 10000,20 4000,10 5,400.20 I am trying to format them with locale: nf = NumberFormat.getInstance(Locale.FRANCE); double newLoc = nf.parse(split[5]).doubleValue(); And also like this: nf = NumberFormat.getInstance(Locale.ENGLISH); double newLoc = nf.parse(split[5]).doubleValue(); Result is: for Locale.FRANCE 5400.2 4000.0 10000.0 For Locale.ENGLISH 4000.0 10000.0 5400.0 But what in need is...

Android - Dynamically change language

android,locale,dynamic-languages,android-configchanges
In my Android app i want to change the default language dinamically. I have implemented this method: public void changeLanguage(String lang) { //lang="it" or "en" for example myLocale = new Locale(lang); Resources res = getResources(); DisplayMetrics dm = res.getDisplayMetrics(); Configuration conf = res.getConfiguration(); conf.locale = myLocale; res.updateConfiguration(conf, dm); Handler handler...

where Py_FileSystemDefaultEncoding is set in python source code

python,python-2.7,locale
i am curious about how python source code set the value of Py_FileSystemDefaultEncoding. And i have receive a strange thing. Since python doc about sys.getfilesystemencoding() said that: On Unix, the encoding is the user’s preference according to the result of nl_langinfo(CODESET), or None if the nl_langinfo(CODESET) failed. i use python...