public DefaultContentTypeDisplayDriver(
     IContentDefinitionManager contentDefinitionManager,
     IStringLocalizer<DefaultContentDefinitionDisplayManager> localizer)
 {
     _contentDefinitionManager = contentDefinitionManager;
     T = localizer;
 }
Exemple #2
0
 public AdminController(
     IAuthorizationService authorizationService,
     ITypeFeatureProvider typeFeatureProvider,
     ISession session,
     IStringLocalizer<AdminController> stringLocalizer,
     IHtmlLocalizer<AdminController> htmlLocalizer,
     ISiteService siteService,
     IShapeFactory shapeFactory,
     RoleManager<Role> roleManager,
     IRoleProvider roleProvider,
     INotifier notifier,
     IEnumerable<IPermissionProvider> permissionProviders
     )
 {
     TH = htmlLocalizer;
     _notifier = notifier;
     _roleProvider = roleProvider;
     _typeFeatureProvider = typeFeatureProvider;
     _permissionProviders = permissionProviders;
     _roleManager = roleManager;
     _shapeFactory = shapeFactory;
     _siteService = siteService;
     T = stringLocalizer;
     _authorizationService = authorizationService;
     _session = session;
 }
Exemple #3
0
        public HomeController(IStringLocalizerFactory stringLocalizerFactory, IStringLocalizer<HomeController> T)
        {
            var stringLocalizer = stringLocalizerFactory.Create("Test", location: null);

            var resourceFiles = typeof(HomeController).Assembly.GetManifestResourceNames();
            foreach (var resFile in resourceFiles)
                Console.WriteLine(resFile.ToString());
            //bug 1. See the base name contruction is with capital in the ResourceManagerStringLocalizerFactory.cs
            Console.WriteLine("Watch the capital problem in the 2e localize");

            //Make sure this is working
            Console.WriteLine(T["test"], T["test"].ResourceNotFound.ToString());
            //bug 2
            Console.WriteLine(T.WithCulture(new CultureInfo("nl-NL"))["test"] + ":" + T["test"].ResourceNotFound.ToString() + "should be false!!!"); ;
            Console.WriteLine(T.WithCulture(new CultureInfo("nl-NL"))["Hello"]);
            Console.WriteLine(T.WithCulture(new CultureInfo("nl"))["Hello"]);
            Console.WriteLine(T.WithCulture(new CultureInfo(""))["Hello"]);

            var specific = T.WithCulture(new CultureInfo("nl-NL")).GetAllStrings(true);
            var neutral = T.WithCulture(new CultureInfo("nl")).GetAllStrings(true);
            var invariant = T.WithCulture(new CultureInfo("")).GetAllStrings(true);

            // bug 1 will crashes because of capital problem
            // bug 3 this should not crash at all but the wrong execption is catched MissingManifestResourceException
            // But swallowed  the null Exception in GetResourceNamesFromCultureHierarchy doesn't see a good idea
            foreach (string s in invariant)
                Console.WriteLine(s);
            Debugger.Launch();
            // will 4 will crash because of missing resource file
            foreach (string s in specific)
                Console.WriteLine(s);
            foreach (string s in neutral)
                Console.WriteLine(s);
        }
        public RecipeExecutionStep(ILoggerFactory loggerFactory,
            IStringLocalizer stringLocalizer)
        {
            _logger = loggerFactory.CreateLogger(GetType().Name);

            T = stringLocalizer;
        }
Exemple #5
0
        public AdminController(
            IContentDefinitionDisplayManager contentDefinitionDisplayManager,
            IContentDefinitionService contentDefinitionService,
            IContentDefinitionManager contentDefinitionManager,
            ShellSettings settings,
            IAuthorizationService authorizationService,
            ISession session,
            ILogger<AdminController> logger,
            IHtmlLocalizer<AdminMenu> htmlLocalizer,
            IStringLocalizer<AdminMenu> stringLocalizer,
            INotifier notifier
            )
        {
            _notifier = notifier;
            _contentDefinitionDisplayManager = contentDefinitionDisplayManager;
            _session = session;
            _authorizationService = authorizationService;
            _contentDefinitionService = contentDefinitionService;
            _contentDefinitionManager = contentDefinitionManager;
            _settings = settings;

            Logger = logger;
            T = htmlLocalizer;
            S = stringLocalizer;
        }
Exemple #6
0
 public SettingsStep(
     ISiteService siteService,
     ILoggerFactory logger,
     IStringLocalizer<ISiteService> localizer) : base(logger, localizer)
 {
     _siteService = siteService;
 }
Exemple #7
0
 public RecipesCommands(
     IRecipeHarvester recipeHarvester,
     IExtensionManager extensionManager,
     IStringLocalizer<RecipesCommands> localizer) : base(localizer)
 {
     _recipeHarvester = recipeHarvester;
     _extensionManager = extensionManager;
 }
 public HomeController(UserManager<User> userManager, IRepository<Product> productRepository, IMediaService mediaService, IRepository<WidgetInstance> widgetInstanceRepository, IStringLocalizer<HomeController> localizer)
 {
     _userManager = userManager;
     _productRepository = productRepository;
     _mediaService = mediaService;
     _widgetInstanceRepository = widgetInstanceRepository;
     _localizer = localizer;
 }
Exemple #9
0
        public PagerShapes(
            IHttpContextAccessor httpContextAccessor,
            IStringLocalizer<PagerShapes> localizer)
        {
            _httpContextAccessor = httpContextAccessor;

            T = localizer;
        }
Exemple #10
0
        public FeatureStep(
            IFeatureManager featureManager,
            ILoggerFactory logger,
            IStringLocalizer<FeatureStep> localizer) : base(logger, localizer)
        {

            _featureManager = featureManager;
        }
Exemple #11
0
 public ThemesStep(
     ISiteThemeService siteThemeService,
     IAdminThemeService adminThemeService,
     ILoggerFactory logger,
     IStringLocalizer<ThemesStep> localizer) : base(logger, localizer)
 {
     _adminThemeService = adminThemeService;
     _siteThemeService = siteThemeService;
 }
Exemple #12
0
        /// <summary>
        /// Creates a new <see cref="HtmlLocalizer"/>.
        /// </summary>
        /// <param name="localizer">The <see cref="IStringLocalizer"/> to read strings from.</param>
        public HtmlLocalizer(IStringLocalizer localizer)
        {
            if (localizer == null)
            {
                throw new ArgumentNullException(nameof(localizer));
            }

            _localizer = localizer;
        }
Exemple #13
0
 public AdminMenu(
     IStringLocalizer<AdminMenu> localizer,
     IContentDefinitionManager contentDefinitionManager,
     IContentManager contentManager)
 {
     _contentDefinitionManager = contentDefinitionManager;
     _contentManager = contentManager;
     T = localizer;
 }
        public DataAnnotationsModelValidator(ValidationAttribute attribute, IStringLocalizer stringLocalizer)
        {
            if (attribute == null)
            {
                throw new ArgumentNullException(nameof(attribute));
            }

            Attribute = attribute;
            _stringLocalizer = stringLocalizer;
        }
Exemple #15
0
        public SetupController(
            ISetupService setupService,
            ShellSettings shellSettings,
            IStringLocalizer<SetupController> t)
        {
            _setupService = setupService;
            _shellSettings = shellSettings;

            T = t;
        }
Exemple #16
0
        public RecipesStep(
            IRecipeHarvester recipeHarvester,
            IRecipeExecutor recipeManager,
            ILoggerFactory logger,
            IStringLocalizer<RecipesStep> localizer) : base(logger, localizer)
        {

            _recipeHarvester = recipeHarvester;
            _recipeManager = recipeManager;
        }
 public ScopesController(
     SiteManager siteManager,
     ScopesManager scopesManager,
     IStringLocalizer<CloudscribeIntegration> localizer
     )
 {
     this.siteManager = siteManager;
     this.scopesManager = scopesManager;
     sr = localizer;
 }
        public ClientsController(
            SiteManager siteManager,
            ClientsManager clientsManager,
            IStringLocalizer<CloudscribeIntegration> localizer
            )
        {
            this.siteManager = siteManager;
            this.clientsManager = clientsManager;
            sr = localizer;

        }
        public SystemInfoController(
            SystemInfoManager systemInfoManager,
            IOptions<UIOptions> uiOptionsAccessor,
            IStringLocalizer<CloudscribeCore> localizer
            )
        {
            systemInfo = systemInfoManager;
            uiOptions = uiOptionsAccessor.Value;
            sr = localizer;

        }
Exemple #20
0
 public NavigationManager(
     IEnumerable<INavigationProvider> providers, 
     IStringLocalizer<NavigationManager> sr, 
     IHttpContextAccessor httpContextAccessor,
     IAuthorizationService authorizationService)
 {
     _providers = providers;
     _sr = sr;
     _httpContextAccessor = httpContextAccessor;
     _authorizationService = authorizationService;
 }
 public CoreDataController(
     SiteContext currentSite,
     GeoDataManager geoDataManager,
     IStringLocalizer<CloudscribeCore> localizer,
     IOptions<UIOptions> uiOptionsAccessor
     )
 {
     Site = currentSite; 
     dataManager = geoDataManager;
     uiOptions = uiOptionsAccessor.Value;
     sr = localizer;
 }
        public UserAdminController(
            SiteManager siteManager,
            SiteUserManager<SiteUser> userManager,
            IOptions<UIOptions> uiOptionsAccessor,
            IStringLocalizer<UserAdminController> localizer
            )
        {
           
            UserManager = userManager;
            this.siteManager = siteManager;
            uiOptions = uiOptionsAccessor.Value;

        }
        //TODO: we should have an option to force only plain text email
        // html emails are a lot more likely to be phished with copies
        // because the link urls are obfuscated to some degree

        public SiteEmailMessageSender(
            ViewRenderer viewRenderer,
            IOptions<SmtpOptions> smtpOptionsAccessor,
            IStringLocalizer<CloudscribeCore> localizer,
            ILogger<SiteEmailMessageSender> logger
            )
        {
            log = logger;
            sr = localizer;
            this.viewRenderer = viewRenderer;
            globalSmtpSettings = smtpOptionsAccessor.Value;

        }
        public LocalizationServiceFactory(
            IExplicitResourceKeyParser explicitResourceKeyParser,
            IStringLocalizer stringLocalizer
            )
        {
            if (explicitResourceKeyParser == null)
                throw new ArgumentNullException("explicitResourceKeyParser");
            if (stringLocalizer == null)
                throw new ArgumentNullException("stringLocalizer");

            this.explicitResourceKeyParser = explicitResourceKeyParser;
            this.stringLocalizer = stringLocalizer;
        }
Exemple #25
0
 public UserController(
     ApplicationDbContext context,
     UserManager<ApplicationUser> userManager,
     IEmailSender emailSender,
     IEmailTemplate emailTemplate,
     IStringLocalizer<AccountController> localizer)
 {
     DbContext = context;
     _userManager = userManager;
     _emailSender = emailSender;
     _emailTemplate = emailTemplate;
     T = localizer;
 }
Exemple #26
0
        public RecipeHarvester(IExtensionManager extensionManager,
            IOrchardFileSystem fileSystem,
            IEnumerable<IRecipeParser> recipeParsers,
            IOptions<RecipeHarvestingOptions> recipeOptions,
            IStringLocalizer<RecipeHarvester> localizer,
            ILogger<RecipeHarvester> logger) {
            _extensionManager = extensionManager;
            _fileSystem = fileSystem;
            _recipeParsers = recipeParsers;
            _recipeOptions = recipeOptions;

            T = localizer;
            Logger = logger;
        }
        public RecipeStepExecutor(
            IEnumerable<IRecipeHandler> recipeHandlers,
            IEventBus eventBus,
            ISession session,
            ILogger<RecipeStepExecutor> logger,
            IStringLocalizer<RecipeStepExecutor> localizer)
        {
            _recipeHandlers = recipeHandlers;
            _eventBus = eventBus;
            _session = session;
            _logger = logger;

            T = localizer;
        }
Exemple #28
0
        /// <summary>
        /// Creates a new <see cref="HtmlLocalizer"/>.
        /// </summary>
        /// <param name="localizer">The <see cref="IStringLocalizer"/> to read strings from.</param>
        /// <param name="encoder">The <see cref="IHtmlEncoder"/>.</param>
        public HtmlLocalizer(IStringLocalizer localizer, IHtmlEncoder encoder)
        {
            if (localizer == null)
            {
                throw new ArgumentNullException(nameof(localizer));
            }

            if (encoder == null)
            {
                throw new ArgumentNullException(nameof(encoder));
            }

            _localizer = localizer;
            _encoder = encoder;
        }
 public RoleAdminController(
     SiteManager siteManager,
     SiteUserManager<SiteUser> userManager,
     SiteRoleManager<SiteRole> roleManager,
     IStringLocalizer<CloudscribeCore> localizer,
     IOptions<UIOptions> uiOptionsAccessor,
     IOptions<SiteConfigOptions> setupOptionsAccessor
     )
 {
     UserManager = userManager;
     RoleManager = roleManager;
     this.siteManager = siteManager;
     uiOptions = uiOptionsAccessor.Value;
     setupOptions = setupOptionsAccessor.Value;
     sr = localizer;
 }
Exemple #30
0
 public UsuarioController(UsuarioContext context, IOptionsSnapshot <UsuarioSettings> settings, IUsuarioIntegrationEventService usuarioIntegrationEventService, IStringLocalizer <UsuarioController> localizer)
 {
     _usuarioContext = context ?? throw new ArgumentNullException(nameof(context));
     _usuarioIntegrationEventService = usuarioIntegrationEventService ?? throw new ArgumentNullException(nameof(usuarioIntegrationEventService));
     _settings  = settings.Value;
     _localizer = localizer;
 }
Exemple #31
0
        IAttributeAdapter IValidationAttributeAdapterProvider.GetAttributeAdapter(ValidationAttribute attribute, IStringLocalizer stringLocalizer)
        {
            if (attribute == null)
            {
                throw new ArgumentNullException(nameof(attribute));
            }

            var type = attribute.GetType();

            if (type == typeof(ExRequiredAttribute))
            {
                return(new RequiredAttributeAdapter((RequiredAttribute)attribute, stringLocalizer));
            }

#if NETCOREAPP2_0 || NETCOREAPP2_1 || NETCOREAPP2_2
            if (type == typeof(ExMaxLengthAttribute))
            {
                return(new MaxLengthAttributeAdapter((MaxLengthAttribute)attribute, stringLocalizer));
            }

            if (type == typeof(ExMinLengthAttribute))
            {
                return(new MinLengthAttributeAdapter((MinLengthAttribute)attribute, stringLocalizer));
            }

            if (type == typeof(ExCompareAttribute))
            {
                return(new CompareAttributeAdapter((CompareAttribute)attribute, stringLocalizer));
            }

            if (type == typeof(ExRangeAttribute))
            {
                return(new RangeAttributeAdapter((RangeAttribute)attribute, stringLocalizer));
            }

            if (type == typeof(ExRegularExpressionAttribute))
            {
                return(new RegularExpressionAttributeAdapter((RegularExpressionAttribute)attribute, stringLocalizer));
            }

            if (type == typeof(ExStringLengthAttribute))
            {
                return(new StringLengthAttributeAdapter((StringLengthAttribute)attribute, stringLocalizer));
            }
#elif NETCOREAPP3_0 || NETCOREAPP3_1
            if (type == typeof(ExMaxLengthAttribute))
            {
                return(new ExMaxLengthAttributeAdapter((ExMaxLengthAttribute)attribute, stringLocalizer));
            }

            if (type == typeof(ExMinLengthAttribute))
            {
                return(new ExMinLengthAttributeAdapter((ExMinLengthAttribute)attribute, stringLocalizer));
            }

            if (type == typeof(ExCompareAttribute))
            {
                return(new ExCompareAttributeAdapter <T>((ExCompareAttribute)attribute, stringLocalizer));
            }

            if (type == typeof(ExRangeAttribute))
            {
                return(new ExRangeAttributeAdapter <T>((ExRangeAttribute)attribute, stringLocalizer));
            }

            if (type == typeof(ExRegularExpressionAttribute))
            {
                return(new ExRegularExpressionAttributeAdapter <T>((ExRegularExpressionAttribute)attribute, stringLocalizer));
            }

            if (type == typeof(ExStringLengthAttribute))
            {
                return(new ExStringLengthAttributeAdapter((ExStringLengthAttribute)attribute, stringLocalizer));
            }
#endif

            return(base.GetAttributeAdapter(attribute, stringLocalizer));
        }
 public WhileLoopTask(IWorkflowScriptEvaluator scriptEvaluator, IStringLocalizer <WhileLoopTask> localizer)
 {
     _scriptEvaluator = scriptEvaluator;
     S = localizer;
 }
 public PhysiciansController(INetworkClient client, ICacheService cacheService, IStringLocalizer <PhysiciansController> localizer, IXlsService xlsService)
 {
     _client       = client;
     _localizer    = localizer;
     _cacheService = cacheService;
     _xlsService   = xlsService;
 }
 public RoleManagementController(IDbContextFetcher dbContextFetcher, IStringLocalizer localizer)
 {
     this._context   = dbContextFetcher.FetchDbContext <Data.MoxIdentityDbContext>();
     this._localizer = localizer;
 }
 public ContactController(IStringLocalizer <SharedResource> localizer)
 {
     _localizer = localizer;
 }
 public PeopleAttributeAdapter(
     PeopleAttribute attribute,
     IStringLocalizer stringLocalizer) : base(
         attribute,
         stringLocalizer) => _year = attribute.Year;
 public StringLengthAttributeAdapter(StringLengthAttribute attribute, IStringLocalizer stringLocalizer)
     : base(attribute, stringLocalizer)
 {
 }
 public DataAnnotationLocalizer(Type type, Type sharedResourceType, IStringLocalizerFactory factory)
 {
     _resourceManagerStringLocalizer = factory.Create(type);
     _sharedLocalizer = factory.Create(sharedResourceType);
 }
 public ApiSecretValidator(ProtectResource api, IStringLocalizer localizer)
 {
     RuleFor(m => m.Type).NotEmpty().WithMessage(localizer["The secret type is required."]);
     RuleFor(m => m.Value).NotEmpty().WithMessage(localizer["The secret value is required."]);
 }
 public CommonPartSettingsDisplayDriver(IStringLocalizer <CommonPartSettingsDisplayDriver> localizer)
 {
     TS = localizer;
 }
 public PasswordsDoesntMatchBadRequestException(IStringLocalizer <object> localizer) : base()
 {
     CustomCode    = 400003;
     CustomMessage = localizer.GetString(CustomCode.ToString());
 }
 public MoedaAttributeAdapter(MoedaAttribute attribute, IStringLocalizer stringLocalizer) : base(attribute, stringLocalizer)
 {
 }
Exemple #43
0
 public EmployeeAttendanceController(IEmployeeAttendanceService employeeAttendanceService, ICommonService iCommonService, IDropDownService idropDownService, IStringLocalizer <RocketPOSResources> sharedLocalizer, LocService locService)
 {
     _iemployeeAttendanceService = employeeAttendanceService;
     _iDropDownService           = idropDownService;
     _iCommonService             = iCommonService;
     _sharedLocalizer            = sharedLocalizer;
     _locService = locService;
 }
 public OrderController(ICart cart, IOrderService service, IStringLocalizer <OrderController> localizer)
 {
     _cart         = cart;
     _orderService = service;
     _localizer    = localizer;
 }
 /// <summary>Constructor.</summary>
 /// <param name="localizer">    The localizer. </param>
 public MultiLanguageIdentityErrorDescriber(IStringLocalizer <IdentityResource> localizer)
 {
     _typeName  = typeof(IdentityResource).FullName;
     _localizer = localizer;
 }
Exemple #46
0
 public AdminMenu(IStringLocalizer<AdminMenu> localizer)
 {
     S = localizer;
 }
Exemple #47
0
 public RecipesCommands(
     IEnumerable <IRecipeHarvester> recipeHarvesters,
     IStringLocalizer <RecipesCommands> localizer) : base(localizer)
 {
     _recipeHarvesters = recipeHarvesters;
 }
Exemple #48
0
 public static CafeViewModel GetViewModel(Cafe cafe, CountryRepository countryRepository, IStringLocalizer <SharedResources> localizer, IPageAttachmentUrlRetriever attachmentUrlRetriever)
 {
     return(new CafeViewModel
     {
         PhotoPath = cafe.Fields.Photo == null ? null : attachmentUrlRetriever.Retrieve(cafe.Fields.Photo).RelativePath,
         Note = cafe.Fields.AdditionalNotes,
         Contact = ContactViewModel.GetViewModel(cafe, countryRepository, localizer)
     });
 }
        /// <summary>
        /// Initializes a new instance of the <see cref="UsersController"/> class.
        /// </summary>
        /// <param name="appSettings">The application configuration.</param>
        /// <param name="logger">The logger to use.</param>
        /// <param name="localizer">The localized ressources to use.</param>
        /// <param name="userService">The <see cref="IUserService"/>.</param>
        /// <param name="userPasswordResetTokenService">the <see cref="IUserPasswordResetTokenService"/>.</param>
        /// <param name="emailService">The <see cref="IEmailService"/>.</param>
        public UsersController(
            IOptions <AppSettings> appSettings,
            ILogger <UsersController> logger,
            IStringLocalizer <UsersController> localizer,
            IUserService userService,
            IUserPasswordResetTokenService userPasswordResetTokenService,
            IEmailService emailService)
        {
            if (appSettings == null)
            {
                throw new ArgumentNullException(nameof(appSettings));
            }
            else
            {
                this.appSettings = appSettings?.Value;
            }

            if (logger == null)
            {
                throw new ArgumentNullException(nameof(logger));
            }
            else
            {
                this.logger = logger;
            }

            if (localizer == null)
            {
                throw new ArgumentNullException(nameof(localizer));
            }
            else
            {
                this.localizer = localizer;
            }

            if (userService == null)
            {
                throw new ArgumentNullException(nameof(userService));
            }
            else
            {
                this.userService = userService;
            }

            if (userPasswordResetTokenService == null)
            {
                throw new ArgumentNullException(nameof(userPasswordResetTokenService));
            }
            else
            {
                this.userPasswordResetTokenService = userPasswordResetTokenService;
            }

            if (emailService == null)
            {
                throw new ArgumentNullException(nameof(emailService));
            }
            else
            {
                this.emailService = emailService;
            }
        }
        public AccountControllerTests(IStringLocalizer <AccountController> localizer, IStringLocalizer <BaseController> baseLocalizer,
                                      ILogger <AccountController> logger)
        {
            var mockTenantRepo = new Mock <ITenantRepository>();
            var mockConfig     = new Mock <IConfiguration>();
            var mockDnsClient  = new Mock <ILookupClient>();

            mockTenantRepo.Setup(repo => repo.GetGuest("*****@*****.**", 123456)).Returns(GetCustomerAsync());
            mockTenantRepo.Setup(repo => repo.AddGuestAsync(GetCustomer(), 123456)).Returns(GetCustomerId());

            var mockCatalogRepo = new Mock <ICatalogRepository>();

            var mockUtilities = new Mock <IUtilities>();

            _accountController = new AccountController(localizer, baseLocalizer, mockTenantRepo.Object, mockCatalogRepo.Object, logger, mockConfig.Object, mockDnsClient.Object);
        }
Exemple #51
0
 public RateLimitingActionFilter(IStringLocalizer <RateLimitingActionFilter> localizer, ILogger <RateLimitingActionFilter> logger)
 {
     _localizer = localizer;
     _logger    = logger;
 }
Exemple #52
0
 public AssetItemController(IAssetItemService assetItemService, ICommonService iCommonService, IDropDownService idropDownService, IStringLocalizer <RocketPOSResources> sharedLocalizer, LocService locService)
 {
     _iAssetItemService = assetItemService; _iCommonService = iCommonService;
     _iDropDownService  = idropDownService;
     _sharedLocalizer   = sharedLocalizer;
     _locService        = locService;
 }
 public CategoryMenuViewComponent(ICategoryRepository repo, IStringLocalizer <CategoryMenuViewComponent> localizer)
 {
     _repository    = repo;
     this.localizer = localizer;
 }
Exemple #54
0
 public TestController(IStringLocalizer stringLocalizer)
 {
     this.Localizer = stringLocalizer;
 }
Exemple #55
0
 public EnforceTrueIfAttributeAdapter(EnforceTrueIfAttribute attribute, IStringLocalizer stringLocalizer) : base(attribute, stringLocalizer)
 {
     DesiredValue = attribute.DesiredValue;
     PropertyName = attribute.PropertyName;
 }
Exemple #56
0
 public MatrixFieldPredefinedListEditorSettingsDriver(IStringLocalizer <MatrixFieldPredefinedListEditorSettingsDriver> localizer)
 {
     S = localizer;
 }
 public CustomErrorDescriber(IStringLocalizer <SharedResource> localizer)
 {
     _localizer = localizer;
 }
Exemple #58
0
 public AbpButtonTagHelperService(IStringLocalizer <AbpUiResource> localizer)
 {
     L = localizer;
 }
Exemple #59
0
 public FacebookPluginPartSettingsDisplayDriver(ILiquidTemplateManager templateManager, IStringLocalizer <FacebookPluginPartSettingsDisplayDriver> localizer)
 {
     _templateManager = templateManager;
     S = localizer;
 }
        public void Configure(
            IApplicationBuilder app,
            ILoggerFactory loggerFactory,
            IStringLocalizerFactory stringLocalizerFactory,
            IStringLocalizer<StartupResourcesInFolder> startupStringLocalizer,
            IStringLocalizer<Customer> custromerStringLocalizer)
        {
            loggerFactory.AddConsole(minLevel: LogLevel.Warning);

            var options = new RequestLocalizationOptions
            {
                SupportedCultures = new List<CultureInfo>()
                {
                    new CultureInfo("fr-FR")
                },
                SupportedUICultures = new List<CultureInfo>()
                {
                    new CultureInfo("fr-FR")
                }
            };

            app.UseRequestLocalization(options, defaultRequestCulture: new RequestCulture("en-US"));

            var stringLocalizer = stringLocalizerFactory.Create("Test", location: null);

            app.Run(async (context) =>
            {
                await context.Response.WriteAsync(startupStringLocalizer["Hello"]);
                await context.Response.WriteAsync(" ");
                await context.Response.WriteAsync(stringLocalizer["Hello"]);
                await context.Response.WriteAsync(" ");
                await context.Response.WriteAsync(custromerStringLocalizer["Hello"]);
            });
        }