Example #1
0
        public void LoadFromAssembly_Source1_LocalizerEnUs()
        {
            var set = new ResourceSet();

            set.LoadFromAssembly(typeof(ResourceSetTests).Assembly, "Resources/Source1");

            var localizer = set.MakeLocalizer().ForCulture("en-US").GetLocalizer();
            var value     = localizer.Localize("Key1");

            value.ShouldEqual("Value1 en-US");

            value = localizer.Localize("Key2");
            value.ShouldEqual("Value in english");
        }
Example #2
0
        public void LoadFromAssembly_Source1_LocalizerFrFr()
        {
            var set = new ResourceSet();

            set.LoadFromAssembly(typeof(ResourceSetTests).Assembly, "Resources/Source1");

            var localizer = set.MakeLocalizer().ForCulture("fr-FR").GetLocalizer();
            var value     = localizer.Localize("Key1");

            value.ShouldEqual("Value1 fr-FR");

            value = localizer.Localize("Key2");
            value.ShouldEqual("Valeur en français");
        }