Fixed problem when invalid language was specified in the ini file.

git-svn-id: http://svn.code.sf.net/p/greenshot/code/trunk@2066 7dccd23d-a4a3-4e1f-8c07-b4c1b4018ab4
This commit is contained in:
RKrom 2012-09-19 13:51:19 +00:00
parent 7e3b7de25e
commit 752fe42aae

View file

@ -100,10 +100,24 @@ namespace GreenshotPlugin.Core {
ScanFiles();
if (!string.IsNullOrEmpty(coreConfig.Language)) {
CurrentLanguage = coreConfig.Language;
} else {
CurrentLanguage = DEFAULT_LANGUAGE;
if (CurrentLanguage != null && CurrentLanguage != coreConfig.Language) {
coreConfig.Language = CurrentLanguage;
IniConfig.Save();
}
}
if (CurrentLanguage == null) {
LOG.Warn("Couldn't set language from configuration, changing to default. Installation problem?");
CurrentLanguage = DEFAULT_LANGUAGE;
if (CurrentLanguage != null) {
coreConfig.Language = CurrentLanguage;
IniConfig.Save();
}
}
if (CurrentLanguage == null) {
LOG.Error("Couldn't set language, installation problem?");
}
LOG.Error("Couldn't set language, installation problem?");
}
/// <summary>