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
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
Hi Hristo,
Thanks for workaround! Perhaps you have a sample code to translate highlighted labels?
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
Thanks Hristo, that makes sense
Alex
Hi Hristo,
is it possible to localize month (January etc) when i drop date's field Month on Row/Columns?
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
Thanks Dimitar,
works fine with LocalDataSourceProvider, but what about QueryableDataProvider? I don't see Culture property there...
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.
Dimitar
Telerik by Progress
Thanks Dimitar,
lookig forward for this update
Alex
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
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
Thanks Dimitar,
work fine
Alex
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
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