简体   繁体   English

如何更改 IntelliJ IDEA 使用的语言环境?

[英]How can I change the locale used by IntelliJ IDEA?

I tried creating a new Gradle project with IntelliJ IDEA (11.1.3 Community Edition).我尝试使用 IntelliJ IDEA(11.1.3 社区版)创建一个新的 Gradle 项目。 Unfortunately, I am confronted with this error:不幸的是,我遇到了这个错误:

在此处输入图像描述

The IDE log reveals this error: IDE 日志显示此错误:

2012-08-19 06:48:50,873 [ 735372]   WARN - .plugins.gradle.util.GradleLog - java.util.MissingResourceException: Can't find bundle for base name i18n.GradleBundle, locale en_CA

No big surprise there.那里没有什么大惊喜。

I am not sure how IntelliJ IDEA determines which locale to use, but it correctly determined that I live in Canada.我不确定 IntelliJ IDEA 如何确定要使用的语言环境,但它正确地确定了我住在加拿大。 I tried to change the locale to en_US by passing the following command line flags to the JVM in the idea.sh shell script:我尝试通过将以下命令行标志传递给idea.sh shell 脚本中的 JVM 来将语言环境更改为 en_US:

# Adam's custom args:
LOCALE_ARGS="-Duser.language=en -Duser.country=US -Duser.variant=US"

ALL_JVM_ARGS="$LOCALE_ARGS $VM_OPTIONS $COMMON_JVM_ARGS $IDE_JVM_ARGS $AGENT $REQUIRED_JVM_ARGS"

Unfortunately, it still insists on using en_CA.不幸的是,它仍然坚持使用 en_CA。

How do I change the locale used by IntelliJ IDEA?如何更改 IntelliJ IDEA 使用的语言环境?

The error message in idea.log indicates that the Grade plugin itself does not reuse IDEA's system properties. idea.log的错误消息表明Grade插件本身不会重用IDEA的系统属性。 This is a known bug verified by JetBrains and you can vote for it. 这是JetBrains验证的已知错误 ,您可以投票支持它。

This won't help with the gradle bug mentioned in the answer (which I dunno might be fixed by now) but here's how I changed the Locale used by IntelliJ itself这对答案中提到的 gradle 错误(我不知道现在可能已修复)没有帮助,但这是我更改 IntelliJ 本身使用的语言环境的方法

Help --> Edit Custom VM Options帮助 --> 编辑自定义 VM 选项

append these three lines append 这三根线

-Duser.language=en
-Duser.country=US
-Duser.variant=US

save and restart IntelliJ保存并重新启动 IntelliJ

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM