Feature request : Helper for localizing custom attributes
I'm using The addin for a long time now and it keeps improving with each new version (that are quite numerous . That is really a very usefull tool.
For me, what is still missing is a way to facilitate localization of custom attribute. For example, I need to have localizable versions of DescriptionAttribute, DisplayNameAttribute, CategoryAttribute, and some others.
I found a way to achieve that by calling ResourceManager by hand in my custom attribute classes and filling resources by hand too. That could easily be improved by using your addin to detect the use of localizable custom attributes in the code and handle localization of all localizable fields of these custom attribute (marked with LocalizableAttribute).
To identify attributes that need localization, you could create an interface that has to be implemented bu custom attributes (say ILocalizableAttribute) containing the following fields.
public interface ILocalizableAttribute
{
///base name of the resource file
string ResourceBaseName
{
get;
}
///type of the object of an assembly containing the resource files
///This will be used to call ResourcMemanager by hand and getting localized strings.
Type RootType
{
get;
}
}
When the addin parses the code of a project, it could look for attributes implementing this interfaces and then, look for fields marked with LocalizableAttribute.
With this, we would still have to implement calls to resource manager to retrieve localized strings but the localization process could be done through your addin : this would be much easier !
What doyou think about that ?