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.
Unfortunately, activation email could not send to your email. Please try again.

WPF Localization - How localizate ContextMenuItem

Thread ID:

Created:

Updated:

Platform:

Replies:

131818 Jul 28,2017 05:24 AM Aug 10,2017 10:08 AM WPF 5
loading
Tags: SfDataGrid
Alessandro
Asked On July 28, 2017 05:24 AM

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.

Sivakumar R [Syncfusion]
Replied On July 31, 2017 03:33 PM

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 


Alessandro
Replied On August 4, 2017 06:29 AM

Hi! thanks a lot!

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


Balamurugan Rajaraman [Syncfusion]
Replied On August 7, 2017 09:14 AM

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 


Alessandro
Replied On August 9, 2017 07:18 AM

Hi, thanks for the answer.

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


Balamurugan Rajaraman [Syncfusion]
Replied On August 10, 2017 10:08 AM

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 


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.

;