I want to add the ban reason in German, French and English. How can I do that?
In my game, I use the following code to get the ban reason and I want to display the ban reason in the player's language.
var result = await PlayFabClientAPI.LoginWithIOSDeviceIDAsync(new LoginWithIOSDeviceIDRequest()
{
DeviceId = playerdeviceid,
CreateAccount = createaccount
});
var result = await PlayFabClientAPI.LoginWithAndroidDeviceIDAsync(new LoginWithAndroidDeviceIDRequest()
{
AndroidDeviceId = playerdeviceid,
CreateAccount = createaccount
});
// or:
var result = await PlayFabClientAPI.LoginWithEmailAddressAsync(new LoginWithEmailAddressRequest()
{
TitleId = titleid,
Email = keyboardtextloginemail,
Password = keyboardtextpassword
});
And then I get the ban reason like this but I don't know how to get the ban reason in the correct language:
string errorline = string.Empty;
if (result.Error.Error == PlayFabErrorCode.AccountBanned)
{
var kv = result.Error.ErrorDetails.First();
var BanReason = kv.Key;
var BanExpirationDateAndTimeUTC = kv.Value[0];
if ((language == "fr") || (language == "de"))
{
if (language == "de")
{
errorline = BanReason;
}
else
{
errorline = BanReason;
}
}
else
{
errorline = BanReason;
}
}
How can I display the ban reason in the player's language in my game?