Add internationalization support
Levvy055 opened this issue · 2 comments
Levvy055 commented
The DisplayAttribute and other non-ValidationAttributes are not localised.
It would be nice to have something to make it available.
Aaltuj commented
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.
if you have any other remark, please let me know
Aaltuj commented
I'm closing this, because there is no activity and the internationalization is not an issue related to the component (at this moment).