Hi the localisation of the the pages is clear to me, but if i have several datagrids lists and so on on more than one page, it would ben nice to have only one place for all localisations, not that i have to add these on all my pages over and over again.
So i made a several dummy classes, and add to this classes the xxx.xx.resx files.
At this time i have already the localisation for the
- Enums, converted tot List
- Razor Page, text items
- Notifications, Dialogs messages
Still to do all other Radzen Components.
the question:
I saw also there is a property, field named "Culture" on Datagrid.
What is the purpose of this property , field and how can i use it.
Hi @RacketRebel,
The Culture property is used to override the culture used to format dates and times in RadzenDataGrid (and in other Radzen Blazor components). By default it is set to the current culture of the thread. Here is the actual implementation: radzen-blazor/Radzen.Blazor/RadzenComponent.cs at master · radzenhq/radzen-blazor · GitHub
Hi @korchev,
Thanks for the reply.
Although a DataGrid with 100% localisation than the source file becomes almost unreadable. There are for the datagrid a lot of text items that needs to be translated
My request: Is it an option that for all components instead of the default string a function is defined in the set and get is, and some properties that needs to be filled, something like:
public static bool UseLocaliser;
public static IStringLocalizer Localizer;
pulic static string UseLocalisation(string displayText)
{
return UseLocaliser ? Localizer[$"{displayText}.Text"] : displayText;
}
and then a dummy,
public class RadzenComponents
{
// just for the localisation of the component
}
in the Page
@inject Microsoft.Extensions.Localization.IStringLocalizer<RadzenLoactisation> localiser
and not to forget the files with the appropriate: RadzenLocalisation.xx.resx
<root>
<data name="and.Text" xml:space="preserve">
<value>and</value>
</data>
...
</root>
Thanks
Hi @RacketRebel,
I am afraid this isn't possible.
You can check this forum thread for a possible solution: Localize Radzen Datagrid Advanced Filter - #5 by korchev
Hi @korchev
Thanks that is of course an option, thanks.
Ruud
Hi @korchev ,
i thought this would be the solution,
but when i want to change the grid in my custom grid the following error wil show:
0>HeatPumpManufacturers.razor(21,37): Error CS1503 : Argument 2: cannot convert from 'method group' to 'Microsoft.AspNetCore.Components.EventCallback'
and that is an event call:
RowCreate="@HeatPumpManufacturerRowCreate"
Hi @korchev ,
The program.cs swaps the standaard version for mine version.
No erros any more but still not working, the localisation will not be visible on the page, and the debugger does not stops on the points where i except it should.
Hi @RacketRebel,
Find attached a sample application.
CustomDataGridApp.zip (367.0 KB)
Hi Thanks,
For the example, I forgot to assign the Parameter. I have completed the example with localisation of the DataGrid, Enums. It works perfect thanks.
Maybe useful
CustomDataGridApp.zip (404.8 KB)
With regards.