compartmentalize alerts translations, add other overlooked translations

This commit is contained in:
rjpeterson 2022-01-18 13:41:14 -06:00
parent 7ca2e6d31f
commit f84c753db7
10 changed files with 69 additions and 37 deletions

View File

@ -21,7 +21,7 @@ const CreateAlertModal: FunctionComponent<CreateAlertModalProps> = ({
isOpen,
onClose,
}) => {
const { t } = useTranslation('common')
const { t } = useTranslation(['common', 'alerts'])
const actions = useMangoStore((s) => s.actions)
const mangoGroup = useMangoStore((s) => s.selectedMangoGroup.current)
const mangoAccount = useMangoStore((s) => s.selectedMangoAccount.current)
@ -51,13 +51,13 @@ const CreateAlertModal: FunctionComponent<CreateAlertModalProps> = ({
async function onCreateAlert() {
if (!email) {
notify({
title: 'An email address is required',
title: t('alerts:email-address-required'),
type: 'error',
})
return
} else if (!health) {
notify({
title: 'Alert health is required',
title: t('alerts:alert-health-required'),
type: 'error',
})
return
@ -96,8 +96,8 @@ const CreateAlertModal: FunctionComponent<CreateAlertModalProps> = ({
<Modal.Header>
<div className="flex items-center justify-between w-full">
<div className="w-20" />
<ElementTitle noMarginBottom>
{t('active-alerts')}
<ElementTitle noMarignBottom>
{t('alerts:active-alerts')}
</ElementTitle>
<Button
className="col-span-1 flex items-center justify-center pt-0 pb-0 h-8 text-xs w-20"
@ -118,7 +118,7 @@ const CreateAlertModal: FunctionComponent<CreateAlertModalProps> = ({
key={`${alert._id}${index}`}
>
<div className="text-th-fgd-1">
{t('alert-info', { health: alert.health })}
{t('alerts:alert-info', { health: alert.health })}
</div>
<TrashIcon
className="cursor-pointer default-transition h-5 text-th-fgd-3 w-5 hover:text-th-primary"
@ -129,16 +129,16 @@ const CreateAlertModal: FunctionComponent<CreateAlertModalProps> = ({
</div>
{activeAlerts.length >= 3 ? (
<div className="mt-1 text-center text-xxs text-th-fgd-3">
{t('alerts-max')}
{t('alerts:alerts-max')}
</div>
) : null}
</>
) : showAlertForm ? (
<>
<div>
<ElementTitle noMarginBottom>{t('create-alert')}</ElementTitle>
<ElementTitle noMarignBottom>{t('alerts:create-alert')}</ElementTitle>
<p className="mt-1 text-center text-th-fgd-4">
{t('alerts-disclaimer')}
{t('alerts:alerts-disclaimer')}
</p>
</div>
{error ? (
@ -158,7 +158,7 @@ const CreateAlertModal: FunctionComponent<CreateAlertModalProps> = ({
<div className="flex items-end mt-4">
<div className="w-full">
<div className="flex justify-between mb-1.5">
<div className="text-th-fgd-1">{t('alert-health')}</div>
<div className="text-th-fgd-1">{t('alerts:alert-health')}</div>
<LinkButton
className="font-normal text-th-fgd-3 text-xs"
onClick={() =>
@ -193,7 +193,7 @@ const CreateAlertModal: FunctionComponent<CreateAlertModalProps> = ({
</div>
<div className="flex items-center mt-6">
<Button onClick={() => onCreateAlert()}>
{t('create-alert')}
{t('alerts:create-alert')}
</Button>
<LinkButton
className="ml-4 text-th-fgd-3 hover:text-th-fgd-1"
@ -216,14 +216,14 @@ const CreateAlertModal: FunctionComponent<CreateAlertModalProps> = ({
) : (
<div>
<Modal.Header>
<ElementTitle noMarginBottom>{t('no-alerts')}</ElementTitle>
<ElementTitle noMarignBottom>{t('alerts:no-alerts')}</ElementTitle>
</Modal.Header>
<p className="mb-4 text-center">{t('no-alerts-desc')}</p>
<p className="mb-4 text-center">{t('alerts:no-alerts-desc')}</p>
<Button
className="flex justify-center m-auto"
onClick={() => setShowAlertForm(true)}
>
{t('new-alert')}
{t('alerts:new-alert')}
</Button>
</div>
)}

View File

@ -214,7 +214,7 @@ export default function AccountOverview() {
</div>
</div>
<div className="flex justify-between pb-4">
<div className="text-th-fgd-1 text-lg">Balances</div>
<div className="text-th-fgd-1 text-lg">{t('balances')}</div>
<Switch
checked={showZeroBalances}
className="text-xs"

View File

@ -0,0 +1,13 @@
{
"active-alerts": "Active Alerts",
"alert-health": "Alert when health is below",
"alert-health-required": "Alert health is required",
"alert-info": "Email when health <= {{health}}%",
"alerts-disclaimer": "Do not rely solely on alerts to protect your account. We can't guarantee they will be delivered.",
"alerts-max": "You've reached the maximum number of active alerts.",
"create-alert": "Create Alert",
"email-address-required": "An email address is required",
"new-alert": "New Alert",
"no-alerts": "No Active Alerts",
"no-alerts-desc": "Create an alert to be notified when your account health is low."
}

View File

@ -19,7 +19,6 @@
"account-risk": "Account Risk",
"account-value": "Account Value",
"accounts": "Accounts",
"active-alerts": "Active Alerts",
"add-more-sol": "Add more SOL to your wallet to avoid failed transactions.",
"add-name": "Add Name",
"alert-health": "Alert when health is below",
@ -90,7 +89,6 @@
"country-not-allowed": "Country Not Allowed",
"country-not-allowed-tooltip": "You are using an open-source frontend facilitated by the Mango DAO. As such, it restricts access to certain regions out of an abundance of caution, due to regulatory uncertainty.",
"create-account": "Create Account",
"create-alert": "Create Alert",
"current-stats": "Current Stats",
"custom": "Custom",
"daily-change": "Daily Change",
@ -235,12 +233,9 @@
"net-interest-value-desc": "Calculated at the time it was earned/paid. This might be useful at tax time.",
"new": "New",
"new-account": "New",
"new-alert": "New Alert",
"next": "Next",
"no-account-found": "No Account Found",
"no-address": "No {{tokenSymbol}} wallet address found",
"no-alerts": "No Active Alerts",
"no-alerts-desc": "Create an alert to be notified when your account health is low.",
"no-balances": "No balances",
"no-borrows": "No borrows found.",
"no-funding": "No funding earned or paid",

View File

@ -0,0 +1,13 @@
{
"active-alerts": "Active Alerts",
"alert-health": "Alert when health is below",
"alert-health-required": "Alert health is required",
"alert-info": "Email when health <= {{health}}%",
"alerts-disclaimer": "Do not rely solely on alerts to protect your account. We can't guarantee they will be delivered.",
"alerts-max": "You've reached the maximum number of active alerts.",
"create-alert": "Create Alert",
"email-address-required": "An email address is required",
"new-alert": "New Alert",
"no-alerts": "No Active Alerts",
"no-alerts-desc": "Create an alert to be notified when your account health is low."
}

View File

@ -19,7 +19,6 @@
"account-risk": "Riesgo de cuenta",
"account-value": "Valor de la cuenta",
"accounts": "Cuentas",
"active-alerts": "Active Alerts",
"add-more-sol": "Add more SOL to your wallet to avoid failed transactions.",
"add-name": "Añadir nombre",
"alert-health": "Alert when health is below",
@ -90,7 +89,6 @@
"country-not-allowed": "País no permitido",
"country-not-allowed-tooltip": "You are using an open-source frontend facilitated by the Mango DAO. As such, it restricts access to certain regions out of an abundance of caution, due to regulatory uncertainty.",
"create-account": "Create Account",
"create-alert": "Create Alert",
"current-stats": "Estadísticas actuales",
"custom": "Personalizada",
"daily-change": "Cambio diario",
@ -235,12 +233,9 @@
"net-interest-value-desc": "Calculado en el momento en que se ganó / pagó. Esto podría ser útil al momento de impuestos.",
"new": "Nuevo",
"new-account": "Nuevo",
"new-alert": "New Alert",
"next": "Próximo",
"no-account-found": "No Account Found",
"no-address": "No ${tokenSymbol} dirección de billetera encontrada",
"no-alerts": "No Active Alerts",
"no-alerts-desc": "Create an alert to be notified when your account health is low.",
"no-balances": "Sin saldos",
"no-borrows": "No se encontraron préstamos.",
"no-funding": "Sin fondos ganados / pagados",

View File

@ -0,0 +1,13 @@
{
"active-alerts": "活动警报",
"alert-health": "健康度低于什么程度发警告?",
"alert-health-required": "您必须输入警报健康",
"alert-info": "健康度在{{health}}%以下时发电子邮件",
"alerts-disclaimer": "请别全靠警报来保护资产。我们无法保证会准时发出。",
"alerts-max": "您已达到警报数量最多限制",
"create-alert": "创建警报",
"email-address-required": "您必须输入电子邮件地址",
"new-alert": "创建警报",
"no-alerts": "您没有活动警报",
"no-alerts-desc": "以创建警报而收到健康度通知。"
}

View File

@ -19,7 +19,6 @@
"account-risk": "帐户风险度",
"account-value": "帐户价值",
"accounts": "帐户",
"active-alerts": "活动警报",
"add-more-sol": "为了避免交易出错请给被连结的钱包多存入一点SOL。",
"add-name": "加标签",
"alerts": "警报",
@ -90,7 +89,6 @@
"country-not-allowed": "您的国家不允许",
"country-not-allowed-tooltip": "您正在使用MangoDAO提供的开源介面。由于监管的不确定性因此处于谋些地区的人的行动会受到限制。",
"create-account": "创建帐户",
"create-alert": "创建警报",
"current-stats": "当前统计",
"custom": "自定义",
"daily-change": "24小时变动",
@ -210,7 +208,7 @@
"markets": "市场",
"max": "最多",
"max-borrow": "最多借贷数量",
"max-depth-bps": "最大深度Bps",
"max-depth-bps": "最大深度bps",
"max-slippage": "最多滑移",
"max-with-borrow": "借用最大值",
"minutes": "分钟",
@ -235,12 +233,9 @@
"net-interest-value-desc": "利息是以获取/付出时价值来计算的。纳税时这也许会有用。",
"new": "新子帐户",
"new-account": "新子帐户",
"new-alert": "创建警报",
"next": "前往",
"no-account-found": "您没有帐户",
"no-address": "没有{{tokenSymbol}}钱包地址",
"no-alerts": "您没有活动警报",
"no-alerts-desc": "创建警报而健康度低时被通知到。",
"no-balances": "您没有余额",
"no-borrows": "您没有借贷。",
"no-funding": "您未收/付过资金费",

View File

@ -0,0 +1,13 @@
{
"active-alerts": "活動警報",
"alert-health": "健康度低於甚麼程度發警告?",
"alert-health-required": "您必須輸入警報健康",
"alert-info": "健康度在{{health}}%以下時發電子郵件",
"alerts-disclaimer": "請別全靠警報來保護資產。我們無法保證會準時發出。",
"alerts-max": "您已達到警報數量最多限制",
"create-alert": "創建警報",
"email-address-required": "您必須輸入電子郵件地址",
"new-alert": "創建警報",
"no-alerts": "您沒有活動警報",
"no-alerts-desc": "以創建警報而收到健康度通知。"
}

View File

@ -19,7 +19,6 @@
"account-risk": "帳戶風險度",
"account-value": "帳戶價值",
"accounts": "帳戶",
"active-alerts": "活動警報",
"add-more-sol": "為了避免交易出錯請給被連結的錢包多存入一點SOL。",
"add-name": "加標籤",
"alerts": "警報",
@ -90,7 +89,6 @@
"country-not-allowed": "您的國家不允許",
"country-not-allowed-tooltip": "您正在使用MangoDAO提供的開源介面。由於監管的不確定性因此處於謀些地區的人的行動會受到限制。",
"create-account": "創建帳戶",
"create-alert": "創建警報",
"current-stats": "當前統計",
"custom": "自定義",
"daily-change": "24小時變動",
@ -210,7 +208,7 @@
"markets": "市場",
"max": "最多",
"max-borrow": "最多借貸數量",
"max-depth-bps": "最大深度Bps",
"max-depth-bps": "最大深度bps",
"max-slippage": "最多滑移",
"max-with-borrow": "借用最大值",
"minutes": "分鐘",
@ -235,12 +233,9 @@
"net-interest-value-desc": "利息是以獲取/付出時價值來計算的。納稅時這也許會有用。",
"new": "新子帳戶",
"new-account": "新子帳戶",
"new-alert": "創建警報",
"next": "前往",
"no-account-found": "您沒有帳戶",
"no-address": "沒有{{tokenSymbol}}錢包地址",
"no-alerts": "您沒有活動警報",
"no-alerts-desc": "創建警報而健康度低時被通知到。",
"no-balances": "您沒有餘額",
"no-borrows": "您沒有借貸。",
"no-funding": "您未收/付過資金費",