Add new keys

This commit is contained in:
Nicola Benaglia 2025-05-25 00:15:06 +02:00
parent 7d45e02457
commit 84f7a31f22
10 changed files with 87 additions and 61 deletions

View File

@ -3338,13 +3338,20 @@ function App() {
}} }}
> >
<DialogTitle id="alert-dialog-title"> <DialogTitle id="alert-dialog-title">
{message.paymentFee ? 'Payment' : 'Publish'} {message.paymentFee
? t('core:payment', {
postProcess: 'capitalizeFirstChar',
})
: t('core:publish', {
postProcess: 'capitalizeFirstChar',
})}
</DialogTitle> </DialogTitle>
<DialogContent> <DialogContent>
<DialogContentText id="alert-dialog-description"> <DialogContentText id="alert-dialog-description">
{message.message} {message.message}
</DialogContentText> </DialogContentText>
{message?.paymentFee && ( {message?.paymentFee && (
<DialogContentText id="alert-dialog-description2"> <DialogContentText id="alert-dialog-description2">
{t('core:fee.payment', { {t('core:fee.payment', {
@ -3353,6 +3360,7 @@ function App() {
: {message.paymentFee} : {message.paymentFee}
</DialogContentText> </DialogContentText>
)} )}
{message?.publishFee && ( {message?.publishFee && (
<DialogContentText id="alert-dialog-description2"> <DialogContentText id="alert-dialog-description2">
{t('core:fee.publish', { {t('core:fee.publish', {

View File

@ -1,44 +1,48 @@
import React, { useCallback } from 'react' import React, { useCallback } from 'react';
import { Box } from '@mui/material' import { Box } from '@mui/material';
import { useDropzone, DropzoneRootProps, DropzoneInputProps } from 'react-dropzone' import {
import Compressor from 'compressorjs' useDropzone,
DropzoneRootProps,
DropzoneInputProps,
} from 'react-dropzone';
import Compressor from 'compressorjs';
const toBase64 = (file: File): Promise<string | ArrayBuffer | null> => const toBase64 = (file: File): Promise<string | ArrayBuffer | null> =>
new Promise((resolve, reject) => { new Promise((resolve, reject) => {
const reader = new FileReader() const reader = new FileReader();
reader.readAsDataURL(file) reader.readAsDataURL(file);
reader.onload = () => resolve(reader.result) reader.onload = () => resolve(reader.result);
reader.onerror = (error) => { reader.onerror = (error) => {
reject(error) reject(error);
} };
}) }); // TODO toBase64 seems unused. Remove?
interface ImageUploaderProps { interface ImageUploaderProps {
children: React.ReactNode children: React.ReactNode;
onPick: (file: File) => void onPick: (file: File) => void;
} }
const ImageUploader: React.FC<ImageUploaderProps> = ({ children, onPick }) => { const ImageUploader: React.FC<ImageUploaderProps> = ({ children, onPick }) => {
const onDrop = useCallback( const onDrop = useCallback(
async (acceptedFiles: File[]) => { async (acceptedFiles: File[]) => {
if (acceptedFiles.length > 1) { if (acceptedFiles.length > 1) {
return return;
} }
const image = acceptedFiles[0] const image = acceptedFiles[0];
let compressedFile: File | undefined let compressedFile: File | undefined;
try { try {
// Check if the file is a GIF // Check if the file is a GIF
if (image.type === 'image/gif') { if (image.type === 'image/gif') {
// Check if the GIF is larger than 500 KB // Check if the GIF is larger than 500 KB
if (image.size > 500 * 1024) { if (image.size > 500 * 1024) {
console.error('GIF file size exceeds 500KB limit.') console.error('GIF file size exceeds 500KB limit.');
return return;
} }
// No compression for GIF, pass the original file // No compression for GIF, pass the original file
compressedFile = image compressedFile = image;
} else { } else {
// For non-GIF files, compress them // For non-GIF files, compress them
await new Promise<void>((resolve) => { await new Promise<void>((resolve) => {
@ -48,55 +52,55 @@ const ImageUploader: React.FC<ImageUploaderProps> = ({ children, onPick }) => {
mimeType: 'image/webp', mimeType: 'image/webp',
success(result) { success(result) {
const file = new File([result], image.name, { const file = new File([result], image.name, {
type: 'image/webp' type: 'image/webp',
}) });
compressedFile = file compressedFile = file;
resolve() resolve();
}, },
error(err) { error(err) {
console.error('Compression error:', err) console.error('Compression error:', err);
resolve() // Proceed even if there's an error resolve(); // Proceed even if there's an error
} },
}) });
}) });
} }
if (!compressedFile) return if (!compressedFile) return;
onPick(compressedFile) onPick(compressedFile);
} catch (error) { } catch (error) {
console.error('File processing error:', error) console.error('File processing error:', error);
} }
}, },
[onPick] [onPick]
) );
const { const {
getRootProps, getRootProps,
getInputProps, getInputProps,
isDragActive isDragActive,
}: { }: {
getRootProps: () => DropzoneRootProps getRootProps: () => DropzoneRootProps;
getInputProps: () => DropzoneInputProps getInputProps: () => DropzoneInputProps;
isDragActive: boolean isDragActive: boolean;
} = useDropzone({ } = useDropzone({
onDrop, onDrop,
accept: { accept: {
'image/*': [] 'image/*': [],
} },
}) });
return ( return (
<Box <Box
{...getRootProps()} {...getRootProps()}
sx={{ sx={{
display: 'flex' display: 'flex',
}} }}
> >
<input {...getInputProps()} /> <input {...getInputProps()} />
{children} {children}
</Box> </Box>
) );
} };
export default ImageUploader export default ImageUploader;

View File

@ -7,34 +7,34 @@
} }
.lds-ellipsis { .lds-ellipsis {
display: inline-block; display: inline-block;
height: 80px;
position: relative; position: relative;
width: 80px; width: 80px;
height: 80px;
} }
.lds-ellipsis div { .lds-ellipsis div {
animation-timing-function: cubic-bezier(0, 1, 1, 0);
background: currentColor;
border-radius: 50%;
height: 13.33333px;
position: absolute; position: absolute;
top: 33.33333px; top: 33.33333px;
width: 13.33333px; width: 13.33333px;
height: 13.33333px;
border-radius: 50%;
background: currentColor;
animation-timing-function: cubic-bezier(0, 1, 1, 0);
} }
.lds-ellipsis div:nth-child(1) { .lds-ellipsis div:nth-child(1) {
left: 8px;
animation: lds-ellipsis1 0.6s infinite; animation: lds-ellipsis1 0.6s infinite;
left: 8px;
} }
.lds-ellipsis div:nth-child(2) { .lds-ellipsis div:nth-child(2) {
left: 8px;
animation: lds-ellipsis2 0.6s infinite; animation: lds-ellipsis2 0.6s infinite;
left: 8px;
} }
.lds-ellipsis div:nth-child(3) { .lds-ellipsis div:nth-child(3) {
left: 32px;
animation: lds-ellipsis2 0.6s infinite; animation: lds-ellipsis2 0.6s infinite;
left: 32px;
} }
.lds-ellipsis div:nth-child(4) { .lds-ellipsis div:nth-child(4) {
left: 56px;
animation: lds-ellipsis3 0.6s infinite; animation: lds-ellipsis3 0.6s infinite;
left: 56px;
} }
@keyframes lds-ellipsis1 { @keyframes lds-ellipsis1 {

View File

@ -331,9 +331,11 @@
"previous": "previous" "previous": "previous"
}, },
"payment_notification": "payment notification", "payment_notification": "payment notification",
"payment": "payment",
"poll_embed": "poll embed", "poll_embed": "poll embed",
"port": "port", "port": "port",
"price": "price", "price": "price",
"publish": "publish",
"q_apps": { "q_apps": {
"about": "about this Q-App", "about": "about this Q-App",
"q_mail": "q-mail", "q_mail": "q-mail",

View File

@ -243,13 +243,13 @@
"name_registration": "your balance is {{ balance }} QORT. A name registration requires a {{ fee }} QORT fee", "name_registration": "your balance is {{ balance }} QORT. A name registration requires a {{ fee }} QORT fee",
"name_unavailable": "{{ name }} is unavailable", "name_unavailable": "{{ name }} is unavailable",
"no_data_image": "No hay datos para la imagen", "no_data_image": "No hay datos para la imagen",
"no_description": "Sin descripción", "no_description": "sin descripción",
"no_messages": "Sin mensajes", "no_messages": "sin mensajes",
"no_minting_details": "No se puede ver los detalles de acuñado en la puerta de enlace", "no_minting_details": "No se puede ver los detalles de acuñado en la puerta de enlace",
"no_notifications": "No hay nuevas notificaciones", "no_notifications": "No hay nuevas notificaciones",
"no_payments": "Sin pagos", "no_payments": "sin pagos",
"no_pinned_changes": "Actualmente no tiene ningún cambio en sus aplicaciones fijadas", "no_pinned_changes": "Actualmente no tiene ningún cambio en sus aplicaciones fijadas",
"no_results": "Sin resultados", "no_results": "sin resultados",
"one_app_per_name": "Nota: Actualmente, solo se permite una aplicación y un sitio web por nombre.", "one_app_per_name": "Nota: Actualmente, solo se permite una aplicación y un sitio web por nombre.",
"opened": "abierto", "opened": "abierto",
"overwrite_qdn": "sobrescribir a QDN", "overwrite_qdn": "sobrescribir a QDN",
@ -328,9 +328,11 @@
"previous": "anterior" "previous": "anterior"
}, },
"payment_notification": "notificación de pago", "payment_notification": "notificación de pago",
"payment": "pago",
"poll_embed": "encuesta", "poll_embed": "encuesta",
"port": "puerto", "port": "puerto",
"price": "precio", "price": "precio",
"publish": "publicación",
"q_apps": { "q_apps": {
"about": "Sobre este Q-App", "about": "Sobre este Q-App",
"q_mail": "QAIL", "q_mail": "QAIL",
@ -384,4 +386,4 @@
}, },
"website": "sitio web", "website": "sitio web",
"welcome": "bienvenido" "welcome": "bienvenido"
} }

View File

@ -329,9 +329,11 @@
"previous": "précédent" "previous": "précédent"
}, },
"payment_notification": "Notification de paiement", "payment_notification": "Notification de paiement",
"payment": "paiement",
"poll_embed": "sondage", "poll_embed": "sondage",
"port": "port", "port": "port",
"price": "prix", "price": "prix",
"publish": "publication",
"q_apps": { "q_apps": {
"about": "À propos de ce Q-App", "about": "À propos de ce Q-App",
"q_mail": "Q-mail", "q_mail": "Q-mail",

View File

@ -143,7 +143,7 @@
"downloading_qdn": "download da QDN", "downloading_qdn": "download da QDN",
"fee": { "fee": {
"payment": "commissione di pagamento", "payment": "commissione di pagamento",
"publish": "commissione per pubblicare" "publish": "commissione di pubblicazione"
}, },
"for": "per", "for": "per",
"general": "generale", "general": "generale",
@ -330,10 +330,12 @@
"next": "prossimo", "next": "prossimo",
"previous": "precedente" "previous": "precedente"
}, },
"payment": "pagamento",
"payment_notification": "notifica di pagamento", "payment_notification": "notifica di pagamento",
"poll_embed": "sondaggio incorporato", "poll_embed": "sondaggio incorporato",
"port": "porta", "port": "porta",
"price": "prezzo", "price": "prezzo",
"publish": "pubblicazione",
"q_apps": { "q_apps": {
"about": "su questo Q-app", "about": "su questo Q-app",
"q_mail": "Q-mail", "q_mail": "Q-mail",

View File

@ -328,9 +328,11 @@
"previous": "前の" "previous": "前の"
}, },
"payment_notification": "支払い通知", "payment_notification": "支払い通知",
"payment": "お支払い",
"poll_embed": "投票埋め込み", "poll_embed": "投票埋め込み",
"port": "ポート", "port": "ポート",
"price": "価格", "price": "価格",
"publish": "出版物",
"q_apps": { "q_apps": {
"about": "このq-appについて", "about": "このq-appについて",
"q_mail": "Qメール", "q_mail": "Qメール",
@ -384,4 +386,4 @@
}, },
"website": "Webサイト", "website": "Webサイト",
"welcome": "いらっしゃいませ" "welcome": "いらっしゃいませ"
} }

View File

@ -328,9 +328,11 @@
"previous": "предыдущий" "previous": "предыдущий"
}, },
"payment_notification": "уведомление о платеже", "payment_notification": "уведомление о платеже",
"payment": "плата",
"poll_embed": "Опрос встроен", "poll_embed": "Опрос встроен",
"port": "порт", "port": "порт",
"price": "цена", "price": "цена",
"publish": "публикация",
"q_apps": { "q_apps": {
"about": "об этом Q-App", "about": "об этом Q-App",
"q_mail": "Q-Mail", "q_mail": "Q-Mail",
@ -384,4 +386,4 @@
}, },
"website": "веб -сайт", "website": "веб -сайт",
"welcome": "добро пожаловать" "welcome": "добро пожаловать"
} }

View File

@ -328,6 +328,8 @@
"previous": "以前的" "previous": "以前的"
}, },
"payment_notification": "付款通知", "payment_notification": "付款通知",
"payment": "付款",
"publish": "出版刊物",
"poll_embed": "嵌入民意测验", "poll_embed": "嵌入民意测验",
"port": "港口", "port": "港口",
"price": "价格", "price": "价格",
@ -384,4 +386,4 @@
}, },
"website": "网站", "website": "网站",
"welcome": "欢迎" "welcome": "欢迎"
} }