Closed olegbonder closed 4 years ago
Hi olegbonder,
Thanks for reaching out. Please refer issue #16
Thanks, Abdul Rahman
Hi fingers10, I refered to issue #16. But I dont't understand how to use constructor in class "JqueryDataTablesHtmlLocalizedTagHelper" using DI (dependecy injection) My steps:
Startup.cs:
services.AddLocalization(opt => opt.ResourcesPath = "Resources");
services.AddScoped<IDemoService, DefaultDemoService>();
services.Configure<RequestLocalizationOptions>(options =>
{
var supportedCultures = new[]
{
new CultureInfo("en"),
new CultureInfo("ru")
};
options.DefaultRequestCulture = new RequestCulture("ru");
options.SupportedCultures = supportedCultures;
options.SupportedUICultures = supportedCultures;
});
services.AddControllersWithViews()
.AddViewLocalization()
.AddDataAnnotationsLocalization()
Add Resource Files for my Model "Demo" (Demo.en.resx and [Demo.ru.resx): Add Property "Name" in Resource Files
In Demo-model add attribute:
[Display(Name = "Name")]
[SearchableString(EntityProperty = "FirstName,LastName")]
[Sortable(EntityProperty = "FirstName,LastName", Default = true)]
public string Name { get; set; }
Add in _ViewImports.cshtml:
@inject IHtmlLocalizer<JqueryDataTablesTagHelper> sl
In View replace tag-helper "jquery-datatables" on "jquery-datatables-html-localized"
No effect How can i localize table columns using DataAnnotationsLocalization in view-model properties? Thanks
Did you try JqueryDataTablesHtmlLocalizedTagHelper.
Refer Table HTML section in Docs.
Please note: If you prefer HTML Localization then,
Tag Helper is available with all the above properties.
Yes, I did, but no effect.
вс, 16 авг. 2020 г., 7:01 Abdul Rahman notifications@github.com:
Did you try JqueryDataTablesHtmlLocalizedTagHelper https://github.com/fingers10/JqueryDataTablesServerSide/blob/master/AspNetCoreWeb/TagHelpers/JqueryDataTablesHtmlLocalizedTagHelper.cs .
Refer Table HTML https://github.com/fingers10/JqueryDataTablesServerSide#table-html section in Docs.
Please note: If you prefer HTML Localization then, Tag Helper is available with all the above properties.
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/fingers10/JqueryDataTablesServerSide/issues/52#issuecomment-674475610, or unsubscribe https://github.com/notifications/unsubscribe-auth/AFO3HT4CJGDNWVHZBB2RTMDSA5KX7ANCNFSM4P3BRADQ .
Can you add test project where use localization in columns?
Thanks
Demo Project now supports localization.
how can we use localization? Please show an example