Java 7默认语言环境 [英] Java 7 default locale

查看:476
本文介绍了Java 7默认语言环境的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我刚刚安装了jre7,我很惊讶地看到我的默认语言环境现在是en_US。有了jre6,它就是de_CH。

I have just installed jre7 and I'm surprised to see that my default locale is now en_US. With jre6 it was de_CH.

与jre7有什么不同?默认语言环境不再是操作系统之一吗? (顺便说一下,我正在使用Windows7)

What is different with jre7? Is the default locale no more the one of the Operating System? (btw, I'm using Windows7)

Thx为您的答案。

Thx for your answer.

编辑:
我看到 Category.FORMAT 的区域设置是旧区域(de_CH)。 Category.DISPLAY 的区域设置采用操作系统语言中的语言(在Windows中,这在控制面板>区域和语言>键盘和语言>显示语言中完成)和来自...的contry ?

I have seen the Locale for Category.FORMAT is the "old" one (de_CH). The Locale for Category.DISPLAY takes the language from the language of the OS (in Windows this is done in Control Panel > Region and Language > Keyboard and Languages > Display Language) and the contry from...?

属性 user.country 似乎有所不同。使用Java6我得到CH,而使用Java7我得到US。

What seems to be different is the property "user.country". With Java6 I get "CH" and with Java7 I get "US".

推荐答案

这是设计的。 Java 7改变了 Locale.getDefault()的工作方式。已经在Oracle中输入了一个缺陷,但他们基本上说这是设计的。

This is as designed. Java 7 has changed the way Locale.getDefault() works. A defect has been entered with Oracle, but they basically said this is As Designed.

总之,您必须修改操作系统的显示语言。仅修改区域格式已经不够了。

To sum up, you must modify the Display Language of the OS. Modifying the Region Format only is no longer sufficient.

在此处阅读错误报告: Locale.getDefault()为Java SE 7返回错误的Locale

Read the bug report here: Locale.getDefault() returns wrong Locale for Java SE 7

这篇关于Java 7默认语言环境的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆