2020-03-31 11:00:09 +00:00
|
|
|
|
using System.ComponentModel;
|
|
|
|
|
|
|
2022-12-21 07:51:17 +00:00
|
|
|
|
namespace Flow.Launcher.Core.Resource
|
2020-03-31 11:00:09 +00:00
|
|
|
|
{
|
|
|
|
|
|
public class LocalizedDescriptionAttribute : DescriptionAttribute
|
|
|
|
|
|
{
|
|
|
|
|
|
private readonly string _resourceKey;
|
|
|
|
|
|
|
|
|
|
|
|
public LocalizedDescriptionAttribute(string resourceKey)
|
|
|
|
|
|
{
|
|
|
|
|
|
_resourceKey = resourceKey;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public override string Description
|
|
|
|
|
|
{
|
|
|
|
|
|
get
|
|
|
|
|
|
{
|
2025-09-23 09:40:54 +00:00
|
|
|
|
string description = PublicApi.Instance.GetTranslation(_resourceKey);
|
2020-03-31 11:00:09 +00:00
|
|
|
|
return string.IsNullOrWhiteSpace(description) ?
|
|
|
|
|
|
string.Format("[[{0}]]", _resourceKey) : description;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|