Hotfix translation fixes:

- Correction when there is no language.
 - CosmeticSet translation.
This commit is contained in:
MaikyM
2020-01-16 00:26:46 -06:00
parent 550542ab2c
commit ce9911e7fc
2 changed files with 14 additions and 26 deletions

View File

@@ -84,18 +84,20 @@ namespace FModel.Methods.Assets
isHotfixDefault = true;
}
string hotfixString = HotfixLocResDict[tNamespace][tKey][ifNotFoundTemp].ContainsKey(GetLanguageCode())
? HotfixLocResDict[tNamespace][tKey][ifNotFoundTemp][GetLanguageCode()]
: ifNotFound;
if (HotfixLocResDict[tNamespace][tKey][ifNotFoundTemp].ContainsKey(GetLanguageCode()))
{
string hotfixString = HotfixLocResDict[tNamespace][tKey][ifNotFoundTemp][GetLanguageCode()];
// ONLY if there is english in the hotfix.
// If the translation is empty, it will be the default text.
if (isHotfixDefault && !string.IsNullOrEmpty(ifNotFound) && string.IsNullOrEmpty(hotfixString))
hotfixString = ifNotFound;
// ONLY if there is english in the hotfix.
// If the translation is empty, it will be the default text.
if (isHotfixDefault && !string.IsNullOrEmpty(ifNotFound) && string.IsNullOrEmpty(hotfixString))
hotfixString = ifNotFound;
return hotfixString;
return hotfixString;
}
}
else if (FProp.Default.FLanguage == "English")
if (FProp.Default.FLanguage == "English")
{
return ifNotFound;
}

View File

@@ -43,23 +43,9 @@ namespace FModel.Methods.Assets.IconCreator.AthenaID
JToken set_source_string = AssetsUtility.GetPropertyTagText<JToken>(setArray, "DisplayName", "source_string");
if (set_namespace != null && set_key != null && set_source_string != null)
{
if (string.Equals(FProp.Default.FLanguage, "English"))
{
if (AssetTranslations.HotfixLocResDict != null &&
AssetTranslations.HotfixLocResDict.ContainsKey(set_namespace.Value<string>()) &&
AssetTranslations.HotfixLocResDict[set_namespace.Value<string>()].ContainsKey(set_key.Value<string>()) &&
AssetTranslations.HotfixLocResDict[set_namespace.Value<string>()][set_key.Value<string>()].ContainsKey("en"))
{
return string.Format("\nPart of the {0} set.", AssetTranslations.HotfixLocResDict[set_namespace.Value<string>()][set_key.Value<string>()]["en"]);
}
return string.Format("\nPart of the {0} set.", set_source_string.Value<string>());
}
else
{
string cosmeticSet = AssetTranslations.SearchTranslation(set_namespace.Value<string>(), set_key.Value<string>(), set_source_string.Value<string>());
string cosmeticPart = AssetTranslations.SearchTranslation("Fort.Cosmetics", "CosmeticItemDescription_SetMembership_NotRich", "\nPart of the {0} set.");
return string.Format(cosmeticPart, cosmeticSet);
}
string cosmeticSet = AssetTranslations.SearchTranslation(set_namespace.Value<string>(), set_key.Value<string>(), set_source_string.Value<string>());
string cosmeticPart = AssetTranslations.SearchTranslation("Fort.Cosmetics", "CosmeticItemDescription_SetMembership_NotRich", "\nPart of the {0} set.");
return string.Format(cosmeticPart, cosmeticSet);
}
}
return string.Empty;