We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

WPF Localization - How localizate ContextMenuItem

Hi,
My application uses syncfusion localization mechanism.
Can i add the Name/Key in the resource file Syncfusion.SfGrid.WPF.resx (or if exist another way) for localize other items? 
For example i have the context menù of grouped drop area with "Collapse All, Expand All" actions,
when i execute System.Threading.Thread.CurrentThread.CurrentUICulture = new System.Globalization.CultureInfo("de");
I would like to locate it.
I hope you have some solutions. Thank you for your help.

5 Replies

SR Sivakumar R Syncfusion Team July 31, 2017 07:33 PM UTC

Hi Alessandro, 

For localizing the application level string, you can use Resources.resx file in your application as below,  
 
 
 
<syncfusion:SfDataGrid.RecordContextMenu> 
    <ContextMenu> 
        <MenuItem Header="{x:Static properties:Resources.MenuItem1}"></MenuItem> 
    </ContextMenu> 
</syncfusion:SfDataGrid.RecordContextMenu> 
 
Sample: 
 
It is not possible to have application resources also in Syncfusion.SfGrid.WPF.resx since the default resource file in assembly won’t have these resources. 
 
References: 
 
Thanks, 
Sivakumar 



AL Alessandro August 4, 2017 10:29 AM UTC

Hi! thanks a lot!

I have another question, it's possibile change the value of one string (for example "ClearFiltered") from code??? 



BR Balamurugan Rajaraman Syncfusion Team August 7, 2017 01:14 PM UTC

Hi Alessandro 
 
We have checked your query in our side and we cannot change the Localized string in resource file in runtime. Also, the localization string has been set based on the given cultureinfo in the sample while initial loading of SfDataGrid and we cannot change CurrentUICulture in runtime. 
 
Regards, 
Balamurugan R 



AL Alessandro August 9, 2017 11:18 AM UTC

Hi, thanks for the answer.

Sorry but i can't change the value of the string after the initialize of the resources???



BR Balamurugan Rajaraman Syncfusion Team August 10, 2017 02:08 PM UTC

Hi Alessandro 
 
Regarding your query "Change the value of the resource file at runtime" , it is not possible to modify the resource file in the runtime since the application has been initially compiled based on the existing resource file. Hence the desired changes based on your language in the resource file should be made before the app is compiled and the app should be re-initialized so that the app is now compiled with the modified resource file. Please let us know if you may have any other queries. 
 
Regards, 
Balamurugan R 


Loader.
Live Chat Icon For mobile
Up arrow icon