1 #import	"Foundation/NSArray.h"
2 #import	"Foundation/NSDictionary.h"
3 #import	"Foundation/NSString.h"
4 #import	"Foundation/NSUserDefaults.h"
5 
6 /* Function to return a standardised locale dictionary.
7  */
8 static NSMutableDictionary *
westernLocale()9 westernLocale()
10 {
11   NSArray	 *ampm;
12   NSArray	 *long_day;
13   NSArray	 *long_month;
14   NSArray	 *short_day;
15   NSArray	 *short_month;
16   NSArray	 *earlyt;
17   NSArray	 *latert;
18   NSArray	 *hour_names;
19   NSArray	 *ymw_names;
20 
21   ampm = [NSArray arrayWithObjects: @"AM", @"PM", nil];
22 
23   short_month = [NSArray arrayWithObjects:
24     @"Jan",
25     @"Feb",
26     @"Mar",
27     @"Apr",
28     @"May",
29     @"Jun",
30     @"Jul",
31     @"Aug",
32     @"Sep",
33     @"Oct",
34     @"Nov",
35     @"Dec",
36     nil];
37 
38   long_month = [NSArray arrayWithObjects:
39     @"January",
40     @"February",
41     @"March",
42     @"April",
43     @"May",
44     @"June",
45     @"July",
46     @"August",
47     @"September",
48     @"October",
49     @"November",
50     @"December",
51     nil];
52 
53   short_day = [NSArray arrayWithObjects:
54     @"Sun",
55     @"Mon",
56     @"Tue",
57     @"Wed",
58     @"Thu",
59     @"Fri",
60     @"Sat",
61     nil];
62 
63   long_day = [NSArray arrayWithObjects:
64     @"Sunday",
65     @"Monday",
66     @"Tuesday",
67     @"Wednesday",
68     @"Thursday",
69     @"Friday",
70     @"Saturday",
71     nil];
72 
73   earlyt = [NSArray arrayWithObjects:
74     @"prior",
75     @"last",
76     @"past",
77     @"ago",
78     nil];
79 
80   latert = [NSArray arrayWithObjects: @"next", nil];
81 
82   ymw_names = [NSArray arrayWithObjects: @"year", @"month", @"week", nil];
83 
84   hour_names = [NSArray arrayWithObjects:
85     [NSArray arrayWithObjects: @"0", @"midnight", nil],
86     [NSArray arrayWithObjects: @"12", @"noon", @"lunch", nil],
87     [NSArray arrayWithObjects: @"10", @"morning", nil],
88     [NSArray arrayWithObjects: @"14", @"afternoon", nil],
89     [NSArray arrayWithObjects: @"19", @"dinner", nil],
90     nil];
91 
92   return [NSMutableDictionary dictionaryWithObjectsAndKeys:
93     ampm, NSAMPMDesignation,
94     long_month, NSMonthNameArray,
95     long_day, NSWeekDayNameArray,
96     short_month, NSShortMonthNameArray,
97     short_day, NSShortWeekDayNameArray,
98     @"DMYH", NSDateTimeOrdering,
99     [NSArray arrayWithObject: @"tomorrow"], NSNextDayDesignations,
100     [NSArray arrayWithObject: @"nextday"], NSNextNextDayDesignations,
101     [NSArray arrayWithObject: @"yesterday"], NSPriorDayDesignations,
102     [NSArray arrayWithObject: @"today"], NSThisDayDesignations,
103     earlyt, NSEarlierTimeDesignations,
104     latert, NSLaterTimeDesignations,
105     hour_names, NSHourNameDesignations,
106     ymw_names, NSYearMonthWeekDesignations,
107     nil];
108 }
109