Comments (6)
Hi olegbonder,
Thanks for reaching out. Please refer issue #16
Thanks,
Abdul Rahman
from jquerydatatablesserverside.
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
from jquerydatatablesserverside.
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.
from jquerydatatablesserverside.
from jquerydatatablesserverside.
Can you add test project where use localization in columns?
Thanks
from jquerydatatablesserverside.
Demo Project now supports localization.
from jquerydatatablesserverside.
Related Issues (20)
- Fetching Data on Clicking Row In Table
- How to remove the placeholder in column searching
- Buttons at footer using jquery datatables HOT 5
- Searching date is not working perfectly HOT 5
- Give an option to apply grouping
- Seems to be very slow HOT 1
- [FEATURE] Add SearchPanes support HOT 1
- Is there a way to use this in a Blazor App HOT 1
- SelectList
- SearchOptionsProcessor.Apply not correctly handling more than one "multiple term" search term HOT 2
- [FEATURE] Support for complex table headers with the tag helper
- Add support for "Like" operations
- Localization .resx
- How to add multi-select checkboxes to table? HOT 1
- [BUG] Invalid Operator HOT 2
- [QUESTION] DateTime Searching problem HOT 2
- [QUESTION] Searching Enum value as string instead of short/int HOT 2
- [QUESTION] How To localizate the name of Coloumns
- [QUESTION] How use IncludeInReport on Dictionary HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from jquerydatatablesserverside.