bug-gnustep
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Fix: Default Locale


From: Georg Fleischmann
Subject: Fix: Default Locale
Date: Thu, 30 May 2002 19:53:58 GMT

Hi,

here are two small patches to fix a problem with the default locale.
My problem was that if the environment is set to German, the results of  
methods using the default locale change: The Decimal Separator may be komma or  
dot depending on the environment.
My OpenStep docs say that the default locale is US English.

The 1st patch changes NSObject to set the default locale to en_US instead of  
using the environment.

The 2nd patch for NSUserDefaults sets the default locale back to en_US after  
reading the environment settings.

Georg


2002-05-30  Georg Fleischmann

        * base/Source/NSObject.m
        [NSObject +initialize]: set default locale to US English
        * base/Source/NSUserDefaults.m
        [NSUserDefaults +userLanguages]: set locale back to default



*** base/Source/NSObject.m.old  Thu May 30 18:19:48 2002
--- base/Source/NSObject.m      Thu May 30 18:12:17 2002
***************
*** 713,719 ****
        }
  #endif

!       GSSetLocaleC("");               // Set up locale from environment.

        // Create the global lock
        gnustep_global_lock = [[NSRecursiveLock alloc] init];
--- 713,719 ----
        }
  #endif

!       GSSetLocaleC("en_US");          // Set up default locale (US English).

        // Create the global lock
        gnustep_global_lock = [[NSRecursiveLock alloc] init];



*** base/Source/NSUserDefaults.m.old    Tue Mar 26 20:00:07 2002
--- base/Source/NSUserDefaults.m        Thu May 30 19:46:36 2002
***************
*** 450,455 ****
--- 450,456 ----
      }
    userLanguages = RETAIN([NSMutableArray arrayWithCapacity: 5]);
    locale = GSSetLocale(@"");
+   GSSetLocale(@"en_US");
    if (sharedDefaults == nil)
      {
        /* Create our own defaults to get "NSLanguages" since sharedDefaults



reply via email to

[Prev in Thread] Current Thread [Next in Thread]