+2004-07-19 Marcus Mueller <znek@mulle-kybernetik.com>
+
+ * sogod.m, */Locale: converted to UTF-8 for better editability (v0.9.3)
+
2004-07-19 Marcus Mueller <znek@mulle-kybernetik.com>
* v0.9.2
* SOGoRootPage.wox: some debug code (for locales).
- * created ChangeLog.
\ No newline at end of file
+ * created ChangeLog.
}
- (NSDictionary *)localeForLanguageNamed:(NSString *)_name {
- NSString *lpath;
+ NSString *lpath;
+ id data;
NSDictionary *locale;
-
+
NSAssert(_name != nil, @"_name MUST NOT be nil!");
- if ((locale = [self->localeLUT objectForKey:_name]) != nil)
+ if((locale = [self->localeLUT objectForKey:_name]) != nil)
return locale;
-
lpath = [[self resourceManager]
- pathForResourceNamed:@"Locale"
- inFramework:nil
- languages:[NSArray arrayWithObject:_name]];
- locale = [[NSString stringWithContentsOfFile:lpath] propertyList];
- if (locale == nil) {
+ pathForResourceNamed:@"Locale"
+ inFramework:nil
+ languages:[NSArray arrayWithObject:_name]];
+
+ data = [NSData dataWithContentsOfFile:lpath];
+ if(data == nil) {
NSLog(@"%s didn't find locale with name:%@",
- __PRETTY_FUNCTION__,
- _name);
+ __PRETTY_FUNCTION__,
+ _name);
+ return nil;
+ }
+ data = [[[NSString alloc] initWithData:data
+ encoding:NSUTF8StringEncoding] autorelease];
+ locale = [data propertyList];
+ if(locale == nil) {
+ NSLog(@"%s couldn't load locale with name:%@",
+ __PRETTY_FUNCTION__,
+ _name);
return nil;
}
[self->localeLUT setObject:locale forKey:_name];