Download Reference Manual
The Developer's Library for D
About Wiki Forums Source Search Contact

Changes from Version 1 of ChapterLocale

Show
Ignore:
Author:
keinfarbton (IP: 84.161.94.155)
Timestamp:
12/08/07 16:19:23 (16 years ago)
Comment:

Initial version. Copy of some ddoc and links to modules.

Legend:

Unmodified
Added
Removed
Modified
  • ChapterLocale

    v0 v1  
     1[[TOC()]] 
     2 
     3= Locale = 
     4 
     5== Culture == 
     6 
     7'''Docs:''' [[docs(Culture,tango.text.locale.Core.html)]] 
     8 
     9Provides information about a culture, such as its name, calendar and date and number format patterns. 
     10'''Remarks:''' tango.text.locale adopts the RFC 1766 standard for culture names in the format <language>"-"<region>. 
     11<language> is a lower-case two-letter code defined by ISO 639-1. <region> is an upper-case 
     12two-letter code defined by ISO 3166. For example, "en-GB" is UK English. 
     13 
     14There are three types of culture: invariant, neutral and specific. The invariant culture is not tied to 
     15any specific region, although it is associated with the English language. A neutral culture is associated with 
     16a language, but not with a region. A specific culture is associated with a language and a region. "es" is a neutral 
     17culture. "es-MX" is a specific culture. 
     18 
     19Instances of [[docs(DateTimeFormat,tango.text.locale.Core.html)]] and [[docs(NumberFormat,tango.text.locale.Core.html)]] cannot be created for neutral cultures. 
     20Examples: 
     21 
     22{{{ 
     23#!d 
     24import tango.io.Stdout, tango.text.locale.Core; 
     25 
     26void main() { 
     27  Culture culture = new Culture("it-IT"); 
     28 
     29  Stdout.formatln("englishName: {}", culture.englishName); 
     30  Stdout.formatln("nativeName: {}", culture.nativeName); 
     31  Stdout.formatln("name: {}", culture.name); 
     32  Stdout.formatln("parent: {}", culture.parent.name); 
     33  Stdout.formatln("isNeutral: {}", culture.isNeutral); 
     34} 
     35}}} 
     36 
     37Produces the following output: 
     38{{{ 
     39englishName: Italian (Italy) 
     40nativeName: italiano (Italia) 
     41name: it-IT 
     42parent: it 
     43isNeutral: false 
     44}}} 
     45 
     46The users Culture can be obtained by using the zero argument constructor: 
     47{{{ 
     48#!d 
     49  Culture culture = new Culture(); // users culture 
     50}}} 
     51 
     52'''Note:''' On linux this first looks at the environment variable "LC_ALL" then at "LANG". 
     53 
     54== Convert == 
     55 
     56'''Docs:''' [[docs(Convert,tango.text.locale.Convert.html)]] 
     57 
     58Convert date and time to culture specific output. 
     59 
     60== Collation == 
     61 
     62'''Docs:''' [[docs(Collation,tango.text.locale.Collation.html)]] 
     63 
     64String comparison 
     65 
     66== Locale == 
     67 
     68'''Docs:''' [[docs(Locale,tango.text.locale.Locale.html)]] 
     69 
     70A Layout which does number formating in a culture sensitive way. 
     71 
     72== Parse == 
     73 
     74'''Docs:''' [[docs(Parse,tango.text.locale.Parse.html)]] 
     75 
     76Parse dates and time with given culture. 
     77 
     78 
     79