Browse Source

+ SysLocale

florian 20 years ago
parent
commit
7fef413b69

+ 5 - 1
rtl/beos/sysutils.pp

@@ -235,6 +235,7 @@ end;
 
 Procedure InitInternational;
 begin
+  InitInternationalGeneric;
   InitAnsi;
 end;
 
@@ -323,7 +324,10 @@ Finalization
 end.
 {
   $Log$
-  Revision 1.11  2005-02-14 17:13:21  peter
+  Revision 1.12  2005-02-26 14:38:14  florian
+    + SysLocale
+
+  Revision 1.11  2005/02/14 17:13:21  peter
     * truncate log
 
 }

+ 33 - 29
rtl/emx/sysutils.pp

@@ -1045,34 +1045,35 @@ var Country: TCountryCode;
     Size: cardinal;
     RC: cardinal;
 begin
-    Size := 0;
-    FillChar (Country, SizeOf (Country), 0);
-    FillChar (CtryInfo, SizeOf (CtryInfo), 0);
-    RC := DosQueryCtryInfo (SizeOf (CtryInfo), Country, CtryInfo, Size);
-    if RC = 0 then
-        begin
-            DateSeparator := CtryInfo.DateSeparator;
-            case CtryInfo.DateFormat of
-             1: begin
-                    ShortDateFormat := 'd/m/y';
-                    LongDateFormat := 'dd" "mmmm" "yyyy';
-                end;
-             2: begin
-                    ShortDateFormat := 'y/m/d';
-                    LongDateFormat := 'yyyy" "mmmm" "dd';
-                end;
-             3: begin
-                    ShortDateFormat := 'm/d/y';
-                    LongDateFormat := 'mmmm" "dd" "yyyy';
-                end;
-            end;
-            TimeSeparator := CtryInfo.TimeSeparator;
-            DecimalSeparator := CtryInfo.DecimalSeparator;
-            ThousandSeparator := CtryInfo.ThousandSeparator;
-            CurrencyFormat := CtryInfo.CurrencyFormat;
-            CurrencyString := PChar (CtryInfo.CurrencyUnit);
-        end;
-    InitAnsi;
+  Size := 0;
+  FillChar (Country, SizeOf (Country), 0);
+  FillChar (CtryInfo, SizeOf (CtryInfo), 0);
+  RC := DosQueryCtryInfo (SizeOf (CtryInfo), Country, CtryInfo, Size);
+  if RC = 0 then
+      begin
+          DateSeparator := CtryInfo.DateSeparator;
+          case CtryInfo.DateFormat of
+           1: begin
+                  ShortDateFormat := 'd/m/y';
+                  LongDateFormat := 'dd" "mmmm" "yyyy';
+              end;
+           2: begin
+                  ShortDateFormat := 'y/m/d';
+                  LongDateFormat := 'yyyy" "mmmm" "dd';
+              end;
+           3: begin
+                  ShortDateFormat := 'm/d/y';
+                  LongDateFormat := 'mmmm" "dd" "yyyy';
+              end;
+          end;
+          TimeSeparator := CtryInfo.TimeSeparator;
+          DecimalSeparator := CtryInfo.DecimalSeparator;
+          ThousandSeparator := CtryInfo.ThousandSeparator;
+          CurrencyFormat := CtryInfo.CurrencyFormat;
+          CurrencyString := PChar (CtryInfo.CurrencyUnit);
+      end;
+  InitAnsi;
+  InitInternationalGeneric;
 end;
 
 function SysErrorMessage(ErrorCode: Integer): String;
@@ -1222,7 +1223,10 @@ end.
 
 {
   $Log$
-  Revision 1.19  2005-02-14 17:13:22  peter
+  Revision 1.20  2005-02-26 14:38:14  florian
+    + SysLocale
+
+  Revision 1.19  2005/02/14 17:13:22  peter
     * truncate log
 
 }

+ 5 - 1
rtl/go32v2/sysutils.pp

@@ -720,6 +720,7 @@ end;
 
 Procedure InitInternational;
 begin
+  InitInternationalGeneric;
   InitAnsi;
 end;
 
@@ -832,7 +833,10 @@ Finalization
 end.
 {
   $Log$
-  Revision 1.27  2005-02-14 17:13:22  peter
+  Revision 1.28  2005-02-26 14:38:14  florian
+    + SysLocale
+
+  Revision 1.27  2005/02/14 17:13:22  peter
     * truncate log
 
 }

+ 6 - 2
rtl/macos/sysutils.pp

@@ -618,7 +618,8 @@ end;
 
 Procedure InitInternational;
 begin
-  InitAnsi;
+  InitInternationalGeneric;
+  InitAnsi;  
 end;
 
 function SysErrorMessage(ErrorCode: Integer): String;
@@ -718,7 +719,10 @@ end.
 
 {
   $Log$
-  Revision 1.6  2005-02-14 17:13:30  peter
+  Revision 1.7  2005-02-26 14:38:14  florian
+    + SysLocale
+
+  Revision 1.6  2005/02/14 17:13:30  peter
     * truncate log
 
   Revision 1.5  2005/01/24 18:28:58  olle

+ 5 - 1
rtl/morphos/sysutils.pp

@@ -486,6 +486,7 @@ end;
 
 Procedure InitInternational;
 begin
+  InitInternationalGeneric; 
   InitAnsi;
 end;
 
@@ -568,7 +569,10 @@ Finalization
 end.
 {
     $Log$
-    Revision 1.6  2005-02-14 17:13:30  peter
+    Revision 1.7  2005-02-26 14:38:14  florian
+      + SysLocale
+
+    Revision 1.6  2005/02/14 17:13:30  peter
       * truncate log
 
     Revision 1.5  2005/01/30 02:36:14  karoly

+ 5 - 1
rtl/netware/sysutils.pp

@@ -490,6 +490,7 @@ end;
 
 Procedure InitInternational;
 begin
+  InitInternationalGeneric;
   InitAnsi;
 end;
 
@@ -583,7 +584,10 @@ end.
 {
 
   $Log$
-  Revision 1.19  2005-02-14 17:13:30  peter
+  Revision 1.20  2005-02-26 14:38:14  florian
+    + SysLocale
+
+  Revision 1.19  2005/02/14 17:13:30  peter
     * truncate log
 
 }

+ 5 - 1
rtl/netwlibc/sysutils.pp

@@ -552,6 +552,7 @@ end;
 
 Procedure InitInternational;
 begin
+  InitInternationalGeneric;
   InitAnsi;
 end;
 
@@ -699,7 +700,10 @@ end.
 {
 
   $Log$
-  Revision 1.9  2005-02-14 17:13:30  peter
+  Revision 1.10  2005-02-26 14:38:14  florian
+    + SysLocale
+
+  Revision 1.9  2005/02/14 17:13:30  peter
     * truncate log
 
   Revision 1.8  2005/01/04 11:25:34  armin

+ 17 - 1
rtl/objpas/sysutils/sysinth.inc

@@ -128,9 +128,25 @@ Const
   { Currency notation. Default is $ for dollars. }
   CurrencyString : String[7] = '$';
 
+type
+  TSysLocale = record
+    case byte of
+      { win32 names }
+      1 : (FarEast: boolean; MiddleEast: Boolean);
+      { real meaning }
+      2 : (MBCS : boolean; RightToLeft: Boolean);
+  end;
+
+var
+  SysLocale : TSysLocale;
+
+
 {
   $Log$
-  Revision 1.2  2005-02-14 17:13:31  peter
+  Revision 1.3  2005-02-26 14:38:14  florian
+    + SysLocale
+
+  Revision 1.2  2005/02/14 17:13:31  peter
     * truncate log
 
 }

+ 3 - 0
rtl/objpas/sysutils/sysutils.inc

@@ -64,6 +64,9 @@
   { Read pchar handling functions implementation }
   {$i syspch.inc}
 
+  { generic internationalisation code }
+  {$i sysint.inc}
+
   { MCBS functions }
   {$i sysansi.inc}
 

+ 5 - 1
rtl/unix/sysutils.pp

@@ -856,6 +856,7 @@ end;
 
 Procedure InitInternational;
 begin
+  InitInternationalGeneric;
   InitAnsi;
 end;
 
@@ -1105,7 +1106,10 @@ end.
 {
 
   $Log$
-  Revision 1.57  2005-02-14 17:13:31  peter
+  Revision 1.58  2005-02-26 14:38:14  florian
+    + SysLocale
+
+  Revision 1.57  2005/02/14 17:13:31  peter
     * truncate log
 
    * getenv had ansistring as param due to {$H+} now shortstring.

+ 5 - 1
rtl/watcom/sysutils.pp

@@ -725,6 +725,7 @@ end;
 
 Procedure InitInternational;
 begin
+  InitInternationalGeneric;
   InitAnsi;
 end;
 
@@ -878,7 +879,10 @@ end.
 
 {
   $Log$
-  Revision 1.7  2005-02-14 17:13:32  peter
+  Revision 1.8  2005-02-26 14:38:14  florian
+    + SysLocale
+
+  Revision 1.7  2005/02/14 17:13:32  peter
     * truncate log
 
 }

+ 7 - 3
rtl/win32/sysutils.pp

@@ -610,6 +610,9 @@ end;
 
 Procedure InitInternational;
 begin
+  InitInternationalGeneric;
+  SysLocale.MBCS:=GetSystemMetrics(SM_DBCSENABLED)<>0;
+  SysLocale.RightToLeft:=GetSystemMetrics(SM_MIDEASTENABLED)<>0;  
   InitAnsi;
   GetFormatSettings;
 end;
@@ -988,8 +991,6 @@ begin
 end;
 
 
-
-
 Initialization
   InitExceptions;       { Initialize exceptions. OS independent }
   InitInternational;    { Initialize internationalization settings }
@@ -1005,7 +1006,10 @@ Finalization
 end.
 {
   $Log$
-  Revision 1.40  2005-02-14 17:13:32  peter
+  Revision 1.41  2005-02-26 14:38:14  florian
+    + SysLocale
+
+  Revision 1.40  2005/02/14 17:13:32  peter
     * truncate log
 
 }