Aaltuj/VxFormGenerator

Add internationalization support

Levvy055 opened this issue · 2 comments

The DisplayAttribute and other non-ValidationAttributes are not localised.
It would be nice to have something to make it available.

Hi @Levvy055 ,

I tested that the formgenerator works fine with translated DataAttributes and ValidationAttributes. Just add some resources, and follow this.

       [Display(ResourceType = typeof(Resources.Address), Name = nameof(Resources.Address.FIRSTNAME_LABEL))]
        // Add element to row 1 with automatic width based on number of items in a row
        [VxFormElementLayout(RowId = 1)]
        public string SurName { get; set; }
        [Display(Name = "Street")]
        // Add element to row 2 and set the width to 9 of 12 columns
        [VxFormElementLayout(RowId = 2, ColSpan = 9)]
        [MinLength(5, ErrorMessage = nameof(Resources.Address.FIRSTNAME_LABEL), ErrorMessageResourceType = typeof(Resources.Address))]
        public string Street { get; set; }

See image, where Firstname is translated to Voornaam in Dutch.
image

if you have any other remark, please let me know

I'm closing this, because there is no activity and the internationalization is not an issue related to the component (at this moment).