locale

Understanding the strange output of java.util.Locale

会有一股神秘感。 提交于 2019-12-24 10:25:03
问题 I had a perception that Locale is just about adding comma at proper positions at least in case of numbers. But I see a different output for what I have tried. I tried the following, public static void main(String[] args) { DecimalFormat df = null; df = (DecimalFormat) DecimalFormat.getInstance(Locale.CHINESE); System.out.println("Locale.CHINESE "+df.format(12345.45)); df = (DecimalFormat) DecimalFormat.getInstance(Locale.GERMAN); System.out.println("Locale.GERMAN "+df.format(12345.45)); }

How to correctly localize Android resources to support multiple languages?

橙三吉。 提交于 2019-12-24 07:49:32
问题 I've been working on an Android application that is going to be used throughout different countries. Because of this I have followed the Android Developer Guide to support different languages for an application and used the Translation Editor in Android Studio to specify the resources I want translated. However the preview Android Studio gives me shows the correct resources, they aren't translated and instead kept at the default value when I run the application. I believe I might have missed

Parsing date in different culture

痞子三分冷 提交于 2019-12-24 07:28:10
问题 I'm developing a software that should be used from a US customer. On my pc (italian) I use CultureInfo cultureUS = CultureInfo.GetCultureInfo("en-US"); DateTime dt = DateTime.Parse(s, cultureUS); and this works with a string like Sat, Sep 8, 2012 . But when my software is used on customer pc, he gets the error String was not recognized as a valid DateTime Why? What's wrong? What should I use to let it work everywhere? EDIT: just to avoid confusion: I read those kind of dates both from web and

Xerces XMLString::transcode null/empty reply

心不动则不痛 提交于 2019-12-24 05:04:21
问题 Xerces transcode is returning an empty string. I think it is related to locale issues, but i'm stuck. I have this simple program: #include <xercesc/util/PlatformUtils.hpp> #include <xercesc/util/XMLString.hpp> #include <xercesc/dom/DOM.hpp> #include <xercesc/util/XMLString.hpp> #include <xercesc/framework/MemBufInputSource.hpp> #include <xercesc/dom/DOMException.hpp> #include <string> #include <stdio.h> XERCES_CPP_NAMESPACE_USE using namespace std; int main(int argc, char* argv[]) { string a

Change PostgreSQL date language from request

谁说胖子不能爱 提交于 2019-12-24 04:40:50
问题 I'm kind of new to PostgreSQL and I'm trying to change the locale of the date function results, to get the result of to_char(my_date, 'Month') in another language. Here are some of my settings : $> show lc_time; en_US.UTF-8 I found in the documentation that the locale could be changed at the database initialization : initdb --locale=fr_FR But that's not exactly what I'm looking for. In MySQL, I used to do it like : SET lc_time_names = 'fr_FR'; But unfortunately, I can't find a way to do it

How can I prevent embedded resource file culture being set based on its filename

老子叫甜甜 提交于 2019-12-24 04:14:06
问题 In a VS2015 .NET 4.6.1 project, I have a data resource file with a Build Action set to 'Embedded Resource' and a name as follows: myDataFile.bin.zip Unfortunately 'bin' is a locale that is present on my Windows 10 machine, which is causing the file to be identified as a resource for a specific locale, rather than the default one (Visual Studio seems to recognise files named in the format <name>.<locale>.<ext> as being specific to a locale), resulting in the creation of a satellite assembly.

gnome 3.12 cannot be launched + locale does not help out

佐手、 提交于 2019-12-24 03:48:12
问题 I have recently installed debian "testing" jessie RC betta. I wanted to personalized system-wide the gnome-terminal by changing the custom default terminal size in the file /usr/share/vte/termcap/xterm . In fact, I just changed with gedit the the col and li numbers in the following line :co#80:it#8:li#24:\ . After I did that, I was not able to launch any more the gnome terminal 3.12.3. I got the following output: ~$ gnome-terminal (process:2879): Gtk-WARNING **: Locale not supported by C

quickly change Android system language

删除回忆录丶 提交于 2019-12-24 02:17:29
问题 I'm studying mandarin and want to change the language of my Android smartphone (Sony Xperia) between english/mandarin (or english/mandarin/portuguese/spanish) faster than using the default system settings. The way it is, I have to enter settings, scroll to the middle of it (which is slower than if it was on the beginning or end of the list), click Language & input, click language, have to scroll all the way down to 中文 (it should already be at the top, among the "recently used languages", but

different locale pattern on standalone Java application and Web application

半城伤御伤魂 提交于 2019-12-24 02:09:34
问题 Why there is a different outputs for below code when tried as a standalone Java application and as a Web application (Servlet)? Code: Locale locale=new java.util.Locale("nb");// locale for Norwegian, Bokmal (Norway) DecimalFormat decimalFormatter=(DecimalFormat) DecimalFormat.getInstance(locale); System.out.println(decimalFormatter.toLocalizedPattern()); System.out.println(locale.getDisplayLanguage()); System.out.println(decimalFormatter.format(1234.567)); Outputs: standalone JAVA application

linux locale unset

吃可爱长大的小学妹 提交于 2019-12-24 01:26:16
问题 I have a ARM based machine with ubuntu distro on it and it often feeds me with this while running various commands: Please check that your locale settings: LANGUAGE = (unset), LC_ALL = (unset), LANG = "pl_PL.UTF-8" This is output of the locale command locale: Cannot set LC_CTYPE to default locale: No such file or directory locale: Cannot set LC_MESSAGES to default locale: No such file or directory locale: Cannot set LC_ALL to default locale: No such file or directory LANG=pl_PL.UTF-8 LC_CTYPE