private static IStringLocalizerManager WithCulture(IStringLocalizerManager manager, StringLocalizerConfigurationSection section)
        {
            if (section != null && !string.IsNullOrEmpty(section.Culture))
            {
                try
                {
                    manager.CultureInfo = CultureInfo.GetCultureInfo(section.Culture);
                }
                catch (CultureNotFoundException)
                {
                }
            }

            return(manager);
        }
Esempio n. 2
0
        public HomeController(IServiceProvider sp, ITaskScheduler sc, ISerializer ser, IModel model, IService context, ICacheManager cacheMgr, ILogger <HomeController> logger, IStringLocalizerManager localizer)
        {
            var tt  = ser.Serialize("dfafdsaf");
            var str = localizer.GetLocalizer("Test")["Name"];

            this.logger  = logger;
            this.service = context;
        }