This is a migrated thread and some comments may be shown as answers.

PivotGrid Localization

14 Answers 132 Views
PivotGrid and PivotFieldList
This is a migrated thread and some comments may be shown as answers.
Alex Dybenko
Top achievements
Rank 2
Alex Dybenko asked on 29 Jun 2016, 02:32 PM

Hi,

i made a localization class for PivotGrid as from: http://docs.telerik.com/devtools/winforms/pivotgrid/localization/localization

but some labels are still not translated, for example "Choose fields", "Row Labels" on FieldList, several labels on Print options dialog. Is it possible to make these also translated?

 

Thanks

Alex

 

14 Answers, 1 is accepted

Sort by
0
Hristo
Telerik team
answered on 29 Jun 2016, 03:46 PM
Hi Alex,

Thank you for writing.

Currently, the field list control cannot be localized using the PivotGridLocalizationProvider class. We have a feature request for such support: ADD. RadPivotFieldList - add Localization provider. The feedback item also suggests a workaround solution. Please make sure to subscribe and vote for the feedback item.

The currently available localized strings are listed in the mentioned in your post article: Localization.

I hope this helps. Please let me know if you need further assistance.

Regards,
Hristo Merdjanov
Telerik
Check out the Windows Forms project converter, which aids the conversion process from standard Windows Forms applications written in C# or VB to Telerik UI for WinForms. For more information check out this blog post and share your thoughts.
0
Alex Dybenko
Top achievements
Rank 2
answered on 30 Jun 2016, 09:36 AM

Hi Hristo,

Thanks for workaround! Perhaps you have a sample code to translate highlighted labels?

 

Alex

 

0
Accepted
Hristo
Telerik team
answered on 30 Jun 2016, 10:23 AM
Hello Alex,

Thank you for writing back.

The present localization provider as described here provides means for localizing the labels in the field list control. Because the field list is a separate control to the pivot the localization provider needs to be loaded in the form`s constructor before calling the InitializeComponent method: 
public Form1()
{
 
    PivotGridLocalizationProvider.CurrentProvider = new MyEnglishPivotGridLoclizationProvider();
 
    InitializeComponent();
}

I will make sure that the documentation article gets updated accordingly.

I hope this helps. Should you have further questions do not hesitate to write back.

Regards,
Hristo Merdjanov
Telerik
Check out the Windows Forms project converter, which aids the conversion process from standard Windows Forms applications written in C# or VB to Telerik UI for WinForms. For more information check out this blog post and share your thoughts.
0
Alex Dybenko
Top achievements
Rank 2
answered on 30 Jun 2016, 11:15 AM

Thanks Hristo, that makes sense

Alex

 

0
Alex Dybenko
Top achievements
Rank 2
answered on 25 Jul 2016, 11:46 AM

Hi Hristo,

is it possible to localize month (January etc) when i drop date's field Month on Row/Columns?

Alex

 

0
Dimitar
Telerik team
answered on 25 Jul 2016, 12:25 PM
Hello Alex,

This depends on the culture. You can change culture of the provider like this: 
LocalDataSourceProvider dataProvider = new LocalDataSourceProvider();
dataProvider.Culture = new System.Globalization.CultureInfo("bg-BG");

I hope this helps. 

Regards,
Dimitar
Telerik by Progress
Check out the Windows Forms project converter, which aids the conversion process from standard Windows Forms applications written in C# or VB to Telerik UI for WinForms.For more information check out this blog post and share your thoughts.
0
Alex Dybenko
Top achievements
Rank 2
answered on 25 Jul 2016, 12:41 PM

Thanks Dimitar,

works fine with LocalDataSourceProvider, but what about QueryableDataProvider? I don't see Culture property there...

Alex

 

0
Dimitar
Telerik team
answered on 26 Jul 2016, 08:03 AM
Hi Alex,

Currently, you can only change the culture with the LocalDataSourceProvider. I have added a feature request for this in our Feedback Portal. You can track the item for status changes and add your vote for it here.

Your Telerik Points have been updated for this request.

Should you have any other questions do not hesitate to ask.
 
Regards,
Dimitar
Telerik by Progress
Check out the Windows Forms project converter, which aids the conversion process from standard Windows Forms applications written in C# or VB to Telerik UI for WinForms.For more information check out this blog post and share your thoughts.
0
Alex Dybenko
Top achievements
Rank 2
answered on 26 Jul 2016, 08:12 AM

Thanks Dimitar,

lookig forward for this update

Alex

 

0
Alex Dybenko
Top achievements
Rank 2
answered on 27 Jul 2016, 11:27 AM

Hi,

one more localization question, on tooltip Sum is localized, but "of", "row", "column", "value" are not. Is it a workaround for it?

Thanks

Alex

 

0
Dimitar
Telerik team
answered on 27 Jul 2016, 12:44 PM
Hi Alex,

This is a known issue which is already added to our Feedback Portal. The item is already resolved and the fix will be available in the next official release. The item description contains a workaround for the current version: RadPivotGrid - add localization support for the .

I hope this will be useful. 

Regards,
Dimitar
Telerik by Progress
Check out the Windows Forms project converter, which aids the conversion process from standard Windows Forms applications written in C# or VB to Telerik UI for WinForms.For more information check out this blog post and share your thoughts.
0
Alex Dybenko
Top achievements
Rank 2
answered on 27 Jul 2016, 03:18 PM

Thanks Dimitar,

work fine

Alex

 

0
Alex Dybenko
Top achievements
Rank 2
answered on 26 Oct 2016, 12:32 PM

Hi,

with latest release 1024 workaround from post#2:
https://feedback.telerik.com/Project/154/Feedback/Details/142052-add-radpivotfieldlist-add-localization-provider

is not working for ValuesControl: if i change item text for Count or Avg - I can't change values to Count or Avg (other menu items works ok). Is it a workaround for this?

Thanks

Alex

 

 

0
Dimitar
Telerik team
answered on 27 Oct 2016, 12:18 PM
Hello Alex,

I was able to reproduce this and find a workaround that you can use. You need to update the custom PivotFieldListVisualItem class and bypass the menu items click:
public class MyPivotFieldListVisualItem : PivotFieldListVisualItem
{
    public MyPivotFieldListVisualItem(FieldListViewModel viewModel)
        : base(viewModel) { }
 
    protected override void CreateChildElements()
    {
        base.CreateChildElements();
 
        CommandBarDropDownButton btn = this.GetType().BaseType
            .GetField("button", BindingFlags.Instance | BindingFlags.NonPublic)
            .GetValue(this) as CommandBarDropDownButton;
 
        if (btn != null)
        {
            btn.DropDownMenu.PopupOpening += DropDownMenu_PopupOpening;
        }
 
 
        RadMenuItem count = this.GetType().BaseType
            .GetField("countMenuItem", BindingFlags.Instance | BindingFlags.NonPublic)
            .GetValue(this) as RadMenuItem;
 
        count.Click += Count_Click;
 
        RadMenuItem sum = this.GetType().BaseType
            .GetField("sumMenuItem", BindingFlags.Instance | BindingFlags.NonPublic)
            .GetValue(this) as RadMenuItem;
 
        sum.Click += Sum_Click;
 
        RadMenuItem avg = this.GetType().BaseType
            .GetField("avgMenuItem", BindingFlags.Instance | BindingFlags.NonPublic)
            .GetValue(this) as RadMenuItem;
 
        avg.Click += Avg_Click;
    }
 
    private void Count_Click(object sender, EventArgs e)
    {
        Value value = (this.Data.DataBoundItem as Value);
         
        bool res = (bool)this.GetType().BaseType.GetMethod("SetNewAggregateFunction", BindingFlags.Instance | BindingFlags.NonPublic)
            .Invoke(this, new object[] { value.Description, "Count" });
        if (value != null && res)
        {
            this.Synchronize();
            FieldListViewModel viewModel = this.GetType().BaseType.GetField("viewModel", BindingFlags.Instance | BindingFlags.NonPublic).GetValue(this) as FieldListViewModel;
            viewModel.ExecuteUpdate();
        }
    }
 
    private void Sum_Click(object sender, EventArgs e)
    {
        Value value = (this.Data.DataBoundItem as Value);
 
        bool res = (bool)this.GetType().BaseType.GetMethod("SetNewAggregateFunction", BindingFlags.Instance | BindingFlags.NonPublic)
            .Invoke(this, new object[] { value.Description, "Sum" });
        if (value != null && res)
        {
            this.Synchronize();
            FieldListViewModel viewModel = this.GetType().BaseType.GetField("viewModel", BindingFlags.Instance | BindingFlags.NonPublic).GetValue(this) as FieldListViewModel;
            viewModel.ExecuteUpdate();
        }
    }
    private void Avg_Click(object sender, EventArgs e)
    {
        Value value = (this.Data.DataBoundItem as Value);
 
        bool res = (bool)this.GetType().BaseType.GetMethod("SetNewAggregateFunction", BindingFlags.Instance | BindingFlags.NonPublic)
            .Invoke(this, new object[] { value.Description, "Average" });
        if (value != null && res)
        {
            this.Synchronize();
            FieldListViewModel viewModel = this.GetType().BaseType.GetField("viewModel", BindingFlags.Instance | BindingFlags.NonPublic).GetValue(this) as FieldListViewModel;
            viewModel.ExecuteUpdate();
        }
    }
    private void DropDownMenu_PopupOpening(object sender, System.ComponentModel.CancelEventArgs args)
    {
        foreach (RadItem item in ((RadDropDownMenu)sender).Items)
        {
            // Validate and localize each of the items
            if (item is RadMenuItem)
            {
                item.Text = item.Text + "MyText";
            }
        }
    }
}

I hope this will be useful. 

Regards,
Dimitar
Telerik by Progress
Check out the Windows Forms project converter, which aids the conversion process from standard Windows Forms applications written in C# or VB to Telerik UI for WinForms.For more information check out this blog post and share your thoughts.
Tags
PivotGrid and PivotFieldList
Asked by
Alex Dybenko
Top achievements
Rank 2
Answers by
Hristo
Telerik team
Alex Dybenko
Top achievements
Rank 2
Dimitar
Telerik team
Share this question
or