I've been tasked with the awesome job of generating a look-up table for our application culture information. The columns I need to generate data for are:
我的任务是为我们的应用程序文化信息生成查找表。我需要生成数据的列是:
- Dot Net Code
- Version
- Culture Name
- Country Name
- Language Name
- Java Country Code
- Java Language Code
- Iso Country Code
- Iso Language Code
Dot Net Code
Java国家代码
Java语言代码
Iso国家代码
Iso语言代码
I have found the globalization name space, but I'm sure someone out there has asked the same question, or there is a table already available.
我找到了全球化名称空间,但我确信有人在那里问了同样的问题,或者已经有一张桌子了。
Thanks for any help
谢谢你的帮助
4 个解决方案
#1
2
Java uses the 2-letter ISO country and language codes. I recommend getting rid of the "Java Country Code" and "Java Language Code" fields in your lookup table, since they would be redundant.
Java使用2个字母的ISO国家和语言代码。我建议在查找表中删除“Java Country Code”和“Java Language Code”字段,因为它们是多余的。
I assume that wherever you get your ISO country and language codes, you'll find their corresponding names in English. However, the Java Locale API will give also you the localized names for the country and language, if you need them. (I.e., what is America called in Japan?)
我假设无论您获得ISO国家/地区和语言代码,都可以找到相应的英文名称。但是,如果需要,Java Locale API还会为您提供国家/地区和语言的本地化名称。 (即,美国在日本叫什么?)
For example, you can do this:
例如,您可以这样做:
Locale l = Locale.ITALY;
System.out.println(l.getDisplayCountry() + ": " + l.getDisplayLanguage());
System.out.println(l.getDisplayCountry(l) + ": " + l.getDisplayLanguage(l));
Which, running in the US English locale prints:
其中,在美国英语语言环境中运行:
Italy: Italian
Italia: italiano
Note that you can obtain 3-letter ISO codes from the Locale class, but when constructing them, be sure to only use 2-letter codes.
请注意,您可以从Locale类中获取3个字母的ISO代码,但在构造它们时,请确保仅使用双字母代码。
#2
2
That's strange, the last time I visited this page, someone had beaten me to posting the links to the Java references for Localization.
这很奇怪,上次我访问这个页面时,有人殴打我发布了本地化的Java引用链接。
However, since their post is gone, here's what I was writing before they beat me to it.
然而,由于他们的帖子已经不见了,所以这就是我在他们打败之前写的东西。
Java uses two ISO standards for localization with java,util.Locale.
Java使用两种ISO标准进行本地化,使用java,util.Locale。
#3
0
Java uses Locales to store this information. Most of all the information you need regarding it can be found on Sun's Internationalization page. Java uses a syntax similar to the "en-us" syntax, however rather than using a hyphen it delineates with an underscore.
Java使用Locales存储此信息。有关它的大部分信息都可以在Sun的国际化页面上找到。 Java使用类似于“en-us”语法的语法,但不是使用连字符,而是用下划线表示。
#4
0
I'm guessing that you mean Localization or Internationalization or i18n.
我猜你的意思是本地化或国际化或i18n。
Try this tutorial:
http://java.sun.com/docs/books/tutorial/i18n/index.html
试试这个教程:http://java.sun.com/docs/books/tutorial/i18n/index.html
Good Luck, Randy Stegbauer
祝你好运,Randy Stegbauer
#1
2
Java uses the 2-letter ISO country and language codes. I recommend getting rid of the "Java Country Code" and "Java Language Code" fields in your lookup table, since they would be redundant.
Java使用2个字母的ISO国家和语言代码。我建议在查找表中删除“Java Country Code”和“Java Language Code”字段,因为它们是多余的。
I assume that wherever you get your ISO country and language codes, you'll find their corresponding names in English. However, the Java Locale API will give also you the localized names for the country and language, if you need them. (I.e., what is America called in Japan?)
我假设无论您获得ISO国家/地区和语言代码,都可以找到相应的英文名称。但是,如果需要,Java Locale API还会为您提供国家/地区和语言的本地化名称。 (即,美国在日本叫什么?)
For example, you can do this:
例如,您可以这样做:
Locale l = Locale.ITALY;
System.out.println(l.getDisplayCountry() + ": " + l.getDisplayLanguage());
System.out.println(l.getDisplayCountry(l) + ": " + l.getDisplayLanguage(l));
Which, running in the US English locale prints:
其中,在美国英语语言环境中运行:
Italy: Italian
Italia: italiano
Note that you can obtain 3-letter ISO codes from the Locale class, but when constructing them, be sure to only use 2-letter codes.
请注意,您可以从Locale类中获取3个字母的ISO代码,但在构造它们时,请确保仅使用双字母代码。
#2
2
That's strange, the last time I visited this page, someone had beaten me to posting the links to the Java references for Localization.
这很奇怪,上次我访问这个页面时,有人殴打我发布了本地化的Java引用链接。
However, since their post is gone, here's what I was writing before they beat me to it.
然而,由于他们的帖子已经不见了,所以这就是我在他们打败之前写的东西。
Java uses two ISO standards for localization with java,util.Locale.
Java使用两种ISO标准进行本地化,使用java,util.Locale。
#3
0
Java uses Locales to store this information. Most of all the information you need regarding it can be found on Sun's Internationalization page. Java uses a syntax similar to the "en-us" syntax, however rather than using a hyphen it delineates with an underscore.
Java使用Locales存储此信息。有关它的大部分信息都可以在Sun的国际化页面上找到。 Java使用类似于“en-us”语法的语法,但不是使用连字符,而是用下划线表示。
#4
0
I'm guessing that you mean Localization or Internationalization or i18n.
我猜你的意思是本地化或国际化或i18n。
Try this tutorial:
http://java.sun.com/docs/books/tutorial/i18n/index.html
试试这个教程:http://java.sun.com/docs/books/tutorial/i18n/index.html
Good Luck, Randy Stegbauer
祝你好运,Randy Stegbauer