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
Did someone had a chance to look at my question ?
Hello User101,
I am not particularly familiar with this "Loc" extension method that you are defining or referring to, but the RegisterResources method for the resource files of the XamDataGrid is not going to work here, as that method is only available for the Infragistics "shared" WPF controls. That is, the controls that have a shared code-base between Silverlight and WPF.
For the WPF specific controls, such as the XamDataGrid, you will need to use the Customizer for that particular class. You can read further about using the Customizer for the XamDataGrid resource strings at the following articles and forum threads that discuss this issue:
Customizing Resources for WPF Only Controls: http://help.infragistics.com/Help/Doc/WPF/2015.1/CLR4.0/html/GeneralConcepts_Customizing_Resource_Strings_for_WPF_Only_control.html.
XamDataGrid Localization (forum): http://www.infragistics.com/community/forums/t/97070.aspx.
Please let me know if you have any other questions or concerns on this matter.
Sincerely,AndrewAssociate Developer
Hey Andrew,
That's not what I'm looking. I need a way to switch the labels language based on the culture. Localization support that. However it is not working on the xamdatagrid labels.
Since you are not familiar with localization, I would like to speak to someone who have worked with localization or you can communicate the info.
We are at a critical stage of development, we need to find a solution for this issue.
Thank you for you help
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.
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 ?