ソースを参照

translation of MenuProfil and Notification component's on the header

AlexiCauvin 5 年 前
コミット
51d000cadb

+ 6 - 1
frontend/i18next.scanner/en/translation.json ファイルの表示

@@ -14,5 +14,10 @@
14 14
   "Move": "Move",
15 15
   "Download": "Download",
16 16
   "Archive": "Archive",
17
-  "Delete": "Delete"
17
+  "Delete": "Delete",
18
+  "My Account": "My Account",
19
+  "Logout": "Logout",
20
+  "Notification": "Notification",
21
+  "Archive Topic": "Archive Topic",
22
+  "Deleted File": "Deleted File"
18 23
 }

+ 6 - 1
frontend/i18next.scanner/fr/translation.json ファイルの表示

@@ -14,5 +14,10 @@
14 14
   "Move": "Déplacer",
15 15
   "Download": "Télécharger",
16 16
   "Archive": "Archiver",
17
-  "Delete": "Supprimer"
17
+  "Delete": "Supprimer",
18
+  "My Account": "Mon Compte",
19
+  "Logout": "Se Déconnecter",
20
+  "Notification": "Notification",
21
+  "Archive Topic": "Conversation archivée",
22
+  "Deleted File": "Fichier supprimé"
18 23
 }

+ 4 - 3
frontend/src/component/Header/MenuActionListItem/MenuProfil.jsx ファイルの表示

@@ -2,6 +2,7 @@ import React from 'react'
2 2
 import { Link } from 'react-router-dom'
3 3
 import PropTypes from 'prop-types'
4 4
 import { PAGE } from '../../../helper.js'
5
+import { translate } from 'react-i18next'
5 6
 
6 7
 const MenuProfil = props => {
7 8
   return props.user.logged
@@ -17,12 +18,12 @@ const MenuProfil = props => {
17 18
           <div className='profilgroup__setting dropdown-menu' aria-labelledby='dropdownMenuButton'>
18 19
             <Link className='setting__link dropdown-item' to={PAGE.ACCOUNT}>
19 20
               <i className='fa fa-fw fa-user-o mr-2' />
20
-              Mon compte
21
+              {props.t('My Account')}
21 22
             </Link>
22 23
             {/* <div className='setting__link dropdown-item'>Mot de passe</div> */}
23 24
             <div className='setting__link dropdown-item' onClick={props.onClickLogout}>
24 25
               <i className='fa fa-fw fa-sign-out mr-2' />
25
-              Se déconnecter
26
+              {props.t('Logout')}
26 27
             </div>
27 28
           </div>
28 29
         </div>
@@ -30,7 +31,7 @@ const MenuProfil = props => {
30 31
     )
31 32
     : ''
32 33
 }
33
-export default MenuProfil
34
+export default translate()(MenuProfil)
34 35
 
35 36
 MenuProfil.propTypes = {
36 37
   user: PropTypes.object.isRequired,

+ 5 - 4
frontend/src/component/Header/MenuActionListItem/Notification.jsx ファイルの表示

@@ -1,4 +1,5 @@
1 1
 import React from 'react'
2
+import { translate } from 'react-i18next'
2 3
 // import PropTypes from 'prop-types'
3 4
 
4 5
 const Notification = props => {
@@ -13,18 +14,18 @@ const Notification = props => {
13 14
           aria-haspopup='true'
14 15
           aria-expanded='false'
15 16
         >
16
-          Notification
17
+          {props.t('Notification')}
17 18
         </button>
18 19
         <div className='timeline__subdropdown dropdown-menu' aria-labelledby='headerDropdownMenuButton'>
19 20
           <div className='timeline__subdropdown__text dropdown-item' >
20
-            Conversation archivé
21
+            {props.t("Archive Topic")}
21 22
           </div>
22 23
           <div className='timeline__subdropdown__text dropdown-item' >
23
-            Fichier supprimé
24
+            {props.t('Deleted File')}
24 25
           </div>
25 26
         </div>
26 27
       </div>
27 28
     </li>
28 29
   )
29 30
 }
30
-export default Notification
31
+export default translate()(Notification)