protected void Initialize() { Controller = MockHelper.FakeController(); Controller.SetFakeControllerContext(new NameValueCollection { {"Accept-Language", "en"} }); Session = new I18NSession(); LocalizingService = new LocalizingService(); }
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); }
protected string _(string text, LocalizingService service, string[] languages) { return LocalizingService.GetText(text, languages); }