Hello,
I'm trying to localize the labels on the xamdatagrid using the Loc extension method.
<igDP:XamDataGrid.FieldLayouts> <igDP:FieldLayout> <igDP:FieldLayout.Fields> <igDP:Field Name="AColumn" Label="{Loc myCustomLabel}"/> </igDP:FieldLayout.Fields> </igDP:FieldLayout></igDP:XamDataGrid.FieldLayouts>
Name space in xaml code:
LocalizationScope.ResourceManager="{ResourceManager AssemblyName=Project.Test, BaseName=Project.Test.Resource.TestWindowResources}"
I searched the 2016.1 documentation. It suggests to register the resource file using RegisterResources method. However this method is not available for xamdatagrid.
Any idea on this issue ?
Thank you
Hi Andrew,
We are implementing localization in our WPF application.
After going through the various approaches available in the market, I found this approach very useful.
So far, it is working as expected.
But, my only concern is it might fail in SDL audit since the WPFLocalization.dll provided in application is not signed.
Where can I get the signed dll?
I have a question, I tried to declare the LocalizationScope.ResourceManager at the top level of my WPF Window. This works for all controls but not for the XamDataGrid, for which I followed your approach, to declare it at field level. This would of course mean to add unnecessary declarations at every field, which would mean a few hundred of declarations to be touched. This is also not in the common sense of WPF, where declarations should inherit strictly.
I would think this can be improved, would this be something that Infragistics can look at? Andrew what do you think?
Hello Andrew,
I have solved the localization issue. Attached is a modified version of the sample solution on how to switch the language while the application is running.
Please note I included WpfLocalization.dll.
Thank you for the sample.
I have looked at it. The issue is when I change the culture when the application is running the labels are not getting updated (requirement).
I have created a button, and a click event.
I have used Thread.CurrentThread.CurrentCulture = new System.Globalization.CultureInfo("en-US");
Any idea ?
Hello User101,
I have since realized that the "XamDataGrid localization" link that I had originally sent you was a link to this forum thread. I have updated that link to reflect the correct forum thread that has information about XamDataGrid localization on it.
I am personally familiar with localization of Infragistics controls, just not the Loc extension method that you had originally described. In addition to the links that I have provided above, I have also created a sample project to demonstrate how the labels can be localized using .resx files included in the project for the languages that you wish to support. Included in the sample file is an "en-US" culture file as well as one for "es-ES" (Spanish). To see the difference, you can toggle the commented status of the Thread.CurrentThread culture definitions in the MainWindow's constructor.
I hope this helps you. Please let me know if you have any other questions or concerns on this matter.
Sincerely,AndrewAssociate Developer