public ReloadCultureTests() { _data = new Dictionary <CultureInfo, List <LocalString> >() { { new CultureInfo("en"), new List <LocalString>() { new LocalString("TestTranslations.General:Test1", "Test1en") } }, { new CultureInfo("fr"), new List <LocalString>() { new LocalString("TestTranslations.General:Test1", "Test1fr") } } }; _localizationStorageStorageProvider = new InMemoryLocalizationStorageProvider("1", _data); _provider = new LocalizationProvider(typeof(TestTranslations).Assembly, _localizationStorageStorageProvider) { CurrentCultureFactory = () => new CultureInfo("en") }; }
public MultipleProviderTests() { var storageProvider = new InMemoryLocalizationStorageProvider("1", new Dictionary <CultureInfo, List <LocalString> >() { { new CultureInfo("fr"), new List <LocalString>() { new LocalString("TestTranslations.General:Test1", "Test1fr") } }, { new CultureInfo("en"), new List <LocalString>() { new LocalString("TestTranslations.General:Test1", "Test1en") } } }); var storageProvider2 = new InMemoryLocalizationStorageProvider("2", new Dictionary <CultureInfo, List <LocalString> >() { { new CultureInfo("fr"), new List <LocalString>() { new LocalString("TestTranslations.General:Test1", "Test1fr2") } } }); _provider = new LocalizationProvider(typeof(TestTranslations).GetTypeInfo().Assembly, storageProvider, storageProvider2) { CurrentCultureFactory = () => new CultureInfo("en") }; }
public GetTextHierarchyTests() { var storageProvider = new InMemoryLocalizationStorageProvider("1", new Dictionary <CultureInfo, List <LocalString> >() { { new CultureInfo("en"), new List <LocalString>() { new LocalString("TestTranslations.General:Test1", "Test1en") } }, { new CultureInfo("en-US"), new List <LocalString>() { new LocalString("TestTranslations.General:Test1", "Test1en-US") } } }); _provider = new LocalizationProvider(typeof(TestTranslations).Assembly, storageProvider); }
public GetAllTokensTests() { _data = new Dictionary <CultureInfo, List <LocalString> >() { { new CultureInfo("en"), new List <LocalString>() { new LocalString("TestTranslations.General:Test1", "Test1en") } }, { new CultureInfo("fr"), new List <LocalString>() { new LocalString("TestTranslations.General:Test1", "Test1fr") } } }; _localizationStorageProvider = new InMemoryLocalizationStorageProvider("1", _data); _provider = new LocalizationProvider(typeof(TestTranslations).GetTypeInfo().Assembly, _localizationStorageProvider).WithFilter(x => x == typeof(TestTranslations)); }
public DynamicTextOnlyTests() { var storageProvider = new InMemoryLocalizationStorageProvider("1", new Dictionary <CultureInfo, List <LocalString> >() { { new CultureInfo("fr"), new List <LocalString>() { new LocalString("Dynamic.1", "DynamicFr") } }, { new CultureInfo("en"), new List <LocalString>() { new LocalString("Dynamic.1", "DynamicEn") } } }); _provider = new LocalizationProvider(typeof(TestTranslations).GetTypeInfo().Assembly, storageProvider) { CurrentCultureFactory = () => new CultureInfo("en") }; }