Skip to content

Commit

Permalink
refactor: change queue actions confirm locale
Browse files Browse the repository at this point in the history
  • Loading branch information
felixmosh committed Sep 15, 2024
1 parent 6ffff3b commit 4a7873f
Show file tree
Hide file tree
Showing 5 changed files with 39 additions and 36 deletions.
12 changes: 6 additions & 6 deletions packages/ui/src/hooks/useQueues.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,42 +69,42 @@ export function useQueues(): Omit<QueuesState, 'updateQueues'> & { actions: Queu
const retryAll = (queueName: string, status: JobRetryStatus) =>
withConfirmAndUpdate(
() => api.retryAll(queueName, status),
t('QUEUE.ACTIONS.RETRY_ALL_CONFIRM_MSG', { status }),
t('QUEUE.ACTIONS.CONFIRM.RETRY_ALL', { status }),
confirmQueueActions
);

const promoteAll = (queueName: string) =>
withConfirmAndUpdate(
() => api.promoteAll(queueName),
t('QUEUE.ACTIONS.PROMOTE_ALL_CONFIRM_MSG'),
t('QUEUE.ACTIONS.CONFIRM.PROMOTE_ALL'),
confirmQueueActions
);

const cleanAll = (queueName: string, status: JobCleanStatus) =>
withConfirmAndUpdate(
() => api.cleanAll(queueName, status),
t('QUEUE.ACTIONS.CLEAN_ALL_CONFIRM_MSG', { status }),
t('QUEUE.ACTIONS.CONFIRM.CLEAN_ALL', { status }),
confirmQueueActions
);

const pauseQueue = (queueName: string) =>
withConfirmAndUpdate(
() => api.pauseQueue(queueName),
t('QUEUE.ACTIONS.PAUSE_QUEUE_CONFIRM_MSG'),
t('QUEUE.ACTIONS.CONFIRM.PAUSE_QUEUE'),
confirmQueueActions
);

const resumeQueue = (queueName: string) =>
withConfirmAndUpdate(
() => api.resumeQueue(queueName),
t('QUEUE.ACTIONS.RESUME_QUEUE_CONFIRM_MSG'),
t('QUEUE.ACTIONS.CONFIRM.RESUME_QUEUE'),
confirmQueueActions
);

const emptyQueue = (queueName: string) =>
withConfirmAndUpdate(
() => api.emptyQueue(queueName),
t('QUEUE.ACTIONS.EMPTY_QUEUE_CONFIRM_MSG'),
t('QUEUE.ACTIONS.CONFIRM.EMPTY_QUEUE'),
confirmQueueActions
);

Expand Down
21 changes: 9 additions & 12 deletions packages/ui/src/static/locales/en-US/messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -62,12 +62,14 @@
"PAUSE": "Pause",
"EMPTY": "Empty",
"ADD_JOB": "Add job",
"RETRY_ALL_CONFIRM_MSG": "Are you sure that you want to retry all {{status}} jobs?",
"CLEAN_ALL_CONFIRM_MSG": "Are you sure that you want to clean all {{status}} jobs?",
"PROMOTE_ALL_CONFIRM_MSG": "Are you sure that you want to promote all delayed jobs?",
"PAUSE_QUEUE_CONFIRM_MSG": "Are you sure that you want to pause queue processing?",
"EMPTY_QUEUE_CONFIRM_MSG": "Are you sure that you want to empty the queue?",
"RESUME_QUEUE_CONFIRM_MSG": "Are you sure that you want to resume queue processing?"
"CONFIRM": {
"RETRY_ALL": "Are you sure that you want to retry all {{status}} jobs?",
"CLEAN_ALL": "Are you sure that you want to clean all {{status}} jobs?",
"PROMOTE_ALL": "Are you sure that you want to promote all delayed jobs?",
"PAUSE_QUEUE": "Are you sure that you want to pause queue processing?",
"EMPTY_QUEUE": "Are you sure that you want to empty the queue?",
"RESUME_QUEUE": "Are you sure that you want to resume queue processing?"
}
},
"STATUS": {
"LATEST": "Latest",
Expand All @@ -84,12 +86,7 @@
"CONFIRM": {
"DEFAULT_TITLE": "Are you sure?",
"CONFIRM_BTN": "Confirm",
"CANCEL_BTN": "Cancel",
"JOB": {
"PROMOTE": "Are you sure that you want to promote this job?",
"RETRY": "Are you sure that you want to retry this job?",
"CLEAN": "Are you sure that you want to clean this job?"
}
"CANCEL_BTN": "Cancel"
},
"MODAL": {
"CLOSE_BTN": "Close"
Expand Down
14 changes: 8 additions & 6 deletions packages/ui/src/static/locales/fr-FR/messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -64,12 +64,14 @@
"PAUSE": "Pause",
"EMPTY": "Vider",
"ADD_JOB": "Ajouter une tâche",
"RETRY_ALL_CONFIRM_MSG": "Êtes-vous sûr de vouloir réessayer toutes les tâches {{status}} ?",
"CLEAN_ALL_CONFIRM_MSG": "Êtes-vous sûr de vouloir supprimer toutes les tâches {{status}} ?",
"PROMOTE_ALL_CONFIRM_MSG": "Êtes-vous sûr de vouloir promouvoir toutes les tâches retardées ?",
"PAUSE_QUEUE_CONFIRM_MSG": "Êtes-vous sûr de vouloir mettre en pause le traitement de la file ?",
"EMPTY_QUEUE_CONFIRM_MSG": "Êtes-vous sûr de vouloir vider la file ?",
"RESUME_QUEUE_CONFIRM_MSG": "Êtes-vous sûr de vouloir reprendre le traitement de la file ?"
"CONFIRM": {
"RETRY_ALL": "Êtes-vous sûr de vouloir réessayer toutes les tâches {{status}} ?",
"CLEAN_ALL": "Êtes-vous sûr de vouloir supprimer toutes les tâches {{status}} ?",
"PROMOTE_ALL": "Êtes-vous sûr de vouloir promouvoir toutes les tâches retardées ?",
"PAUSE_QUEUE": "Êtes-vous sûr de vouloir mettre en pause le traitement de la file ?",
"EMPTY_QUEUE": "Êtes-vous sûr de vouloir vider la file ?",
"RESUME_QUEUE": "Êtes-vous sûr de vouloir reprendre le traitement de la file ?"
}
},
"STATUS": {
"LATEST": "Dernières",
Expand Down
14 changes: 8 additions & 6 deletions packages/ui/src/static/locales/pt-BR/messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -64,12 +64,14 @@
"PAUSE": "Pausar",
"EMPTY": "Limpar",
"ADD_JOB": "Adicionar trabalho",
"RETRY_ALL_CONFIRM_MSG": "Deseja realmente reprocessar todos as {{status}} tarefas?",
"CLEAN_ALL_CONFIRM_MSG": "Deseja realmente limpar todos as {{status}} tarefas?",
"PROMOTE_ALL_CONFIRM_MSG": "Deseja realmente promover todas as tarefas atrasadas?",
"PAUSE_QUEUE_CONFIRM_MSG": "Deseja realmente pausar o processamento da fila?",
"EMPTY_QUEUE_CONFIRM_MSG": "Deseja realmente limpar a fila?",
"RESUME_QUEUE_CONFIRM_MSG": "Deseja realmente retomar o processamento da fila?"
"CONFIRM": {
"RETRY_ALL": "Deseja realmente reprocessar todos as {{status}} tarefas?",
"CLEAN_ALL": "Deseja realmente limpar todos as {{status}} tarefas?",
"PROMOTE_ALL": "Deseja realmente promover todas as tarefas atrasadas?",
"PAUSE_QUEUE": "Deseja realmente pausar o processamento da fila?",
"EMPTY_QUEUE": "Deseja realmente limpar a fila?",
"RESUME_QUEUE": "Deseja realmente retomar o processamento da fila?"
}
},
"STATUS": {
"LATEST": "Mais recente",
Expand Down
14 changes: 8 additions & 6 deletions packages/ui/src/static/locales/zh-CN/messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -61,12 +61,14 @@
"PAUSE": "暂停",
"EMPTY": "清空",
"ADD_JOB": "添加作业",
"RETRY_ALL_CONFIRM_MSG": "您确定要重试所有{{status}}作业吗?",
"CLEAN_ALL_CONFIRM_MSG": "您确定要清理所有{{status}}作业吗?",
"PROMOTE_ALL_CONFIRM_MSG": "您确定要提升所有延迟作业吗?",
"PAUSE_QUEUE_CONFIRM_MSG": "您确定要暂停队列处理吗?",
"EMPTY_QUEUE_CONFIRM_MSG": "您确定要清空队列吗?",
"RESUME_QUEUE_CONFIRM_MSG": "您确定要恢复队列处理吗?"
"CONFIRM": {
"RETRY_ALL": "您确定要重试所有{{status}}作业吗?",
"CLEAN_ALL": "您确定要清理所有{{status}}作业吗?",
"PROMOTE_ALL": "您确定要提升所有延迟作业吗?",
"PAUSE_QUEUE": "您确定要暂停队列处理吗?",
"EMPTY_QUEUE": "您确定要清空队列吗?",
"RESUME_QUEUE": "您确定要恢复队列处理吗?"
}
},
"STATUS": {
"LATEST": "最新",
Expand Down

0 comments on commit 4a7873f

Please sign in to comment.