[[TOC()]] = Locale = == Culture == '''Docs:''' [[docs(Culture,tango.text.locale.Core.html)]] Provides information about a culture, such as its name, calendar and date and number format patterns. '''Remarks:''' tango.text.locale adopts the RFC 1766 standard for culture names in the format "-". is a lower-case two-letter code defined by ISO 639-1. is an upper-case two-letter code defined by ISO 3166. For example, "en-GB" is UK English. There are three types of culture: invariant, neutral and specific. The invariant culture is not tied to any specific region, although it is associated with the English language. A neutral culture is associated with a language, but not with a region. A specific culture is associated with a language and a region. "es" is a neutral culture. "es-MX" is a specific culture. Instances of [[docs(DateTimeFormat,tango.text.locale.Core.html)]] and [[docs(NumberFormat,tango.text.locale.Core.html)]] cannot be created for neutral cultures. Examples: {{{ #!d import tango.io.Stdout, tango.text.locale.Core; void main() { Culture culture = new Culture("it-IT"); Stdout.formatln("englishName: {}", culture.englishName); Stdout.formatln("nativeName: {}", culture.nativeName); Stdout.formatln("name: {}", culture.name); Stdout.formatln("parent: {}", culture.parent.name); Stdout.formatln("isNeutral: {}", culture.isNeutral); } }}} Produces the following output: {{{ englishName: Italian (Italy) nativeName: italiano (Italia) name: it-IT parent: it isNeutral: false }}} The users Culture can be obtained by using the zero argument constructor: {{{ #!d Culture culture = new Culture(); // users culture }}} '''Note:''' On linux this first looks at the environment variable "LC_ALL" then at "LANG". == Convert == '''Docs:''' [[docs(Convert,tango.text.locale.Convert.html)]] Convert date and time to culture specific output. == Collation == '''Docs:''' [[docs(Collation,tango.text.locale.Collation.html)]] String comparison == Locale == '''Docs:''' [[docs(Locale,tango.text.locale.Locale.html)]] A Layout which does number formating in a culture sensitive way. == Parse == '''Docs:''' [[docs(Parse,tango.text.locale.Parse.html)]] Parse dates and time with given culture.