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"
>
<MaterialSymbolsAttachFile class="transform group-hover:(text-accent scale-120)" />
Attach File
{{ $t('activity.attachFile') }}
</div>
<div class="flex items-center gap-2">
<div v-if="readOnly" class="text-gray-400">[Readonly]</div>
Viewing Attachments of
<div v-if="readOnly" class="text-gray-400">[{{ $t('labels.readOnly') }}]</div>
{{ $t('labels.viewingAttachmentsOf') }}
<div class="font-semibold underline">{{ column?.title }}</div>
</div>
<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>
</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"
>
<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>
</template>
@ -138,7 +140,7 @@ const handleFileDelete = (i: number) => {
/>
<a-tooltip v-if="!readOnly">
<template #title> Remove File </template>
<template #title> {{ $t('title.removeFile') }} </template>
<component
:is="iconMap.closeCircle"
v-if="isSharedForm || (isUIAllowed('dataEdit') && !isPublic && !isLocked)"
@ -148,7 +150,7 @@ const handleFileDelete = (i: number) => {
</a-tooltip>
<a-tooltip placement="bottom">
<template #title> Download File </template>
<template #title> {{ $t('title.downloadFile') }} </template>
<div class="nc-attachment-download group-hover:(opacity-100)">
<component :is="iconMap.download" @click.stop="downloadFile(item)" />
@ -156,7 +158,7 @@ const handleFileDelete = (i: number) => {
</a-tooltip>
<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]">
<component :is="iconMap.edit" @click.stop="renameFile(item, i)" />

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

@ -48,7 +48,7 @@ onMounted(() => {
<template>
<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="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-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"
>
<MaterialSymbolsFileCopyOutline class="text-accent" />
Drop here
{{ $t('labels.dropHere') }}
</general-overlay>
</template>
@ -182,7 +182,7 @@ const rowHeight = inject(RowHeightInj, ref())
<component :is="iconMap.reload" v-if="isLoading" :class="{ 'animate-infinite animate-spin': isLoading }" />
<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">
<MaterialSymbolsAttachFile
@ -192,7 +192,7 @@ const rowHeight = inject(RowHeightInj, ref())
v-if="!visibleItems.length"
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>
</NcTooltip>
@ -258,7 +258,7 @@ const rowHeight = inject(RowHeightInj, ref())
<component :is="iconMap.reload" v-if="isLoading" :class="{ 'animate-infinite animate-spin': isLoading }" />
<NcTooltip v-else placement="bottom">
<template #title> View attachments</template>
<template #title> {{ $t('activity.viewAttachment') }}</template>
<component
:is="iconMap.expand"

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

@ -264,6 +264,8 @@
"displayValue": "Display Value",
"hideAll":"Hide all",
"hideSystemFields": "hideSystemFields",
"removeFile": "Remove File",
"downloadFile": "Download File",
"renameTable": "Rename Table",
"renamingTable": "Renaming Table",
"copyAuthToken": "Copy Auth Token",
@ -331,7 +333,8 @@
"allowAllMimeTypes": "Allow All Mime Types",
"defaultView": "Default View",
"relations": "Relations",
"switchLanguage": "Switch Language"
"switchLanguage": "Switch Language",
"renameFile": "Rename File"
},
"labels": {
"optional": "Optional",
@ -348,6 +351,9 @@
"dataSources": "Data Sources",
"searchProjects": "Search Projects",
"createdBy": "Created By",
"viewingAttachmentsOf": "Viewing Attachments of",
"readOnly": "Readonly",
"dropHere": "Drop here",
"createdOn": "Created On",
"notifyVia": "Notify Via",
"projName": "Project name",
@ -502,6 +508,11 @@
"zoomInToViewColumns": "Zoom in to view columns"
},
"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",
"addBase": "Add Base",
"editBase": "Edit Base",

Loading…
Cancel
Save