Handling of paddle purchases and add-ons.

This commit is contained in:
Burak Kaan Köse
2026-03-19 01:50:14 +01:00
parent f306f6eb1c
commit b0ee5c9974
26 changed files with 779 additions and 513 deletions
@@ -30,4 +30,34 @@ public static class WinoAccountAuthErrorTranslator
_ => errorCode
};
}
public static string Format(string? errorCode, string? errorMessage)
{
var translatedCode = Translate(errorCode);
var hasCode = !string.IsNullOrWhiteSpace(errorCode);
var hasMessage = !string.IsNullOrWhiteSpace(errorMessage);
if (!hasCode && !hasMessage)
{
return Translator.GeneralTitle_Error;
}
var formattedCode = translatedCode;
if (hasCode && !string.Equals(translatedCode, errorCode, System.StringComparison.Ordinal))
{
formattedCode = $"{translatedCode} ({errorCode})";
}
if (!hasMessage || string.Equals(errorMessage, translatedCode, System.StringComparison.OrdinalIgnoreCase) || string.Equals(errorMessage, errorCode, System.StringComparison.OrdinalIgnoreCase))
{
return formattedCode;
}
if (string.IsNullOrWhiteSpace(formattedCode))
{
return errorMessage!;
}
return $"{formattedCode}{System.Environment.NewLine}{errorMessage}";
}
}