Skip to content

Commit e02a6e2

Browse files
committed
feat: add translations form uploading cover
1 parent e4bf9fe commit e02a6e2

File tree

5 files changed

+12
-0
lines changed

5 files changed

+12
-0
lines changed

src/features/book/manager/form-book-cover.tsx

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,14 @@
11
import { useQuery } from '@tanstack/react-query';
22
import { useUploadFile } from 'better-upload/client';
3+
import { Upload } from 'lucide-react';
34
import { useFormContext, useWatch } from 'react-hook-form';
45
import { useTranslation } from 'react-i18next';
56
import { toast } from 'sonner';
67

78
import { orpc } from '@/lib/orpc/client';
89

10+
import { Button } from '@/components/ui/button';
11+
912
import { BookCover } from '@/features/book/book-cover';
1013
import { FormFieldsBook } from '@/features/book/schema';
1114

@@ -72,6 +75,11 @@ export const FormBookCover = () => {
7275
coverId: uploadedFile?.objectKey ?? coverId,
7376
}}
7477
/>
78+
79+
<span className="absolute top-1/2 left-1/2 z-10 flex origin-center -translate-1/2 cursor-pointer items-center gap-2 rounded bg-white px-2 py-1 text-black">
80+
<Upload size="16" />
81+
{t('book:manager.uploadCover')}
82+
</span>
7583
</label>
7684
</div>
7785
);

src/locales/ar/book.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@
5959
},
6060
"updateError": "فشل في تحديث الكتاب"
6161
},
62+
"uploadCover": "رفع الغلاف",
6263
"uploadErrors": {
6364
"NOT_AUTHENTICATED": "تحتاج إلى تسجيل الدخول لتتمكن من رفع غلاف جديد",
6465
"UNAUTHORIZED": "غير مسموح لك بتغيير غلاف الكتاب",

src/locales/en/book.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@
5959
},
6060
"updateError": "Failed to update a book"
6161
},
62+
"uploadCover": "Upload Cover",
6263
"uploadErrors": {
6364
"NOT_AUTHENTICATED": "You need to be authenticated to be able to upload a new cover",
6465
"UNAUTHORIZED": "You are not allowed to change book cover",

src/locales/fr/book.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@
5959
},
6060
"updateError": "Échec de la modification du livre"
6161
},
62+
"uploadCover": "Modifier",
6263
"uploadErrors": {
6364
"NOT_AUTHENTICATED": "Vous devez être authentifié pour pouvoir télécharger une nouvelle couverture",
6465
"UNAUTHORIZED": "Vous n'êtes pas autorisé à changer la couverture du livre",

src/locales/sw/book.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@
5959
},
6060
"updateError": "Imeshindikana kusasisha kitabu"
6161
},
62+
"uploadCover": "Pakia Jalada",
6263
"uploadErrors": {
6364
"NOT_AUTHENTICATED": "Unahitaji kuwa umeingia ili uweze kupakia jalada jipya",
6465
"UNAUTHORIZED": "Hauruhusiwi kubadilisha jalada la kitabu",

0 commit comments

Comments
 (0)