Fixing RSS reading when the culture doesn't exist.

git-svn-id: http://svn.code.sf.net/p/greenshot/code/trunk@1900 7dccd23d-a4a3-4e1f-8c07-b4c1b4018ab4
This commit is contained in:
RKrom 2012-05-23 12:56:00 +00:00
parent 2d88d8e588
commit 3e761d929e

View file

@ -161,11 +161,15 @@ namespace GreenshotPlugin.Core {
LOG.DebugFormat("Found invalid version {0} in file {1}", version, file);
}
}
}
}
if (type.Equals("Translations")) {
string culture = Regex.Replace(file, @"[a-zA-Z]+-(..-..)\.(xml|html)", "$1");
CultureInfo cultureInfo = new CultureInfo(culture);
rssFile.Language = cultureInfo.NativeName;
try {
CultureInfo cultureInfo = new CultureInfo(culture);
rssFile.Language = cultureInfo.NativeName;
} catch (Exception ex) {
LOG.WarnFormat("Can't read the native name of the culture {0}", culture);
}
}
filesForType.Add(file, rssFile);
}