]> source.dussan.org Git - nextcloud-server.git/commitdiff
fix(files_sharing): Add one string for every share type to not assume any language
authorFerdinand Thiessen <opensource@fthiessen.de>
Wed, 13 Dec 2023 00:37:09 +0000 (01:37 +0100)
committerfenn-cs <fenn25.fn@gmail.com>
Thu, 13 Jun 2024 14:07:01 +0000 (15:07 +0100)
Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
apps/files_sharing/src/views/SharingDetailsTab.vue

index 4f977baf181c61494cc7d2420d185931459ecb21..862fdf16079ce36aa29f5e741181eb59a8f13966 100644 (file)
@@ -305,24 +305,24 @@ export default {
 
        computed: {
                title() {
-                       let title = t('files_sharing', 'Share with ')
-                       if (this.share.type === this.SHARE_TYPES.SHARE_TYPE_USER) {
-                               title = title + this.share.shareWithDisplayName
-                       } else if (this.share.type === this.SHARE_TYPES.SHARE_TYPE_LINK) {
-                               title = t('files_sharing', 'Share link')
-                       } else if (this.share.type === this.SHARE_TYPES.SHARE_TYPE_GROUP) {
-                               title += ` (${t('files_sharing', 'group')})`
-                       } else if (this.share.type === this.SHARE_TYPES.SHARE_TYPE_ROOM) {
-                               title += ` (${t('files_sharing', 'conversation')})`
-                       } else if (this.share.type === this.SHARE_TYPES.SHARE_TYPE_REMOTE) {
-                               title += ` (${t('files_sharing', 'remote')})`
-                       } else if (this.share.type === this.SHARE_TYPES.SHARE_TYPE_REMOTE_GROUP) {
-                               title += ` (${t('files_sharing', 'remote group')})`
-                       } else if (this.share.type === this.SHARE_TYPES.SHARE_TYPE_GUEST) {
-                               title += ` (${t('files_sharing', 'guest')})`
+                       switch (this.share.type) {
+                       case this.SHARE_TYPES.SHARE_TYPE_USER:
+                               return t('files_sharing', 'Share with {userName}', { userName: this.share.shareWithDisplayName })
+                       case this.SHARE_TYPES.SHARE_TYPE_LINK:
+                               return t('files_sharing', 'Share link')
+                       case this.SHARE_TYPES.SHARE_TYPE_GROUP:
+                               return t('files_sharing', 'Share with group')
+                       case this.SHARE_TYPES.SHARE_TYPE_ROOM:
+                               return t('files_sharing', 'Share in conversation')
+                       case this.SHARE_TYPES.SHARE_TYPE_REMOTE:
+                               return t('files_sharing', 'Share with remote')
+                       case this.SHARE_TYPES.SHARE_TYPE_REMOTE_GROUP:
+                               return t('files_sharing', 'Share with remote group')
+                       case this.SHARE_TYPES.SHARE_TYPE_GUEST:
+                               return t('files_sharing', 'Share with guest')
+                       default:
+                               return t('files_sharing', 'Share with')
                        }
-
-                       return title
                },
                /**
                 * Can the sharee edit the shared file ?