o fix for .strings loading

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gsweb/trunk@19310 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Manuel Guesdon 2004-05-14 11:45:04 +00:00
parent b166da68d3
commit cca0554649
2 changed files with 24 additions and 14 deletions

View file

@ -1,6 +1,6 @@
/** GSWBundle.m - <title>GSWeb: Class GSWBundle</title>
Copyright (C) 1999-2003 Free Software Foundation, Inc.
Copyright (C) 1999-2004 Free Software Foundation, Inc.
Written by: Manuel Guesdon <mguesdon@orange-concept.com>
Date: Mar 1999
@ -731,13 +731,18 @@ objectForReference:(NSString*)keyPath
if (absolutePath)
{
//TODO use encoding ??
stringsTable=[NSDictionary dictionaryWithContentsOfFile:absolutePath];
if (!stringsTable)
NSString* stringsTableContent = [NSString stringWithContentsOfFile:absolutePath];
NS_DURING
{
LOGSeriousError(@"Bad stringTable \n%@\n from file %@",
[NSString stringWithContentsOfFile:absolutePath],
absolutePath);
};
stringsTable = [stringsTableContent propertyListFromStringsFileFormat];
}
NS_HANDLER
{
LOGSeriousError(@"Failed to parse strings file %@ - %@",
absolutePath, localException);
stringsTable = nil;
}
NS_ENDHANDLER
if ([[GSWApplication application] isCachingEnabled])
{
if (stringsTable)

View file

@ -1,6 +1,6 @@
/** GSWResourceManager.m - <title>GSWeb: Class GSWResourceManager</title>
Copyright (C) 1999-2003 Free Software Foundation, Inc.
Copyright (C) 1999-2004 Free Software Foundation, Inc.
Written by: Manuel Guesdon <mguesdon@orange-concept.com>
Date: Jan 1999
@ -724,13 +724,18 @@ NSString* localNotFoundMarker=@"NOTFOUND";
if (path)
{
//TODO use encoding ??
stringsTable=[NSDictionary dictionaryWithContentsOfFile:path];
if (!stringsTable)
NSString* stringsTableContent = [NSString stringWithContentsOfFile:path];
NS_DURING
{
LOGSeriousError(@"Bad stringTable \n%@\n from file %@",
[NSString stringWithContentsOfFile:path],
path);
};
stringsTable = [stringsTableContent propertyListFromStringsFileFormat];
}
NS_HANDLER
{
LOGSeriousError(@"Failed to parse strings file %@ - %@",
path, localException);
stringsTable = nil;
}
NS_ENDHANDLER
};
{
NSMutableDictionary* frameworkDict=[_stringsTablesByFrameworkByLanguageByName objectForKey:aFrameworkName];