A culture consists of a language in lower case and a country in upper case. A locale consists of the culture code plus a variant code. To separate these two, Microsoft/ASP uses dashes and Java/UNIX uses underlines.
ASP.NET
<%@Import Namespace="System.Globalization"%>
... <%=DateTime.Now.ToString("f", new System.Globalization.CultureInfo("de-DE"))%>
Java InternationalizationInternally, most Java packages make use of the 1.4.2/ 1.5 java.util.Locale package that encapsulate locale information in Locale objects. To instantiate a Locale object with the default Locale obtained from the operating system:
import java.util.Locale.*;
... private Locale locale = new java.util.Locale.getDefault(); Internally, the Locale id for English in the United States is “en_US”. To set the default locale, the country and variant are optional but the language is required:
java.util.Locale.setDefault( localevar );
|
Next: Internationalization |
| Your first name: Your family name: Your location (city, country): Your Email address: |
Top of Page Thank you! |