discuss-gnustep
[Top][All Lists]
Advanced

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

parsing English dates in a German locale


From: Marko Riedel
Subject: parsing English dates in a German locale
Date: Wed, 8 Mar 2006 13:38:14 +0100 (CET)

Hi folks,

you need a dictionary of the English locale settings in order to parse
English dates in a German locale with NSCalendarDate (method
dateWithString:calendarFormat:). Is there a better way than doing


static id _english = nil;

+ (NSDictionary *)englishLocale
{
    if(_english == nil){
        NSBundle *gbundle = [NSBundle bundleForLibrary:@"gnustep-base"];
        NSString *path = 
            [gbundle pathForResource:@"English"
                     ofType:nil
                     inDirectory:@"Languages"];
        if(path!=nil){
            _english = [[NSDictionary alloc] initWithContentsOfFile:path];
        }
    }

    return _english;
}

and using that as the third argument to dateWithString:calendarFormat:?

Best regards,

Marko



+-------------------------------------------------------------+
| Marko Riedel, EDV Neue Arbeit gGmbH, markoriedelde@yahoo.de |
| http://www.geocities.com/markoriedelde/index.html           |
+-------------------------------------------------------------+


        

        
                
___________________________________________________________ 
Telefonate ohne weitere Kosten vom PC zum PC: http://messenger.yahoo.de




reply via email to

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