Skip to content

Open-source eCommerce platform for C# and ASP.NET Core 10 with MongoDB. Build multi-store shops and multi-vendor marketplaces with B2B/B2C, REST API, plugins, Vue 3 and Docker.

623 B
Raw Blame
using Grand.Business.Core.Interfaces.Common.Localization;
using Grand.Domain.Common;

namespace Grand.Web.Common.Security.Captcha;

public static class CaptchaSettingsExtension
{
    public static string GetWrongCaptchaMessage(this CaptchaSettings captchaSettings,
        ITranslationService translationService)
    {
        return captchaSettings.ReCaptchaVersion switch {
            GoogleReCaptchaVersion.V2 => translationService.GetResource("Common.WrongCaptchaV2"),
            GoogleReCaptchaVersion.V3 => translationService.GetResource("Common.WrongCaptchaV3"),
            _ => string.Empty
        };
    }
}