예제 #1
0
 public void Can_handle_markup_in_text()
 {
     var context = A.Fake<HttpContextBase>();
     var session = new I18NSession();
     var text = session.GetText(context, "Take the <br />next step!");
     Console.WriteLine(text);
 }
예제 #2
0
        public void Can_handle_markup_in_text()
        {
            var context = A.Fake <HttpContextBase>();
            var session = new I18NSession();
            var text    = session.GetText(context, "Take the <br />next step!");

            Console.WriteLine(text);
        }
예제 #3
0
 protected void Initialize()
 {
     Controller = MockHelper.FakeController();
     Controller.SetFakeControllerContext(new NameValueCollection
                                             {
                                                 {"Accept-Language", "en"}
                                             });
     Session = new I18NSession();
     LocalizingService = new LocalizingService();
 }
예제 #4
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);
        }
예제 #5
0
 public RequiredAttribute()
 {
     _session = new I18NSession();
 }
예제 #6
0
 ///<summary>
 /// Initializes a new instance of the <see cref="DataTypeAttribute"/> class by using the specified field template name
 ///</summary>
 ///<param name="customDataType"></param>
 public DataTypeAttribute(string customDataType)
     : base(customDataType)
 {
     _session = new I18NSession();
 }
예제 #7
0
 ///<summary>
 /// Initializes a new instance of the <see cref="DataTypeAttribute"/> class by using the specified type name
 ///</summary>
 ///<param name="dataType"></param>
 public DataTypeAttribute(DataType dataType)
     : base(Convert(dataType))
 {
     _session = new I18NSession();
 }
예제 #8
0
 protected ValidationAttribute()
 {
     _session = new I18NSession();
 }
예제 #9
0
 protected LocalizingAttribute()
 {
     _session = new I18NSession();
 }
예제 #10
0
 protected ValidationAttribute()
 {
     _session = new I18NSession();
 }
예제 #11
0
 public RequiredAttribute()
 {
     _session = new I18NSession();
 }
예제 #12
0
 ///<summary>
 /// Initializes a new instance of the <see cref="DataTypeAttribute"/> class by using the specified field template name
 ///</summary>
 ///<param name="customDataType"></param>
 public DataTypeAttribute(string customDataType) : base(customDataType)
 {
     _session = new I18NSession();
 }
예제 #13
0
 ///<summary>
 /// Initializes a new instance of the <see cref="DataTypeAttribute"/> class by using the specified type name
 ///</summary>
 ///<param name="dataType"></param>
 public DataTypeAttribute(DataType dataType) : base(Convert(dataType))
 {
     _session = new I18NSession();
 }
예제 #14
0
 public StringLengthAttribute(int maximumLength) : base(maximumLength)
 {
     _session = new I18NSession();
 }
예제 #15
0
 protected LocalizingAttribute()
 {
     _session = new I18NSession();
 }
예제 #16
0
 public StringLengthAttribute(int maximumLength)
     : base(maximumLength)
 {
     _session = new I18NSession();
 }