public LocalizationService( IRequestCultureManager requestCultureManager, IAutoLocalizationManager autoLocalizationManager ) : base(requestCultureManager) { m_localizationManager = autoLocalizationManager; }
public AttributeStringLocalizerFactory( IRequestCultureManager requestCultureManager, IAutoDictionaryManager autoDictionaryManager, IAutoLocalizationManager autoLocalizationManager ) { m_dictionaryManager = autoDictionaryManager; m_autoLocalizationManager = autoLocalizationManager; m_requestCultureManager = requestCultureManager; }
public AttributeStringLocalizer( IRequestCultureManager requestCultureManager, IAutoDictionaryManager dictionaryManager, IAutoLocalizationManager autoLocalizationManager, string baseName, LocTranslationSource location ) : this(requestCultureManager, dictionaryManager, autoLocalizationManager, baseName, location, null) { //Should be empty }
public RequestCultureManager( IHttpContextAccessor httpContextAccessor, IAutoLocalizationManager autoLocalizationManager, LocalizationConfiguration configuration ) { m_httpContextAccessor = httpContextAccessor; m_autoLocalizationManager = autoLocalizationManager; m_configuration = configuration; }
private AttributeStringLocalizer( IRequestCultureManager requestCultureManager, IAutoDictionaryManager dictionaryManager, IAutoLocalizationManager autoLocalizationManager, string baseName, LocTranslationSource location, CultureInfo cultureInfo ) { m_requestCultureManager = requestCultureManager; m_dictionaryManager = dictionaryManager; m_baseName = baseName; m_location = location; m_autoLocalizationManager = autoLocalizationManager; m_currentCultureInfo = cultureInfo; }
public void LibInit() { var configuration = new LocalizationConfiguration { BasePath = "Localization", DefaultCulture = new CultureInfo("cs"), SupportedCultures = new List <CultureInfo>() { new CultureInfo("en"), new CultureInfo("cs"), }, TranslateFallbackMode = LocTranslateFallbackMode.EmptyString, AutoLoadResources = true, FirstAutoTranslateResource = LocLocalizationResource.File }; m_localizationManager = new LocalizationLib(configuration).LocalizationManager; }
/// <summary> /// Initializes Localization library. /// </summary> /// <param name="configuration">Library configuration</param> /// <param name="databaseConfiguration">Configure database storage, e.g. NHibernateDatabaseConfiguration</param> /// <param name="loggerFactory">Logger factory for enabling logging</param> public LocalizationLib( LocalizationConfiguration configuration, IDatabaseConfiguration databaseConfiguration = null, ILoggerFactory loggerFactory = null ) { var services = new ServiceCollection(); services.AddLocalizationCore(configuration, databaseConfiguration); // Logger services.AddSingleton(loggerFactory ?? NullLoggerFactory.Instance); services.AddSingleton(typeof(ILogger <>), typeof(Logger <>)); // Init from IoC var container = services.BuildServiceProvider(); m_localizationManager = container.GetRequiredService <IAutoLocalizationManager>(); m_dictionaryManager = container.GetRequiredService <IAutoDictionaryManager>(); }
public MainServiceClientLocalization(ILocalizationService localization, IAutoLocalizationManager localizationService) { m_localization = localization; m_localizationManager = localizationService; }