Ejemplo n.º 1
0
 private static void UpdateCurrentThreadCulture(int value)
 {
     Thread.CurrentThread.CurrentUICulture =
         new CultureInfo(LocalizationConverter.Convert(value));
     Thread.CurrentThread.CurrentCulture =
         new CultureInfo(LocalizationConverter.Convert(value));
 }
        public void Data_with_prefix_should_be_empty()
        {
            DISetup.SetupContainer();
            var locManager = new Mock <ILocalizationManager>();

            locManager.Setup(s => s.GetResource(It.Is <string>(s => s == "prefix.test"))).Returns("test localization");
            DISetup.Container.RegisterInstance(locManager.Object);
            var converter = new LocalizationConverter();
            var result    = converter.Convert("test 2", null, "prefix", null);

            result.Should().BeNull();
        }
Ejemplo n.º 3
0
 public static CultureInfo GetCurrentCulture()
 {
     return(new CultureInfo(LocalizationConverter.Convert(culture)));
 }
Ejemplo n.º 4
0
 public string GetText(int lang)
 {
     return(SystemNewsLocalized.First(l => l.Language ==
                                      LocalizationConverter.Convert(lang)).NewsContentText);
 }
Ejemplo n.º 5
0
 public string GetTopic(int lang)
 {
     return(SystemNewsLocalized.First(l => l.Language ==
                                      LocalizationConverter.Convert(lang)).Header);
 }