summaryrefslogtreecommitdiff
path: root/fpcsrc/rtl/objpas/sysutils/sysinth.inc
blob: 7579e2704154f56f989423e4d9a3a7a5f3f40ed0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
{
    This file is part of the Free Pascal run time library.
    Copyright (c) 1999-2000 by the Free Pascal development team

    International settings for Sysutils unit.

    See the file COPYING.FPC, included in this distribution,
    for details about the copyright.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

 **********************************************************************}

{
  All the variables presented here must be set by the InitInternational
  routine. They must be set to match the 'local' settings, although
  most have an initial value.


  These routines are OS-dependent.
}

{ ---------------------------------------------------------------------
    Upper/lowercase translations
  ---------------------------------------------------------------------}

type
  TMonthNameArray = array[1..12] of string;
  TWeekNameArray = array[1..7] of string;

  TFormatSettings = record
    CurrencyFormat: Byte;
    NegCurrFormat: Byte;
    ThousandSeparator: Char;
    DecimalSeparator: Char;
    CurrencyDecimals: Byte;
    DateSeparator: Char;
    TimeSeparator: Char;
    ListSeparator: Char;
    CurrencyString: string;
    ShortDateFormat: string;
    LongDateFormat: string;
    TimeAMString: string;
    TimePMString: string;
    ShortTimeFormat: string;
    LongTimeFormat: string;
    ShortMonthNames: TMonthNameArray;
    LongMonthNames: TMonthNameArray;
    ShortDayNames: TWeekNameArray;
    LongDayNames: TWeekNameArray;
    TwoDigitYearCenturyWindow: Word;
  end;

var
  DefaultFormatSettings : TFormatSettings = (
    CurrencyFormat: 1;
    NegCurrFormat: 5;
    ThousandSeparator: ',';
    DecimalSeparator: '.';
    CurrencyDecimals: 2;
    DateSeparator: '-';
    TimeSeparator: ':';
    ListSeparator: ',';
    CurrencyString: '$';
    ShortDateFormat: 'd/m/y';
    LongDateFormat: 'dd" "mmmm" "yyyy';
    TimeAMString: 'AM';
    TimePMString: 'PM';
    ShortTimeFormat: 'hh:nn';
    LongTimeFormat: 'hh:nn:ss';
    ShortMonthNames: ('Jan','Feb','Mar','Apr','May','Jun', 
                      'Jul','Aug','Sep','Oct','Nov','Dec');
    LongMonthNames: ('January','February','March','April','May','June',
                     'July','August','September','October','November','December');
    ShortDayNames: ('Sun','Mon','Tue','Wed','Thu','Fri','Sat');
    LongDayNames:  ('Sunday','Monday','Tuesday','Wednesday','Thursday','Friday','Saturday');
    TwoDigitYearCenturyWindow: 50;
  );

  FormatSettings : TFormatSettings absolute DefaultFormatSettings;
{ ---------------------------------------------------------------------
    Date formatting settings
  ---------------------------------------------------------------------}

Var

   { Character to be put between date, month and year }
   DateSeparator: char absolute DefaultFormatSettings.DateSeparator deprecated;

   { Format used for short date notation }
   ShortDateFormat: string absolute DefaultFormatSettings.ShortDateFormat deprecated;

   { Format used for long date notation }
   LongDateFormat: string absolute DefaultFormatSettings.LongDateFormat deprecated;


   { Short names of months. }
   ShortMonthNames: TMonthNameArray absolute DefaultFormatSettings.ShortMonthNames deprecated;

   { Long names of months. }
   LongMonthNames: TMonthNameArray absolute DefaultFormatSettings.LongMonthNames deprecated;

   { Short names of days }
   ShortDayNames: TWeekNameArray absolute DefaultFormatSettings.ShortDayNames deprecated;

   { Full names of days }
   LongDayNames: TWeekNameArray absolute DefaultFormatSettings.LongDayNames deprecated;

   { Format used for short time notation }
   ShortTimeFormat: string absolute DefaultFormatSettings.ShortTimeFormat deprecated;

   { Format used for long time notation }
   LongTimeFormat: string absolute DefaultFormatSettings.LongTimeFormat deprecated;

   { Character to be put between hours and minutes }
   TimeSeparator: char absolute DefaultFormatSettings.TimeSeparator deprecated;

   { String to indicate AM time when using 12 hour clock. }
   TimeAMString: string absolute DefaultFormatSettings.TimeAMString deprecated;

   { String to indicate PM time when using 12 hour clock. }
   TimePMString: string absolute DefaultFormatSettings.TimePMString deprecated;



{ ---------------------------------------------------------------------
    Number formatting constants
  ---------------------------------------------------------------------}


  { Character that comes between integer and fractional part of a number }
  DecimalSeparator : Char absolute DefaultFormatSettings.DecimalSeparator deprecated;

  { Character that is put every 3 numbers in a currency }
  ThousandSeparator : Char absolute DefaultFormatSettings.ThousandSeparator deprecated;

  { Number of decimals to use when formatting a currency.  }
  CurrencyDecimals : Byte absolute DefaultFormatSettings.CurrencyDecimals deprecated;

  { Format to use when formatting currency :
    0 = $1
    1 = 1$
    2 = $ 1
    3 = 1 $
    4 = Currency string replaces decimal indicator. e.g. 1$50
   }
  CurrencyFormat : Byte absolute DefaultFormatSettings.CurrencyFormat deprecated;

  { Same as above, only for negative currencies:
    0 = ($1)
    1 = -$1
    2 = $-1
    3 = $1-
    4 = (1$)
    5 = -1$
    6 = 1-$
    7 = 1$-
    8 = -1 $
    9 = -$ 1
    10 = $ 1-
   }
  NegCurrFormat : Byte absolute DefaultFormatSettings.NegCurrFormat deprecated;

  { Currency notation. Default is $ for dollars. }
  CurrencyString : String absolute DefaultFormatSettings.CurrencyString deprecated;

  ListSeparator: Char absolute DefaultFormatSettings.ListSeparator deprecated;

type
  TSysLocale = record
    { Delphi compat fields}
    DefaultLCID,
    PriLangID,
    SubLangID  : Integer;

    case byte of
      { win32 names }
      1 : (FarEast: boolean; MiddleEast: Boolean);
      { real meaning }
      2 : (MBCS : boolean; RightToLeft: Boolean);
  end;

var
  SysLocale : TSysLocale;