Add translations

This commit is contained in:
Nicola Benaglia 2025-05-23 08:04:52 +02:00
parent 45925b8879
commit 1f9f1dfe28
5 changed files with 113 additions and 36 deletions

View File

@ -798,7 +798,7 @@ export const ChatGroup = ({
if (messageSize > 4000) return; // TODO magic number
if (isPrivate === null)
throw new Error(
t('group:message.error.unable_determine_group_private', {
t('group:message.error:determine_group_private', {
postProcess: 'capitalizeFirstChar',
})
);

View File

@ -428,7 +428,7 @@ export const Minting = ({ setIsOpenMinting, myAddress, show }) => {
type: 'error',
message:
error?.message ||
t('group:message.error.unable_minting', {
t('group:message.error:minting', {
postProcess: 'capitalizeFirstChar',
}),
});

View File

@ -12,6 +12,7 @@
"error": {
"add_to_list": "failed to add to list",
"cancel_sell_order": "failed to Cancel Sell Order. Try again!",
"copy_clipboard": "failed to copy to clipboard",
"create_sell_order": "failed to Create Sell Order. Try again!",
"create_tradebot": "unable to create tradebot",
"decrypt": "unable to decrypt",
@ -26,7 +27,9 @@
"insufficient_balance_qort": "your QORT balance is insufficient",
"insufficient_balance": "your asset balance is insufficient",
"insufficient_funds": "insufficient funds",
"invalid_receiver": "invalid receiver address or name",
"missing_fields": "missing fields: {{ fields }}",
"name_not_for_sale": "this name is not for sale",
"no_api_found": "no usable API found",
"no_data_encrypted_resource": "no data in the encrypted resource",
"no_data_file_submitted": "no data or file was submitted",
@ -35,6 +38,7 @@
"no_poll": "poll not found",
"perform_request": "failed to perform request",
"process_transaction": "unable to process transaction",
"registered_name": "a registered name is needed to publish",
"retrieve_file": "failed to retrieve file",
"retrieve_keys": "unable to retrieve keys",
"submit_sell_order": "failed to submit sell order",
@ -48,21 +52,28 @@
"include_data_encrypt": "please include data to encrypt",
"max_retry_transaction": "max retries reached. Skipping transaction.",
"no_action_public_node": "this action cannot be done through a public node",
"private_service": "please use a private service",
"provide_group_id": "please provide a groupId",
"user_declined_delete": "user declined delete hosted resources",
"user_declined_add_list": "user declined add to list",
"user_declined_delete_from_list": "User declined delete from list",
"user_declined_delete_hosted_resources": "user declined delete hosted resources",
"user_declined_join": "user declined to join group",
"user_declined_list": "user declined to get list of hosted resources",
"user_declined_request": "user declined request"
"user_declined_request": "user declined request",
"user_declined_share_list": "user declined to share list"
}
},
"name": "name: {{ name }}",
"option": "option: {{ option }}",
"options": "options: {{ optionList }}",
"permission_access_list": "do you give this application permission to access the list",
"permission_all_item_list": "do you give this application permission to add the following to the list {{ name }}:",
"permission_authenticate": "do you give this application permission to authenticate?",
"permission_list_hosted_data": "do you give this application permission to get a list of your hosted data?",
"permission_delete_hosts_resources": "do you give this application permission to delete {{ size }} hosted resources?",
"permission_pay_publish": "do you give this application permission to make the following payments and publishes?",
"permission_publish_qdn": "do you give this application permission to publish to QDN?",
"permission_remove_from_list": "do you give this application permission to remove the following from the list {{ name }}:",
"permission_send_coins": "do you give this application permission to send coins?",
"permission_transfer_asset": "do you give this application permission to transfer the following asset?",
"poll": "poll: {{ name }}",

View File

@ -102,18 +102,18 @@
},
"error": {
"access_name": "impossibile inviare un messaggio senza accesso al tuo nome",
"descrypt_wallet": "errore nella decrittazione del portafoglio {{ :errorMessage }}",
"description_required": "inserisci una descrizione",
"descrypt_wallet": "errore nella decrittazione del portafoglio {{ :errorMessage }}",
"determine_group_private": "unable to determine if group is private",
"group_info": "impossibile accedere alle informazioni del gruppo",
"group_promotion": "error publishing the promotion. Please try again",
"group_secret_key": "impossibile ottenere la chiave segreta del gruppo",
"minting": "unable to start minting",
"name_required": "inserisci un nome",
"notify_admins": "prova a contattare un amministratore dalla lista qui sotto:",
"qortals_required": "you need at least {{ quantity }} QORT to send a message",
"timeout_reward": "timeout waiting for reward share confirmation",
"thread_id": "impossibile trovare l'ID della discussione",
"unable_determine_group_private": "unable to determine if group is private",
"unable_minting": "unable to start minting"
"timeout_reward": "timeout waiting for reward share confirmation"
},
"success": {
"group_ban": "membro bannato con successo dal gruppo. Potrebbero volerci alcuni minuti affinché le modifiche si propaghino",

View File

@ -996,7 +996,7 @@ export const deleteHostedData = async (data, isFromExtension) => {
return true;
} else {
throw new Error(
i18n.t('question:message.generic.user_declined_delete', {
i18n.t('question:message.generic.user_declined_delete_hosted_resources', {
postProcess: 'capitalizeFirstChar',
})
);
@ -1083,7 +1083,9 @@ export const getListItems = async (data, isFromExtension) => {
if (!skip) {
resPermission = await getUserPermission(
{
text1: 'Do you give this application permission to access the list',
text1: i18n.t('question:permission_access_list', {
postProcess: 'capitalizeFirstChar',
}),
highlightedText: data.list_name,
checkbox1: {
value: value,
@ -1113,7 +1115,11 @@ export const getListItems = async (data, isFromExtension) => {
const list = await response.json();
return list;
} else {
throw new Error('User declined to share list');
throw new Error(
i18n.t('question:message.generic.user_declined_share_list', {
postProcess: 'capitalizeFirstChar',
})
);
}
};
@ -1185,7 +1191,11 @@ export const addListItems = async (data, isFromExtension) => {
}
return res;
} else {
throw new Error('User declined add to list');
throw new Error(
i18n.t('question:message.generic.user_declined_add_list', {
postProcess: 'capitalizeFirstChar',
})
);
}
};
@ -1227,8 +1237,10 @@ export const deleteListItems = async (data, isFromExtension) => {
const resPermission = await getUserPermission(
{
text1: 'Do you give this application permission to',
text2: `Remove the following from the list ${list_name}:`,
text1: i18n.t('question:permission_remove_from_list', {
name: list_name,
postProcess: 'capitalizeFirstChar',
}),
highlightedText: items ? JSON.stringify(items) : item,
},
isFromExtension
@ -1263,7 +1275,11 @@ export const deleteListItems = async (data, isFromExtension) => {
}
return res;
} else {
throw new Error('User declined delete from list');
throw new Error(
i18n.t('question:message.generic.user_declined_delete_from_list', {
postProcess: 'capitalizeFirstChar',
})
);
}
};
@ -1390,7 +1406,9 @@ export const publishQDNResource = async (
}
const resPermission = await getUserPermission(
{
text1: 'Do you give this application permission to publish to QDN?',
text1: i18n.t('question:permission_publish_qdn', {
postProcess: 'capitalizeFirstChar',
}),
text2: `service: ${service}`,
text3: `identifier: ${identifier || null}`,
fee: fee.fee,
@ -1519,18 +1537,15 @@ export const publishMultipleQDNResources = async (
}
}
// if (
// data.encrypt &&
// (!data.publicKeys ||
// (Array.isArray(data.publicKeys) && data.publicKeys.length === 0))
// ) {
// throw new Error("Encrypting data requires public keys");
// }
const fee = await getFee('ARBITRARY');
const registeredName = await getNameInfo();
const name = registeredName;
if (!name) {
throw new Error('You need a Qortal name to publish.');
throw new Error(
i18n.t('question:message.error.registered_name', {
postProcess: 'capitalizeFirstChar',
})
);
}
const appFee = data?.appFee ? +data.appFee : undefined;
const appFeeRecipient = data?.appFeeRecipient;
@ -1554,7 +1569,9 @@ export const publishMultipleQDNResources = async (
}
const resPermission = await getUserPermission(
{
text1: 'Do you give this application permission to publish to QDN?',
text1: i18n.t('question:permission_publish_qdn', {
postProcess: 'capitalizeFirstChar',
}),
html: `
<div style="max-height: 30vh; overflow-y: auto;">
<style>
@ -4803,7 +4820,11 @@ export const createAndCopyEmbedLink = async (data, isFromExtension) => {
try {
await navigator.clipboard.writeText(link);
} catch (error) {
throw new Error('Failed to copy to clipboard.');
throw new Error(
i18n.t('question:message.error.copy_clipboard', {
postProcess: 'capitalizeFirstChar',
})
);
}
return link;
}
@ -4822,7 +4843,11 @@ export const createAndCopyEmbedLink = async (data, isFromExtension) => {
try {
await navigator.clipboard.writeText(link);
} catch (error) {
throw new Error('Failed to copy to clipboard.');
throw new Error(
i18n.t('question:message.error.copy_clipboard', {
postProcess: 'capitalizeFirstChar',
})
);
}
return link;
@ -5748,7 +5773,12 @@ export const cancelSellNameRequest = async (data, isFromExtension) => {
const response = await fetch(validApi + '/names/' + name);
const nameData = await response.json();
if (!nameData?.isForSale) throw new Error('This name is not for sale');
if (!nameData?.isForSale)
throw new Error(
i18n.t('question:message.error.name_not_for_sale', {
postProcess: 'capitalizeFirstChar',
})
);
const fee = await getFee('CANCEL_SELL_NAME');
const resPermission = await getUserPermission(
@ -5796,7 +5826,12 @@ export const buyNameRequest = async (data, isFromExtension) => {
const response = await fetch(validApi + '/names/' + name);
const nameData = await response.json();
if (!nameData?.isForSale) throw new Error('This name is not for sale');
if (!nameData?.isForSale)
throw new Error(
i18n.t('question:message.error.name_not_for_sale', {
postProcess: 'capitalizeFirstChar',
})
);
const sellerAddress = nameData.owner;
const sellPrice = +nameData.salePrice;
@ -5939,7 +5974,11 @@ export const multiPaymentWithPrivateData = async (data, isFromExtension) => {
const confirmReceiver = await getNameOrAddress(payment.recipient);
if (confirmReceiver.error) {
throw new Error('Invalid receiver address or name');
throw new Error(
i18n.t('question:message.error.invalid_receiver', {
postProcess: 'capitalizeFirstChar',
})
);
}
const receiverPublicKey = await getPublicKey(confirmReceiver);
@ -5972,7 +6011,12 @@ export const multiPaymentWithPrivateData = async (data, isFromExtension) => {
if (!name) {
const getName = await getNameInfo();
if (!getName) throw new Error('Name needed to publish');
if (!getName)
throw new Error(
i18n.t('question:message.error.registered_name', {
postProcess: 'capitalizeFirstChar',
})
);
name = getName;
}
@ -5984,7 +6028,11 @@ export const multiPaymentWithPrivateData = async (data, isFromExtension) => {
})
);
if (!arbitraryTx?.service?.includes('_PRIVATE'))
throw new Error('Please use a PRIVATE service');
throw new Error(
i18n.t('question:message.generic.private_service', {
postProcess: 'capitalizeFirstChar',
})
);
const additionalPublicKeys = arbitraryTx?.additionalPublicKeys || [];
pendingTransactions.push({
type: 'ARBITRARY',
@ -6021,7 +6069,12 @@ export const multiPaymentWithPrivateData = async (data, isFromExtension) => {
if (!name) {
const getName = await getNameInfo();
if (!getName) throw new Error('Name needed to publish');
if (!getName)
throw new Error(
i18n.t('question:message.error.registered_name', {
postProcess: 'capitalizeFirstChar',
})
);
name = getName;
}
@ -6033,7 +6086,11 @@ export const multiPaymentWithPrivateData = async (data, isFromExtension) => {
})
);
if (!arbitraryTx?.service?.includes('_PRIVATE'))
throw new Error('Please use a PRIVATE service');
throw new Error(
i18n.t('question:message.generic.private_service', {
postProcess: 'capitalizeFirstChar',
})
);
const additionalPublicKeys = arbitraryTx?.additionalPublicKeys || [];
pendingAdditionalArbitraryTxs.push({
type: 'ARBITRARY',
@ -6048,7 +6105,12 @@ export const multiPaymentWithPrivateData = async (data, isFromExtension) => {
}
}
if (!name) throw new Error('A name is needed to publish');
if (!name)
throw new Error(
i18n.t('question:message.error.registered_name', {
postProcess: 'capitalizeFirstChar',
})
);
const balance = await getBalanceInfo();
if (+balance < fee)
@ -6322,7 +6384,11 @@ export const transferAssetRequest = async (data, isFromExtension) => {
);
const confirmReceiver = await getNameOrAddress(recipient);
if (confirmReceiver.error) {
throw new Error('Invalid receiver address or name');
throw new Error(
i18n.t('question:message.error.invalid_receiver', {
postProcess: 'capitalizeFirstChar',
})
);
}
const assetInfo = await getAssetInfo(assetId);
const resPermission = await getUserPermission(