Specific tag not localized?

Hello,

we recently added some new control types to our project. One of them has the ASP tag "gaia:LinkButton".

These linkbuttons are not selectable when i re-scan the project (no checkbox in front of the item in the list) The component has a property "Text" just like the normal LinkButton. The controls are correctly registered using the "Register Assembly" directive.

What can i do to make them selectable?

Zhanks in advance,
Ralf

Germany

Hi Ralf,

you seem to have worked this one out for yourself. I have just found your posting in the GaiaWare forum.

For anyone else reading this posting, it is critical that properties which can be localized are given the Localizable attribute, by the author of the control. You can't see the attributes in the visual studio object browser, but you can see them in Red Gate's (formerly Lutz Roeder's) Reflector.

The following screenshot shows the Gaiaware LinkButton in the reflector
Image
You can see that the Text property has the AjaxSerializable attribute, but not the Localizable attribute.

Phil


Hi,

the vendor of the components has still not added the "Localizable" attribute. So i made a little test:

I added a normal "asp:Label", added the caption of this label as resourcestring using your addin. After that i added a "gaia:Label" (which does not define that attribute but is inherited from "asp:Label") and added the "meta:resorcekey" i created manually to the "gaia:Label".

When i run the application both label controls are shown with the same text! The "gaia:label" is localized even if the attribute is not defined in the class itself. It looks like ASP.NET uses the attribute "Localizable" from the ancestor in the inherited class!

The "Localizable" attribute is inherited in the class hierarchy!

Woukld it be possible that your addin does not only check the current class for this attribute but also the ancestors (the classes from which the current class inherits)?

Thanks in advance,
Ralf


Hi,

How do you test for localizable attributes??

When i use the following code (CurrentComponentReference is a reference to any control i want to test) i get the information that a Gaia:Label is localizable!!

Dim attributes As AttributeCollection = TypeDescriptor.GetProperties(CurrentComponentReference)("Text").Attributes

If attributes IsNot Nothing Then
Dim myAttribute As LocalizableAttribute = CTypeGetType(LocalizableAttribute, LocalizableAttribute)
If myAttribute.IsLocalizable Then
' insert code here for localizable components...
End If
End If

Do you use reflection to check the Localizable attribute? I have not tried if reflection will give me the same info, yet.

Ciao,
Ralf

Germany

You are right, this is an error in the Add-In. Sorry that I did not realize this earlier. I have now uploaded a new version (4.60.0028) which should now detect the localizable attribute on the gaia:Label control.

The Add-In uses reflection to detect the Localizable attribute, and it is necessary to loop through the base classes. Stupidly, I have this logic at two places, for the Text attribute and for all other attributes. For all other attributes, it already checked the base classes. The problem was only with the Text attribute. I ought to restructure that a little.

Phil

Cool! Thank you for the update (i cannot imagine how much work your addin saved us while localizing our project!!)

Ciao,
Ralf