mirror of
https://github.com/4sval/FModel.git
synced 2026-04-16 22:46:09 -05:00
Added hotfix verification in case it isn't available in all languages.
This commit is contained in:
parent
2d50ee41e7
commit
525b25ee6f
|
|
@ -12,19 +12,13 @@ namespace FModel
|
|||
{
|
||||
if (HotfixedStrings.HotfixedStringsDict != null && HotfixedStrings.HotfixedStringsDict.ContainsKey(theKey))
|
||||
{
|
||||
return HotfixedStrings.HotfixedStringsDict[theKey][GetLanguageCode()];
|
||||
if (HotfixedStrings.HotfixedStringsDict[theKey].ContainsKey(GetLanguageCode()))
|
||||
return HotfixedStrings.HotfixedStringsDict[theKey][GetLanguageCode()];
|
||||
else
|
||||
return string.IsNullOrEmpty(theNamespace) ? LocResSerializer.LocResDict[theKey] : LocResSerializer.LocResDict[theNamespace][theKey];
|
||||
}
|
||||
else
|
||||
{
|
||||
if (string.IsNullOrEmpty(theNamespace))
|
||||
{
|
||||
return LocResSerializer.LocResDict[theKey];
|
||||
}
|
||||
else
|
||||
{
|
||||
return LocResSerializer.LocResDict[theNamespace][theKey];
|
||||
}
|
||||
}
|
||||
return string.IsNullOrEmpty(theNamespace) ? LocResSerializer.LocResDict[theKey] : LocResSerializer.LocResDict[theNamespace][theKey];
|
||||
}
|
||||
catch (KeyNotFoundException)
|
||||
{
|
||||
|
|
@ -38,12 +32,12 @@ namespace FModel
|
|||
{
|
||||
if (HotfixedStrings.HotfixedStringsDict != null && HotfixedStrings.HotfixedStringsDict.ContainsKey(key))
|
||||
{
|
||||
return HotfixedStrings.HotfixedStringsDict[key][GetLanguageCode()];
|
||||
return HotfixedStrings.HotfixedStringsDict[key].ContainsKey(GetLanguageCode())
|
||||
? HotfixedStrings.HotfixedStringsDict[key][GetLanguageCode()]
|
||||
: defaultText;
|
||||
}
|
||||
else
|
||||
{
|
||||
return defaultText;
|
||||
}
|
||||
}
|
||||
|
||||
string text = defaultText;
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user