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 (messageSize > 4000) return; // TODO magic number
if (isPrivate === null) if (isPrivate === null)
throw new Error( throw new Error(
t('group:message.error.unable_determine_group_private', { t('group:message.error:determine_group_private', {
postProcess: 'capitalizeFirstChar', postProcess: 'capitalizeFirstChar',
}) })
); );

View File

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

View File

@ -12,6 +12,7 @@
"error": { "error": {
"add_to_list": "failed to add to list", "add_to_list": "failed to add to list",
"cancel_sell_order": "failed to Cancel Sell Order. Try again!", "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_sell_order": "failed to Create Sell Order. Try again!",
"create_tradebot": "unable to create tradebot", "create_tradebot": "unable to create tradebot",
"decrypt": "unable to decrypt", "decrypt": "unable to decrypt",
@ -26,7 +27,9 @@
"insufficient_balance_qort": "your QORT balance is insufficient", "insufficient_balance_qort": "your QORT balance is insufficient",
"insufficient_balance": "your asset balance is insufficient", "insufficient_balance": "your asset balance is insufficient",
"insufficient_funds": "insufficient funds", "insufficient_funds": "insufficient funds",
"invalid_receiver": "invalid receiver address or name",
"missing_fields": "missing fields: {{ fields }}", "missing_fields": "missing fields: {{ fields }}",
"name_not_for_sale": "this name is not for sale",
"no_api_found": "no usable API found", "no_api_found": "no usable API found",
"no_data_encrypted_resource": "no data in the encrypted resource", "no_data_encrypted_resource": "no data in the encrypted resource",
"no_data_file_submitted": "no data or file was submitted", "no_data_file_submitted": "no data or file was submitted",
@ -35,6 +38,7 @@
"no_poll": "poll not found", "no_poll": "poll not found",
"perform_request": "failed to perform request", "perform_request": "failed to perform request",
"process_transaction": "unable to process transaction", "process_transaction": "unable to process transaction",
"registered_name": "a registered name is needed to publish",
"retrieve_file": "failed to retrieve file", "retrieve_file": "failed to retrieve file",
"retrieve_keys": "unable to retrieve keys", "retrieve_keys": "unable to retrieve keys",
"submit_sell_order": "failed to submit sell order", "submit_sell_order": "failed to submit sell order",
@ -48,21 +52,28 @@
"include_data_encrypt": "please include data to encrypt", "include_data_encrypt": "please include data to encrypt",
"max_retry_transaction": "max retries reached. Skipping transaction.", "max_retry_transaction": "max retries reached. Skipping transaction.",
"no_action_public_node": "this action cannot be done through a public node", "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", "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_join": "user declined to join group",
"user_declined_list": "user declined to get list of hosted resources", "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 }}", "name": "name: {{ name }}",
"option": "option: {{ option }}", "option": "option: {{ option }}",
"options": "options: {{ optionList }}", "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_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_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_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_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_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_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?", "permission_transfer_asset": "do you give this application permission to transfer the following asset?",
"poll": "poll: {{ name }}", "poll": "poll: {{ name }}",

View File

@ -102,18 +102,18 @@
}, },
"error": { "error": {
"access_name": "impossibile inviare un messaggio senza accesso al tuo nome", "access_name": "impossibile inviare un messaggio senza accesso al tuo nome",
"descrypt_wallet": "errore nella decrittazione del portafoglio {{ :errorMessage }}",
"description_required": "inserisci una descrizione", "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_info": "impossibile accedere alle informazioni del gruppo",
"group_promotion": "error publishing the promotion. Please try again", "group_promotion": "error publishing the promotion. Please try again",
"group_secret_key": "impossibile ottenere la chiave segreta del gruppo", "group_secret_key": "impossibile ottenere la chiave segreta del gruppo",
"minting": "unable to start minting",
"name_required": "inserisci un nome", "name_required": "inserisci un nome",
"notify_admins": "prova a contattare un amministratore dalla lista qui sotto:", "notify_admins": "prova a contattare un amministratore dalla lista qui sotto:",
"qortals_required": "you need at least {{ quantity }} QORT to send a message", "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", "thread_id": "impossibile trovare l'ID della discussione",
"unable_determine_group_private": "unable to determine if group is private", "timeout_reward": "timeout waiting for reward share confirmation"
"unable_minting": "unable to start minting"
}, },
"success": { "success": {
"group_ban": "membro bannato con successo dal gruppo. Potrebbero volerci alcuni minuti affinché le modifiche si propaghino", "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; return true;
} else { } else {
throw new Error( throw new Error(
i18n.t('question:message.generic.user_declined_delete', { i18n.t('question:message.generic.user_declined_delete_hosted_resources', {
postProcess: 'capitalizeFirstChar', postProcess: 'capitalizeFirstChar',
}) })
); );
@ -1083,7 +1083,9 @@ export const getListItems = async (data, isFromExtension) => {
if (!skip) { if (!skip) {
resPermission = await getUserPermission( 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, highlightedText: data.list_name,
checkbox1: { checkbox1: {
value: value, value: value,
@ -1113,7 +1115,11 @@ export const getListItems = async (data, isFromExtension) => {
const list = await response.json(); const list = await response.json();
return list; return list;
} else { } 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; return res;
} else { } 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( const resPermission = await getUserPermission(
{ {
text1: 'Do you give this application permission to', text1: i18n.t('question:permission_remove_from_list', {
text2: `Remove the following from the list ${list_name}:`, name: list_name,
postProcess: 'capitalizeFirstChar',
}),
highlightedText: items ? JSON.stringify(items) : item, highlightedText: items ? JSON.stringify(items) : item,
}, },
isFromExtension isFromExtension
@ -1263,7 +1275,11 @@ export const deleteListItems = async (data, isFromExtension) => {
} }
return res; return res;
} else { } 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( 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}`, text2: `service: ${service}`,
text3: `identifier: ${identifier || null}`, text3: `identifier: ${identifier || null}`,
fee: fee.fee, 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 fee = await getFee('ARBITRARY');
const registeredName = await getNameInfo(); const registeredName = await getNameInfo();
const name = registeredName; const name = registeredName;
if (!name) { 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 appFee = data?.appFee ? +data.appFee : undefined;
const appFeeRecipient = data?.appFeeRecipient; const appFeeRecipient = data?.appFeeRecipient;
@ -1554,7 +1569,9 @@ export const publishMultipleQDNResources = async (
} }
const resPermission = await getUserPermission( 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: ` html: `
<div style="max-height: 30vh; overflow-y: auto;"> <div style="max-height: 30vh; overflow-y: auto;">
<style> <style>
@ -4803,7 +4820,11 @@ export const createAndCopyEmbedLink = async (data, isFromExtension) => {
try { try {
await navigator.clipboard.writeText(link); await navigator.clipboard.writeText(link);
} catch (error) { } catch (error) {
throw new Error('Failed to copy to clipboard.'); throw new Error(
i18n.t('question:message.error.copy_clipboard', {
postProcess: 'capitalizeFirstChar',
})
);
} }
return link; return link;
} }
@ -4822,7 +4843,11 @@ export const createAndCopyEmbedLink = async (data, isFromExtension) => {
try { try {
await navigator.clipboard.writeText(link); await navigator.clipboard.writeText(link);
} catch (error) { } catch (error) {
throw new Error('Failed to copy to clipboard.'); throw new Error(
i18n.t('question:message.error.copy_clipboard', {
postProcess: 'capitalizeFirstChar',
})
);
} }
return link; return link;
@ -5748,7 +5773,12 @@ export const cancelSellNameRequest = async (data, isFromExtension) => {
const response = await fetch(validApi + '/names/' + name); const response = await fetch(validApi + '/names/' + name);
const nameData = await response.json(); 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 fee = await getFee('CANCEL_SELL_NAME');
const resPermission = await getUserPermission( const resPermission = await getUserPermission(
@ -5796,7 +5826,12 @@ export const buyNameRequest = async (data, isFromExtension) => {
const response = await fetch(validApi + '/names/' + name); const response = await fetch(validApi + '/names/' + name);
const nameData = await response.json(); 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 sellerAddress = nameData.owner;
const sellPrice = +nameData.salePrice; const sellPrice = +nameData.salePrice;
@ -5939,7 +5974,11 @@ export const multiPaymentWithPrivateData = async (data, isFromExtension) => {
const confirmReceiver = await getNameOrAddress(payment.recipient); const confirmReceiver = await getNameOrAddress(payment.recipient);
if (confirmReceiver.error) { 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); const receiverPublicKey = await getPublicKey(confirmReceiver);
@ -5972,7 +6011,12 @@ export const multiPaymentWithPrivateData = async (data, isFromExtension) => {
if (!name) { if (!name) {
const getName = await getNameInfo(); 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; name = getName;
} }
@ -5984,7 +6028,11 @@ export const multiPaymentWithPrivateData = async (data, isFromExtension) => {
}) })
); );
if (!arbitraryTx?.service?.includes('_PRIVATE')) 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 || []; const additionalPublicKeys = arbitraryTx?.additionalPublicKeys || [];
pendingTransactions.push({ pendingTransactions.push({
type: 'ARBITRARY', type: 'ARBITRARY',
@ -6021,7 +6069,12 @@ export const multiPaymentWithPrivateData = async (data, isFromExtension) => {
if (!name) { if (!name) {
const getName = await getNameInfo(); 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; name = getName;
} }
@ -6033,7 +6086,11 @@ export const multiPaymentWithPrivateData = async (data, isFromExtension) => {
}) })
); );
if (!arbitraryTx?.service?.includes('_PRIVATE')) 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 || []; const additionalPublicKeys = arbitraryTx?.additionalPublicKeys || [];
pendingAdditionalArbitraryTxs.push({ pendingAdditionalArbitraryTxs.push({
type: 'ARBITRARY', 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(); const balance = await getBalanceInfo();
if (+balance < fee) if (+balance < fee)
@ -6322,7 +6384,11 @@ export const transferAssetRequest = async (data, isFromExtension) => {
); );
const confirmReceiver = await getNameOrAddress(recipient); const confirmReceiver = await getNameOrAddress(recipient);
if (confirmReceiver.error) { 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 assetInfo = await getAssetInfo(assetId);
const resPermission = await getUserPermission( const resPermission = await getUserPermission(