Browse Source

fix: i18n for attachment column and cell

pull/6512/head
Muhammed Mustafa 1 year ago
parent
commit
c863b55668
  1. 18
      packages/nc-gui/components/cell/attachment/Modal.vue
  2. 2
      packages/nc-gui/components/cell/attachment/RenameFile.vue
  3. 8
      packages/nc-gui/components/cell/attachment/index.vue
  4. 13
      packages/nc-gui/lang/en.json

18
packages/nc-gui/components/cell/attachment/Modal.vue

@ -102,17 +102,19 @@ const handleFileDelete = (i: number) => {
@click="open" @click="open"
> >
<MaterialSymbolsAttachFile class="transform group-hover:(text-accent scale-120)" /> <MaterialSymbolsAttachFile class="transform group-hover:(text-accent scale-120)" />
Attach File {{ $t('activity.attachFile') }}
</div> </div>
<div class="flex items-center gap-2"> <div class="flex items-center gap-2">
<div v-if="readOnly" class="text-gray-400">[Readonly]</div> <div v-if="readOnly" class="text-gray-400">[{{ $t('labels.readOnly') }}]</div>
Viewing Attachments of {{ $t('labels.viewingAttachmentsOf') }}
<div class="font-semibold underline">{{ column?.title }}</div> <div class="font-semibold underline">{{ column?.title }}</div>
</div> </div>
<div v-if="selectedVisibleItems.includes(true)" class="flex flex-1 items-center gap-3 justify-end mr-[30px]"> <div v-if="selectedVisibleItems.includes(true)" class="flex flex-1 items-center gap-3 justify-end mr-[30px]">
<NcButton type="primary" class="nc-attachment-download-all" @click="bulkDownloadFiles"> Bulk Download </NcButton> <NcButton type="primary" class="nc-attachment-download-all" @click="bulkDownloadFiles">
{{ $t('activity.bulkDownload') }}
</NcButton>
</div> </div>
</div> </div>
</template> </template>
@ -124,7 +126,7 @@ const handleFileDelete = (i: number) => {
class="text-white ring ring-accent ring-opacity-100 bg-gray-700/75 flex items-center justify-center gap-2 backdrop-blur-xl" class="text-white ring ring-accent ring-opacity-100 bg-gray-700/75 flex items-center justify-center gap-2 backdrop-blur-xl"
> >
<MaterialSymbolsFileCopyOutline class="text-accent" height="35" width="35" /> <MaterialSymbolsFileCopyOutline class="text-accent" height="35" width="35" />
<div class="text-white text-3xl">Drop here</div> <div class="text-white text-3xl">{{ $t('labels.dropHere') }}</div>
</general-overlay> </general-overlay>
</template> </template>
@ -138,7 +140,7 @@ const handleFileDelete = (i: number) => {
/> />
<a-tooltip v-if="!readOnly"> <a-tooltip v-if="!readOnly">
<template #title> Remove File </template> <template #title> {{ $t('title.removeFile') }} </template>
<component <component
:is="iconMap.closeCircle" :is="iconMap.closeCircle"
v-if="isSharedForm || (isUIAllowed('dataEdit') && !isPublic && !isLocked)" v-if="isSharedForm || (isUIAllowed('dataEdit') && !isPublic && !isLocked)"
@ -148,7 +150,7 @@ const handleFileDelete = (i: number) => {
</a-tooltip> </a-tooltip>
<a-tooltip placement="bottom"> <a-tooltip placement="bottom">
<template #title> Download File </template> <template #title> {{ $t('title.downloadFile') }} </template>
<div class="nc-attachment-download group-hover:(opacity-100)"> <div class="nc-attachment-download group-hover:(opacity-100)">
<component :is="iconMap.download" @click.stop="downloadFile(item)" /> <component :is="iconMap.download" @click.stop="downloadFile(item)" />
@ -156,7 +158,7 @@ const handleFileDelete = (i: number) => {
</a-tooltip> </a-tooltip>
<a-tooltip v-if="isSharedForm || (!readOnly && isUIAllowed('dataEdit') && !isPublic && !isLocked)" placement="bottom"> <a-tooltip v-if="isSharedForm || (!readOnly && isUIAllowed('dataEdit') && !isPublic && !isLocked)" placement="bottom">
<template #title> Rename File </template> <template #title> {{ $t('title.renameFile') }} </template>
<div class="nc-attachment-download group-hover:(opacity-100) mr-[35px]"> <div class="nc-attachment-download group-hover:(opacity-100) mr-[35px]">
<component :is="iconMap.edit" @click.stop="renameFile(item, i)" /> <component :is="iconMap.edit" @click.stop="renameFile(item, i)" />

2
packages/nc-gui/components/cell/attachment/RenameFile.vue

@ -48,7 +48,7 @@ onMounted(() => {
<template> <template>
<GeneralModal v-model:visible="visible" class="nc-attachment-rename-modal !w-[30rem]"> <GeneralModal v-model:visible="visible" class="nc-attachment-rename-modal !w-[30rem]">
<div class="flex flex-col items-center justify-center h-full p-8"> <div class="flex flex-col items-center justify-center h-full p-8">
<div class="text-lg font-semibold self-start mb-4">Rename File</div> <div class="text-lg font-semibold self-start mb-4">{{ $t('title.renameFile') }}</div>
<a-form class="w-full h-full" no-style :model="form" @finish="renameFile(form.title)"> <a-form class="w-full h-full" no-style :model="form" @finish="renameFile(form.title)">
<a-form-item class="w-full" name="title" :rules="rules.title"> <a-form-item class="w-full" name="title" :rules="rules.title">

8
packages/nc-gui/components/cell/attachment/index.vue

@ -168,7 +168,7 @@ const rowHeight = inject(RowHeightInj, ref())
class="nc-attachment-cell-dropzone text-white text-lg ring ring-accent ring-opacity-100 bg-gray-700/75 flex items-center justify-center gap-2 backdrop-blur-xl" class="nc-attachment-cell-dropzone text-white text-lg ring ring-accent ring-opacity-100 bg-gray-700/75 flex items-center justify-center gap-2 backdrop-blur-xl"
> >
<MaterialSymbolsFileCopyOutline class="text-accent" /> <MaterialSymbolsFileCopyOutline class="text-accent" />
Drop here {{ $t('labels.dropHere') }}
</general-overlay> </general-overlay>
</template> </template>
@ -182,7 +182,7 @@ const rowHeight = inject(RowHeightInj, ref())
<component :is="iconMap.reload" v-if="isLoading" :class="{ 'animate-infinite animate-spin': isLoading }" /> <component :is="iconMap.reload" v-if="isLoading" :class="{ 'animate-infinite animate-spin': isLoading }" />
<NcTooltip placement="bottom"> <NcTooltip placement="bottom">
<template #title> Click or drop a file into cell</template> <template #title>{{ $t('activity.attachmentDrop') }} </template>
<div v-if="active || !visibleItems.length" class="flex items-center gap-1"> <div v-if="active || !visibleItems.length" class="flex items-center gap-1">
<MaterialSymbolsAttachFile <MaterialSymbolsAttachFile
@ -192,7 +192,7 @@ const rowHeight = inject(RowHeightInj, ref())
v-if="!visibleItems.length" v-if="!visibleItems.length"
class="group-hover:text-primary text-gray-500 dark:text-gray-200 dark:group-hover:!text-white text-xs" class="group-hover:text-primary text-gray-500 dark:text-gray-200 dark:group-hover:!text-white text-xs"
> >
Add file(s) {{ $t('activity.addFiles') }}
</div> </div>
</div> </div>
</NcTooltip> </NcTooltip>
@ -258,7 +258,7 @@ const rowHeight = inject(RowHeightInj, ref())
<component :is="iconMap.reload" v-if="isLoading" :class="{ 'animate-infinite animate-spin': isLoading }" /> <component :is="iconMap.reload" v-if="isLoading" :class="{ 'animate-infinite animate-spin': isLoading }" />
<NcTooltip v-else placement="bottom"> <NcTooltip v-else placement="bottom">
<template #title> View attachments</template> <template #title> {{ $t('activity.viewAttachment') }}</template>
<component <component
:is="iconMap.expand" :is="iconMap.expand"

13
packages/nc-gui/lang/en.json

@ -264,6 +264,8 @@
"displayValue": "Display Value", "displayValue": "Display Value",
"hideAll":"Hide all", "hideAll":"Hide all",
"hideSystemFields": "hideSystemFields", "hideSystemFields": "hideSystemFields",
"removeFile": "Remove File",
"downloadFile": "Download File",
"renameTable": "Rename Table", "renameTable": "Rename Table",
"renamingTable": "Renaming Table", "renamingTable": "Renaming Table",
"copyAuthToken": "Copy Auth Token", "copyAuthToken": "Copy Auth Token",
@ -331,7 +333,8 @@
"allowAllMimeTypes": "Allow All Mime Types", "allowAllMimeTypes": "Allow All Mime Types",
"defaultView": "Default View", "defaultView": "Default View",
"relations": "Relations", "relations": "Relations",
"switchLanguage": "Switch Language" "switchLanguage": "Switch Language",
"renameFile": "Rename File"
}, },
"labels": { "labels": {
"optional": "Optional", "optional": "Optional",
@ -348,6 +351,9 @@
"dataSources": "Data Sources", "dataSources": "Data Sources",
"searchProjects": "Search Projects", "searchProjects": "Search Projects",
"createdBy": "Created By", "createdBy": "Created By",
"viewingAttachmentsOf": "Viewing Attachments of",
"readOnly": "Readonly",
"dropHere": "Drop here",
"createdOn": "Created On", "createdOn": "Created On",
"notifyVia": "Notify Via", "notifyVia": "Notify Via",
"projName": "Project name", "projName": "Project name",
@ -502,6 +508,11 @@
"zoomInToViewColumns": "Zoom in to view columns" "zoomInToViewColumns": "Zoom in to view columns"
}, },
"activity": { "activity": {
"bulkDownload": "Bulk Download",
"attachFile": "Attach File",
"viewAttachment": "View Attachments",
"attachmentDrop": "Click or drop a file into cell",
"addFiles": "Add File(s)",
"hideInUI": "Hide in UI", "hideInUI": "Hide in UI",
"addBase": "Add Base", "addBase": "Add Base",
"editBase": "Edit Base", "editBase": "Edit Base",

Loading…
Cancel
Save