mirror of
https://github.com/aljazceru/btcpayserver.git
synced 2025-12-18 14:34:23 +01:00
Feature: Plugin can extend whether an account can login or not
This commit is contained in:
31
BTCPayServer/NullLocalizers.cs
Normal file
31
BTCPayServer/NullLocalizers.cs
Normal file
@@ -0,0 +1,31 @@
|
||||
#nullable enable
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using Microsoft.AspNetCore.Mvc.Localization;
|
||||
using Microsoft.Extensions.Localization;
|
||||
|
||||
namespace BTCPayServer;
|
||||
|
||||
public class NullStringLocalizer : IStringLocalizer
|
||||
{
|
||||
public static readonly NullStringLocalizer Instance = new();
|
||||
public IEnumerable<LocalizedString> GetAllStrings(bool includeParentCultures) => Array.Empty<LocalizedString>();
|
||||
|
||||
public LocalizedString this[string name] => new(name, name);
|
||||
|
||||
public LocalizedString this[string name, params object[] arguments] => new(name, string.Format(name));
|
||||
}
|
||||
|
||||
public class NullViewLocalizer : IViewLocalizer
|
||||
{
|
||||
public static readonly NullViewLocalizer Instance = new();
|
||||
public LocalizedString GetString(string name) => new(name, name);
|
||||
|
||||
public LocalizedString GetString(string name, params object[] arguments) => new(name, string.Format(name));
|
||||
|
||||
public IEnumerable<LocalizedString> GetAllStrings(bool includeParentCultures) => Array.Empty<LocalizedString>();
|
||||
|
||||
public LocalizedHtmlString this[string name] => new(name, name);
|
||||
|
||||
public LocalizedHtmlString this[string name, params object[] arguments] => new(name, string.Format(name));
|
||||
}
|
||||
Reference in New Issue
Block a user