فهرست منبع

[frontend] i18n changes and improvements

Nidhi Bhat G 1 سال پیش
والد
کامیت
adecbc963b

+ 1 - 1
desktop/core/src/desktop/js/apps/storageBrowser/InputModal/InputModal.scss

@@ -25,7 +25,7 @@
   }
 
   .hue-input-modal__input {
-    height: 32px;
+    height: vars.$fluidx-spacing-l;
   }
 }
 

+ 4 - 6
desktop/core/src/desktop/js/apps/storageBrowser/InputModal/InputModal.tsx

@@ -16,7 +16,6 @@
 import React, { useState } from 'react';
 import Modal from 'cuix/dist/components/Modal';
 import { Input } from 'antd';
-import { i18nReact } from '../../../utils/i18nReact';
 
 import './InputModal.scss';
 
@@ -44,14 +43,13 @@ const InputModal: React.FC<InputModalProps> = ({
   showModal,
   title
 }): JSX.Element => {
-  const { t } = i18nReact.useTranslation();
   const [textInput, setTextInput] = useState<string>('');
 
   return (
     <Modal
-      cancelText={t(cancelText)}
+      cancelText={cancelText}
       className="hue-input-modal"
-      okText={t(okText)}
+      okText={okText}
       onCancel={() => {
         setTextInput('');
         onClose();
@@ -62,9 +60,9 @@ const InputModal: React.FC<InputModalProps> = ({
         onClose();
       }}
       open={showModal}
-      title={t(title)}
+      title={title}
     >
-      <div className="hue-input-modal__input-label">{t(inputLabel)}</div>
+      <div className="hue-input-modal__input-label">{inputLabel}</div>
       <Input
         className="hue-input-modal__input"
         value={textInput}

+ 8 - 8
desktop/core/src/desktop/js/apps/storageBrowser/StorageBrowserPage/StorageBrowserTabContents/StorageBrowserTabContent.tsx

@@ -252,20 +252,20 @@ const StorageBrowserTabContent: React.FC<StorageBrowserTabContentProps> = ({
           sortOrder={sortOrder}
         />
         <InputModal
-          title={'Create New Folder'}
-          inputLabel={'Enter folder name here'}
-          okText={'Create'}
+          title={t('Create New Folder')}
+          inputLabel={t('Enter folder name here')}
+          okText={t('Create')}
           showModal={showNewFolderModal}
           onCreate={handleCreateNewFolder}
-          onClose={() => setShowNewFolderModal(!showNewFolderModal)}
+          onClose={() => setShowNewFolderModal(false)}
         />
         <InputModal
-          title={'Create New File'}
-          inputLabel={'Enter file name here'}
-          okText={'Create'}
+          title={t('Create New File')}
+          inputLabel={t('Enter file name here')}
+          okText={t('Create')}
           showModal={showNewFileModal}
           onCreate={handleCreateNewFile}
-          onClose={() => setShowNewFileModal(!showNewFileModal)}
+          onClose={() => setShowNewFileModal(false)}
         />
       </div>
     </Spin>