Localization of "Properties" in PropertyEditor

Jan 3, 2012 at 8:14 PM

I can see that my localization service is being called on "Properties" (the default name of the property group) and a localized string is being returned, but the PropertyEditor does not seem to actually use the localized string. I don't see anything in the source code that filters for "Properties" to treat it differently from other items... What am I missing? Can the term "Properties" be localized?

Jan 3, 2012 at 8:24 PM

My bad. I needed to look at the Categories.Header instead of Categories.Name.

Localization is really important to me. PropertyTools for WPF is very strong in this regard. Good work!

Jan 3, 2012 at 8:43 PM

The first problem where I was looking at the output of PropertyEditor.CreatePropertyModel was just a matter of me looking at the wrong field (Categories.Name instead of Categories.Header).

The other stuff works without the code change below. Group and Tab strings are being localized properly for me, even in the case where one has a translation and not the other. There doesn’t seem to be any reason for a code change.

Nice work.

From: objo [email removed]
Sent: January 03, 2012 1:33 PM
To: Jon Tindel
Subject: Re: Localization of "Properties" in PropertyEditor [propertytools:284876]

From: objo

It seems like the group and tab strings are not localized - a few lines are missing in the PropertyEditor.CreatePropertyModel method.

I think some code like this could help (sorry I don't have time to test myself right now)

localizedCategoryName = this.GetLocalizedString(instanceType, categoryName);
localizedTabName = this.GetLocalizedString(instanceType, tabName);
this.GetOrCreateTab(instanceType, result, localizedTabName, SortIndex, ref currentTabViewModel, ref currentCategoryViewModel);                
this.GetOrCreateCategory(instanceType, localizedCategoryName, SortIndex, currentTabViewModel, ref currentCategoryViewModel);

Let us know if it works, and I can check in a fix.

Jan 3, 2012 at 8:50 PM

right, I didn't see the localization code inside the GetOrCreateTab/Category :)