sjtuross 9 Posted November 21, 2024 Posted November 21, 2024 The PluginPageInfo class has Name and DisplayName properties which are shown in UI. Is there a way to dynamically localize them based on current user display language?
softworkz 5066 Posted November 21, 2024 Posted November 21, 2024 44 minutes ago, sjtuross said: The PluginPageInfo class has Name and DisplayName properties which are shown in UI. Is there a way to dynamically localize them based on current user display language? Yes, there are localizable attributes available: Emby SDK Reference: DisplayNameLAttribute Emby SDK Reference: DescriptionLAttribute These have a localized and a non-localized constructor, for example: The first two members are not localized. The other four items have an entry with the string as key in the RESX resources of the given type.
softworkz 5066 Posted November 21, 2024 Posted November 21, 2024 I've created an extension for Resharper which makes the localization very easy. (R# supports and assists in localization but not for attributes): https://plugins.jetbrains.com/plugin/19783-attribute-localization-for-resharper https://github.com/LocalizationTools/LocalizationTools.ReSharper
sjtuross 9 Posted November 21, 2024 Author Posted November 21, 2024 Thanks for the quick response. Maybe I was not clear. I refer to this class https://dev.emby.media/reference/pluginapi/MediaBrowser.Model.Plugins.PluginPageInfo.html I think it's not possible to decorate its Name and DisplayName with the mentioned attributes, right? Because it's not my class.
softworkz 5066 Posted November 22, 2024 Posted November 22, 2024 Decorating doesn't help in any case, because it's not a UI class. AFAIK, there's currently no way to localize the menu name for plugin-provided dashboard menu entries. @Luke
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now