Browse Source

change partition warning i18n

tumao 4 years ago
parent
commit
533c069091

+ 1 - 0
client/src/i18n/cn/partition.ts

@@ -15,6 +15,7 @@ const partitionTrans = {
 
 
   deleteWarning:
   deleteWarning:
     'You are trying to delete partition. This action cannot be undone.',
     'You are trying to delete partition. This action cannot be undone.',
+  deletePartitionError: 'default partition cannot be deleted',
 };
 };
 
 
 export default partitionTrans;
 export default partitionTrans;

+ 0 - 4
client/src/i18n/cn/warning.ts

@@ -1,12 +1,8 @@
 const warningTrans = {
 const warningTrans = {
-  closeDialog: '已填写的表单会丢失,确认离开?',
-
   required: '{{name}} is required',
   required: '{{name}} is required',
   positive: '{{name}} should be positive',
   positive: '{{name}} should be positive',
   integer: '{{name}} should be integers',
   integer: '{{name}} should be integers',
   range: 'range is {{min}} ~ {{max}}',
   range: 'range is {{min}} ~ {{max}}',
-
-  deletePartition: 'default partition cannot be deleted',
 };
 };
 
 
 export default warningTrans;
 export default warningTrans;

+ 1 - 0
client/src/i18n/en/partition.ts

@@ -15,6 +15,7 @@ const partitionTrans = {
 
 
   deleteWarning:
   deleteWarning:
     'You are trying to delete partition. This action cannot be undone.',
     'You are trying to delete partition. This action cannot be undone.',
+  deletePartitionError: 'default partition cannot be deleted',
 };
 };
 
 
 export default partitionTrans;
 export default partitionTrans;

+ 0 - 4
client/src/i18n/en/warning.ts

@@ -1,12 +1,8 @@
 const warningTrans = {
 const warningTrans = {
-  closeDialog: 'Will lose your data, are you sure to leave?',
-
   required: '{{name}} is required',
   required: '{{name}} is required',
   positive: '{{name}} should be positive',
   positive: '{{name}} should be positive',
   integer: '{{name}} should be integers',
   integer: '{{name}} should be integers',
   range: 'range is {{min}} ~ {{max}}',
   range: 'range is {{min}} ~ {{max}}',
-
-  deletePartition: 'default partition cannot be deleted',
 };
 };
 
 
 export default warningTrans;
 export default warningTrans;

+ 1 - 2
client/src/pages/partitions/partitions.tsx

@@ -32,7 +32,6 @@ const Partitions: FC<{
   const classes = useStyles();
   const classes = useStyles();
   const { t } = useTranslation('partition');
   const { t } = useTranslation('partition');
   const { t: successTrans } = useTranslation('success');
   const { t: successTrans } = useTranslation('success');
-  const { t: warningTrans } = useTranslation('warning');
   const { t: btnTrans } = useTranslation('btn');
   const { t: btnTrans } = useTranslation('btn');
   const { t: dialogTrans } = useTranslation('dialog');
   const { t: dialogTrans } = useTranslation('dialog');
   const InfoIcon = icons.info;
   const InfoIcon = icons.info;
@@ -154,7 +153,7 @@ const Partitions: FC<{
         selectedPartitions.length === 0 ||
         selectedPartitions.length === 0 ||
         selectedPartitions.some(p => p._name === '_default'),
         selectedPartitions.some(p => p._name === '_default'),
       tooltip: selectedPartitions.some(p => p._name === '_default')
       tooltip: selectedPartitions.some(p => p._name === '_default')
-        ? warningTrans('deletePartition')
+        ? t('deletePartitionError')
         : '',
         : '',
     },
     },
   ];
   ];