Esempio n. 1
0
 protected void Initialize()
 {
     Controller = MockHelper.FakeController();
     Controller.SetFakeControllerContext(new NameValueCollection
                                             {
                                                 {"Accept-Language", "en"}
                                             });
     Session = new I18NSession();
     LocalizingService = new LocalizingService();
 }
Esempio n. 2
0
        public void LoadFromDisk()
        {
            var context = A.Fake <HttpContextBase>();

            A.Fake <HttpSessionStateBase>(x => x.Wrapping(context.Session).Implements(typeof(HttpSessionStateWrapper)));

            LocalizingService.LoadFromDiskAndCache("bg-BG", @"C:\GitHub\Property\Property.Web\locale\bg-BG\messages.po");

            var session = new I18NSession();

            session.Set(context, "bg-BG");

            var text = session.GetText(context, "Login in bilid", "bg-BG");

            Assert.True(true);

            Assert.AreEqual("Вход в bilid", text);
        }
Esempio n. 3
0
 protected string _(string text, LocalizingService service, string[] languages)
 {
     return LocalizingService.GetText(text, languages);
 }