public LocalizationProviderFactory(ILocalizationStorage storage, ILocalizationMissingHandler missingHandler, ILocalizationCache cache)
        {
            _storage = storage;
            _missingHandler = missingHandler;
            _cache = cache;

            _providers = new Cache<CultureInfo, ILocalizationDataProvider>(culture => BuildProvider(culture));
        }
        public LocalizationProviderFactory(ILocalizationStorage storage, ILocalizationMissingHandler missingHandler, ILocalizationCache cache)
        {
            _storage        = storage;
            _missingHandler = missingHandler;
            _cache          = cache;

            _providers = new Cache <CultureInfo, ILocalizationDataProvider>(culture => BuildProvider(culture));
        }
Ejemplo n.º 3
0
        public AssemblyScanner(ILocalizationStorage storage, CultureInfo culture)
        {
            DefaultCulture = new CultureInfo("en-US");

            _storage = storage;
            _culture = culture;

            _provider = new Lazy <ILocalizationDataProvider>(() =>
            {
                var missingHandler = new LocalizationMissingHandler(_storage, DefaultCulture);
                var factory        = new LocalizationProviderFactory(_storage, missingHandler,
                                                                     new LocalizationCache());

                return(factory.BuildProvider(_culture));
            });
        }
Ejemplo n.º 4
0
        public AssemblyScanner(ILocalizationStorage storage, CultureInfo culture)
        {
            DefaultCulture = new CultureInfo("en-US");

            _storage = storage;
            _culture = culture;

            _provider = new Lazy<ILocalizationDataProvider>(() =>
            {
                var missingHandler = new LocalizationMissingHandler(_storage, DefaultCulture);
                var factory = new LocalizationProviderFactory(_storage, missingHandler,
                                                new LocalizationCache());

                return factory.BuildProvider(_culture);
            });
        }
 public BootstrapLocalizationMissingHandler(ILocalizationStorage storage, CultureInfo defaultCulture, ILogger logger)
 {
     _storage = storage;
     _defaultCulture = defaultCulture;
     _logger = logger;
 }
Ejemplo n.º 6
0
 public LinguisticsEngine(ILocalizationStorage storage)
 {
     Storage = storage;
 }
Ejemplo n.º 7
0
 public LocaleCacheFactory(CultureInfo defaultCulture, ILocalizationStorage storage, ILocalizationCache cache)
 {
     _defaultCulture = defaultCulture;
     _storage = storage;
     _cache = cache;
 }
 public LocalizationMissingHandler(ILocalizationStorage storage, CultureInfo defaultCulture)
 {
     _storage        = storage;
     _defaultCulture = defaultCulture;
 }
 public LocalizationMissingHandler(ILocalizationStorage storage, CultureInfo defaultCulture)
 {
     _storage = storage;
     _defaultCulture = defaultCulture;
 }
Ejemplo n.º 10
0
 public IPalBot LanguagesFrom(ILocalizationStorage storage)
 {
     Languages        = new LinguisticsEngine(storage);
     storage.OnError += (e, n) => broadcast.BroadcastException(e, n);
     return(this);
 }
Ejemplo n.º 11
0
 public LocaleCacheFactory(CultureInfo defaultCulture, ILocalizationStorage storage, ILocalizationCache cache)
 {
     _defaultCulture = defaultCulture;
     _storage        = storage;
     _cache          = cache;
 }
Ejemplo n.º 12
0
 public BootstrapLocalizationMissingHandler(ILocalizationStorage storage, CultureInfo defaultCulture, ILogger logger)
 {
     _storage        = storage;
     _defaultCulture = defaultCulture;
     _logger         = logger;
 }