discuss-gnustep
[Top][All Lists]
Advanced

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

Re: convenience method for creating locales?


From: David Ayers
Subject: Re: convenience method for creating locales?
Date: Tue, 19 Apr 2005 18:45:32 +0200
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.7) Gecko/20050414

Adam Fedor wrote:


On Apr 19, 2005, at 7:26 AM, David Wetzel wrote:

Hi folks,

NSCalendarDate has descriptionWithCalendarFormat:locale: which needs a locale.

Imagine I have a web application that needs a German (DE) locale for some sessions, for some a DE-AT (January is 'Jänner' in Austrian not 'Januar' like German) and for some EN to name a few.
It does not matter what the locale of the current user process is.

Is there something like

// name is 'DE' or 'FR' or 'DE-AT'...
+ (NSDictionary*) localeWithName:(NSSting*) shortName

This should contain all data to create a localized NSCalendarDate.


There really isn't something like this, but it might be nice to pull out that functionality from NSUserDefaults (+standardUserDefaults). The only problem is, that for locales that aren't in the customized set that is delivered with gnustep-base, you would have to temporarily set the new locale, read the information from the i18n functions, then set the locale back.


[stripped the cross posting]

I had talked to David about something along these lines, but I believe that switching locales isn't thread-safe/specific and I believe we are talking about a potentially multi-threaded web server application.

I'm a bit surprised that there doesn't seem to be a canonical solution to this issue but I haven't searched any cocoa-dev lists yet...

Cheers,
David





reply via email to

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