Add translatable subuser permission labels#2185
Conversation
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the
📝 WalkthroughWalkthroughThis change implements translation support for custom subuser permissions. The SubuserResource was updated to conditionally load permission descriptions and section labels from language files with fallback logic when translations are unavailable. Ten new permission group translation keys were added to the English language file. Changes
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Adds a translationPrefix parameter to registerCustomPermissions() so plugins can specify their own namespaced translation keys instead of being limited to the panel's server/user.permissions.* keys.
6bdc7c4 to
8924901
Compare
Resolves #2069
Adds translatable labels for built-in subuser permission tabs and graceful fallback for missing translations. When a translation key doesn't exist (e.g. plugin-provided custom permissions), the UI falls back to
headline()for labels andnullfor descriptions instead of showing raw translation keys.Adds a
translationPrefixparameter toSubuser::registerCustomPermissions()so plugins can provide their own namespaced translations. For example:The plugin would then provide translations at keys like:
my-plugin::permissions.my-feature(tab label)my-plugin::permissions.my-feature_desc(group description)my-plugin::permissions.my-feature_read(individual permission description)