fix: translate app permissions with nested scopes
Proposed changes
Apps that request the room.system.view-all permission show the raw key Apps_Permissions_room_system.view-all in the app permissions list (install / update dialogs) instead of its translation.
AppPermissionsList builds the translation key with permission.replace('.', '_'), which only replaces the first dot. room.system.view-all is the only permission in AppPermissions with two scopes, and its key in en.i18n.json is Apps_Permissions_room_system_view-all, so the lookup misses. Using replaceAll builds the key the translations expect.
Issue(s)
No existing issue. Found while checking the permission names in packages/apps-engine/src/definition/metadata/AppPermissions.ts against the Apps_Permissions_* keys.
Steps to test or reproduce
- Install an app that requests
room.system.view-all. - Open its permission review dialog: before this change the entry reads
Apps_Permissions_room_system.view-all; after it reads the translated text.
AppPermissionsList.spec.tsx covers a one-scope name and the nested room.system.view-all name; the nested case fails without the fix.
Further comments
Several other permissions in AppPermissions (for example threads.read, ui.registerButtons, video-conference.read) have no translation key at all. That is a separate change (adding translations) and is left out of this PR.
Summary by CodeRabbit
- Bug Fixes
- Fixed translated permission labels for nested app permissions, so they display correctly in the app install and permissions dialogs.