Parcourir la source

https://github.com/tracim/tracim/issues/748, Translation of : adminWorkspacePage, HomePage, app Html, Timeline, and some components

AlexiCauvin il y a 6 ans
Parent
révision
d71459fd47

+ 31 - 6
frontend/i18next.scanner/en/translation.json Voir le fichier

@@ -10,7 +10,6 @@
10 10
   "Search...": "Search...",
11 11
   "Create a workspace": "Create a workspace",
12 12
   "Title": "Title",
13
-  "Change": "Change",
14 13
   "Move": "Move",
15 14
   "Download": "Download",
16 15
   "Archive": "Archive",
@@ -58,9 +57,35 @@
58 57
   "You have subscribed to this workspace's notifications": "You have subscribed to this workspace's notifications",
59 58
   "Connection": "Connection",
60 59
   "Forgotten password ?": "Forgotten password ?",
61
-  "An error has happened when fetching workspace detail": "An error has happened when fetching workspace detail",
62
-  "An error has happened while fetching member list": "An error has happened while fetching member list",
63
-  "An error has happened while fetching recent activity list": "An error has happened while fetching recent activity list",
64
-  "An error has happened while fetching read status list": "An error has happened while fetching read status list",
65
-  "Hi {{name}} ! Currently, you are ": "Hi {{name}} ! Currently, you are "
60
+  "Hi {{name}} ! Currently, you are ": "Hi {{name}} ! Currently, you are ",
61
+  "Workspace management": "Workspace management",
62
+  "ID": "ID",
63
+  "Description": "Description",
64
+  "Member's number": "Member's number",
65
+  "Delete workspace": "Delete workspace",
66
+  "An error has happened while fetching": "An error has happened while fetching",
67
+  "workspace detail": "workspace detail",
68
+  "member list": "member list",
69
+  "recent activity list": "recent activity list",
70
+  "read status list": "read status list",
71
+  "An error has happened while fetching \"mark all as read\"": "An error has happened while fetching \"mark all as read\"",
72
+  "known members list": "known members list",
73
+  "Please set a name or email": "Please set a name or email",
74
+  "Please set a role": "Please set a role",
75
+  "An error has happened while adding the member": "An error has happened while adding the member",
76
+  "Welcome on Tracim": "Welcome on Tracim",
77
+  "Thank you for trusting us and using our collaborative tool": "Thank you for trusting us and using our collaborative tool",
78
+  "Error while archiving document": "Error while archiving document",
79
+  "Error while deleting document": "Error while deleting document",
80
+  "subscribed": "subscribed",
81
+  "Feature": "Feature",
82
+  "Explore": "Explore",
83
+  "About": "About",
84
+  "Admin workspace": "Admin workspace",
85
+  "Admin user": "Admin user",
86
+  "You will create your first workspace": "You will create your first workspace",
87
+  "create a workspace": "create a workspace",
88
+  "This page list all workspaces": "This page list all workspaces",
89
+  "Create ...": "Create ...",
90
+  "Edit": "Edit"
66 91
 }

+ 31 - 6
frontend/i18next.scanner/fr/translation.json Voir le fichier

@@ -10,7 +10,6 @@
10 10
   "Search...": "Rechercher ...",
11 11
   "Create a workspace": "Créer un espace de travail",
12 12
   "Title": "Titre",
13
-  "Change": "Modifier",
14 13
   "Move": "Déplacer",
15 14
   "Download": "Télécharger",
16 15
   "Archive": "Archiver",
@@ -58,9 +57,35 @@
58 57
   "You have subscribed to this workspace's notifications": "Vous êtes abonné aux notifications de cet espace de travail.",
59 58
   "Connection": "Connexion",
60 59
   "Forgotten password ?": "Mot de passe oublié ?",
61
-  "An error has happened when fetching workspace detail": "__NOT_TRANSLATED__",
62
-  "An error has happened while fetching member list": "__NOT_TRANSLATED__",
63
-  "An error has happened while fetching recent activity list": "__NOT_TRANSLATED__",
64
-  "An error has happened while fetching read status list": "__NOT_TRANSLATED__",
65
-  "Hi {{name}} ! Currently, you are ": "Bonjour {{name}} ! Vous êtes actuellement"
60
+  "Hi {{name}} ! Currently, you are ": "Bonjour {{name}} ! Vous êtes actuellement",
61
+  "Workspace management": "Gestion des espaces de travail",
62
+  "ID": "ID",
63
+  "Description": "Description",
64
+  "Member's number": "Nombre de membre",
65
+  "Delete workspace": "Supprimer un espace de travail",
66
+  "An error has happened while fetching": "Erreur lors de la récupération de données",
67
+  "workspace detail": "Detail de l'espace de travail",
68
+  "member list": "Liste des membres",
69
+  "recent activity list": "Liste des activités récente",
70
+  "read status list": "Lire la liste des statuts",
71
+  "An error has happened while fetching \"mark all as read\"": "__NOT_TRANSLATED__",
72
+  "known members list": "Liste des membres connus",
73
+  "Please set a name or email": "Entrez un nom, s'il vous plaît",
74
+  "Please set a role": "Choisissez un rôle s'il vous plaît",
75
+  "An error has happened while adding the member": "Une erreur s'est produite lors de l'ajout d'un membre",
76
+  "Welcome on Tracim": "Bienvenue sur Tracim",
77
+  "Thank you for trusting us and using our collaborative tool": "Merci de nous faire confiance et d'utiliser notre outil collaboratif.",
78
+  "Error while archiving document": "Erreur lors de l'archivage d'un document",
79
+  "Error while deleting document": "Erreur lors de la suppression d'un document",
80
+  "subscribed": "Abonné(e)",
81
+  "Feature": "Fonctionnalité",
82
+  "Explore": "Exploré",
83
+  "About": "A propos",
84
+  "Admin workspace": "Administration des espaces de travail",
85
+  "Admin user": "Administration des utilisateurs",
86
+  "You will create your first workspace": "Vous allez créer votre premier espace de travail",
87
+  "create a workspace": "créer un espace de travail",
88
+  "This page list all workspaces": "Cette page liste tous les espaces de travail",
89
+  "Create ...": "Créer ...",
90
+  "Edit": "Editer"
66 91
 }

+ 11 - 4
frontend/src/component/Header/MenuLinkList.jsx Voir le fichier

@@ -1,22 +1,29 @@
1 1
 import React from 'react'
2 2
 import PropTypes from 'prop-types'
3
+import { translate } from 'react-i18next'
3 4
 
4 5
 const MenuLinkList = props => {
5 6
   return (
6 7
     <ul className='header__menu__list text-center navbar-nav mr-auto'>
7 8
       <li className='list__item nav-item'>
8
-        <a className='list__item__link' href='' onClick={props.onClickFeature}>Fonctionnalité</a>
9
+        <a className='list__item__link' href='' onClick={props.onClickFeature}>
10
+          {props.t('Feature')}
11
+        </a>
9 12
       </li>
10 13
       <li className='list__item nav-item'>
11
-        <a className='list__item__link' href='' onClick={props.onClickExplore}>Explorer</a>
14
+        <a className='list__item__link' href='' onClick={props.onClickExplore}>
15
+          {props.t('Explore')}
16
+        </a>
12 17
       </li>
13 18
       <li className='list__item nav-item'>
14
-        <a className='list__item__link' href='' onClick={props.onClickAbout}>A Propos</a>
19
+        <a className='list__item__link' href='' onClick={props.onClickAbout}>
20
+          {props.t('About')}
21
+        </a>
15 22
       </li>
16 23
     </ul>
17 24
   )
18 25
 }
19
-export default MenuLinkList
26
+export default translate()(MenuLinkList)
20 27
 
21 28
 MenuLinkList.propTypes = {
22 29
   onClickFeature: PropTypes.func.isRequired,

+ 1 - 1
frontend/src/component/Workspace/BtnExtandedAction.jsx Voir le fichier

@@ -23,7 +23,7 @@ const ExtandedAction = props => {
23 23
             <i className='fa fa-fw fa-pencil' />
24 24
           </div>
25 25
           <div className='subdropdown__item__text'>
26
-            {props.t('Change')}
26
+            {props.t('Edit')}
27 27
           </div>
28 28
         </div>
29 29
 

+ 3 - 2
frontend/src/component/common/Input/DropdownCreateButton.jsx Voir le fichier

@@ -2,6 +2,7 @@ import React from 'react'
2 2
 import PropTypes from 'prop-types'
3 3
 import classnames from 'classnames'
4 4
 import SubDropdownCreateButton from './SubDropdownCreateButton.jsx'
5
+import { translate } from 'react-i18next'
5 6
 
6 7
 const DropdownCreateButton = props => {
7 8
   return (
@@ -15,7 +16,7 @@ const DropdownCreateButton = props => {
15 16
         aria-expanded='false'
16 17
       >
17 18
         <div className={classnames(`${props.parentClass}__label__text`, 'dropdownCreateBtn__label__text')}>
18
-          Créer ...
19
+          {props.t('Create ...')}
19 20
         </div>
20 21
       </button>
21 22
 
@@ -33,7 +34,7 @@ const DropdownCreateButton = props => {
33 34
   )
34 35
 }
35 36
 
36
-export default DropdownCreateButton
37
+export default translate()(DropdownCreateButton)
37 38
 
38 39
 DropdownCreateButton.propTypes = {
39 40
   availableApp: PropTypes.array.isRequired,

+ 20 - 8
frontend/src/container/AdminWorkspacePage.jsx Voir le fichier

@@ -13,13 +13,13 @@ class AdminWorkspacePage extends React.Component {
13 13
       <PageWrapper customClass='adminWorkspacePage'>
14 14
         <PageTitle
15 15
           parentClass={'adminWorkspacePage'}
16
-          title={'Workspace management'}
16
+          title={this.props.t('Workspace management')}
17 17
         />
18 18
 
19 19
         <PageContent parentClass='adminWorkspacePage'>
20 20
 
21 21
           <div className='adminWorkspacePage__description'>
22
-            This page informs all workspaces of the instances
22
+            {this.props.t('This page list all workspaces')}
23 23
           </div>
24 24
 
25 25
           { /*
@@ -39,14 +39,26 @@ class AdminWorkspacePage extends React.Component {
39 39
             <table className='table'>
40 40
               <thead>
41 41
                 <tr>
42
-                  <th scope='col'>ID</th>
43
-                  <th scope='col'>Workspace</th>
44
-                  <th scope='col'>Description</th>
45
-                  <th scope='col'>Member's number</th>
42
+                  <th scope='col'>
43
+                    {this.props.t('ID')}
44
+                  </th>
45
+                  <th scope='col'>
46
+                    {this.props.t('Workspace')}
47
+                  </th>
48
+                  <th scope='col'>
49
+                    {this.props.t('Description')}
50
+                  </th>
51
+                  <th scope='col'>
52
+                    {this.props.t("Member's number")}
53
+                  </th>
46 54
                   { /*
47
-                    <th scope='col'>Calendar</th>
55
+                    <th scope='col'>
56
+                      {this.props.t('Calendar')}
57
+                    </th>
48 58
                   */ }
49
-                  <th scope='col'>Delete workspace</th>
59
+                  <th scope='col'>
60
+                    {this.props.t('Delete workspace')}
61
+                  </th>
50 62
                 </tr>
51 63
               </thead>
52 64
               <tbody>

+ 6 - 5
frontend/src/container/Home.jsx Voir le fichier

@@ -3,6 +3,7 @@ import Card from '../component/common/Card/Card.jsx'
3 3
 import CardHeader from '../component/common/Card/CardHeader.jsx'
4 4
 import CardBody from '../component/common/Card/CardBody.jsx'
5 5
 import LogoHomepage from '../img/logoHeader.svg'
6
+import { translate } from 'react-i18next'
6 7
 
7 8
 class Home extends Component {
8 9
   render () {
@@ -14,17 +15,17 @@ class Home extends Component {
14 15
             <CardBody customClass='homepagecard'>
15 16
               <div>
16 17
                 <div className='homepagecard__title text-center my-4'>
17
-                  Bienvenue sur Tracim
18
+                  {this.props.t('Welcome on Tracim')}
18 19
                 </div>
19 20
                 <div className='homepagecard__thanks text-center'>
20
-                  Merci de nous faire confiance et d'utiliser notre outil collaboratif
21
+                  {this.props.t('Thank you for trusting us and using our collaborative tool')}
21 22
                 </div>
22 23
                 <div className='homepagecard__delimiter delimiter' />
23 24
                 <div className='homepagecard__text text-center mb-5'>
24
-                  Vous allez créez votre premier espace de travail
25
+                  {this.props.t('You will create your first workspace')}
25 26
                 </div>
26 27
                 <div className='homepagecard__btn btn btn-outline-primary'>
27
-                  Créer votre espace de travail
28
+                  {this.props.t('create a workspace')}
28 29
                 </div>
29 30
                 <div className='homepagecard__logo mt-5 mb-3'>
30 31
                   <img src={LogoHomepage} alt='logo homepage' />
@@ -38,4 +39,4 @@ class Home extends Component {
38 39
   }
39 40
 }
40 41
 
41
-export default Home
42
+export default translate()(Home)

+ 8 - 1
frontend_app_html-document/i18next.scanner/en/translation.json Voir le fichier

@@ -2,5 +2,12 @@
2 2
   "Last version": "Last version",
3 3
   "Validate and create": "Validate and create",
4 4
   "Document's title": "Document's title",
5
-  "New Document": "New Document"
5
+  "New Document": "New Document",
6
+  "Error while archiving document": "Error while archiving document",
7
+  "Error while deleting document": "Error while deleting document",
8
+  "Error while restoring document": "Error while restoring document",
9
+  "This content is archived.": "This content is archived.",
10
+  "Restore": "Restore",
11
+  "This content is deleted.": "This content is deleted.",
12
+  "latest version :": "latest version :"
6 13
 }

+ 8 - 1
frontend_app_html-document/i18next.scanner/fr/translation.json Voir le fichier

@@ -2,5 +2,12 @@
2 2
   "Last version": "Dernière version",
3 3
   "Validate and create": "Valider et créer",
4 4
   "Document's title": "Titre du document",
5
-  "New Document": "Nouveau document"
5
+  "New Document": "Nouveau document",
6
+  "Error while archiving document": "Erreur lors de l'archivage d'un document",
7
+  "Error while deleting document": "Erreur lors de la suppression d'un document",
8
+  "Error while restoring document": "Erreur lors de la restauration du document",
9
+  "This content is archived.": "Ce contenu est archivé.",
10
+  "Restore": "Restaurer",
11
+  "This content is deleted.": "Ce contenu est supprimé.",
12
+  "latest version :": "Dernière version"
6 13
 }

+ 7 - 6
frontend_app_html-document/src/component/HtmlDocument.jsx Voir le fichier

@@ -1,6 +1,7 @@
1 1
 import React from 'react'
2 2
 import { TextAreaApp } from 'tracim_frontend_lib'
3 3
 import { MODE } from '../helper.js'
4
+import { translate } from 'react-i18next'
4 5
 
5 6
 const HtmlDocument = props => {
6 7
   return (
@@ -9,12 +10,12 @@ const HtmlDocument = props => {
9 10
         <div className='html-document__contentpage__textnote__state'>
10 11
           <div className='html-document__contentpage__textnote__state__msg'>
11 12
             <i className='fa fa-fw fa-archive' />
12
-            This content is archived.
13
+            {props.t('This content is archived.')}
13 14
           </div>
14 15
 
15 16
           <button className='html-document__contentpage__textnote__state__btnrestore btn' onClick={props.onClickRestoreArchived}>
16 17
             <i className='fa fa-fw fa-archive' />
17
-            Restore
18
+            {props.t('Restore')}
18 19
           </button>
19 20
         </div>
20 21
       }
@@ -23,12 +24,12 @@ const HtmlDocument = props => {
23 24
         <div className='html-document__contentpage__textnote__state'>
24 25
           <div className='html-document__contentpage__textnote__state__msg'>
25 26
             <i className='fa fa-fw fa-trash' />
26
-            Ce contenu est supprimé.
27
+            {props.t('This content is deleted.')}
27 28
           </div>
28 29
 
29 30
           <button className='html-document__contentpage__textnote__state__btnrestore btn' onClick={props.onClickRestoreDeleted}>
30 31
             <i className='fa fa-fw fa-trash' />
31
-            Restore
32
+            {props.t('Restore')}
32 33
           </button>
33 34
         </div>
34 35
       }
@@ -40,7 +41,7 @@ const HtmlDocument = props => {
40 41
             <div dangerouslySetInnerHTML={{__html: props.mode === MODE.VIEW ? props.lastVersion : props.version}} />
41 42
             {props.mode === MODE.REVISION &&
42 43
               <div className='html-document__contentpage__textnote__lastversion'>
43
-                (dernière version : {props.lastVersion})
44
+                ({props.t('latest version :')} {props.lastVersion})
44 45
               </div>
45 46
             }
46 47
           </div>
@@ -64,4 +65,4 @@ const HtmlDocument = props => {
64 65
   )
65 66
 }
66 67
 
67
-export default HtmlDocument
68
+export default translate()(HtmlDocument)

+ 6 - 1
frontend_lib/i18next.scanner/en/translation.json Voir le fichier

@@ -1 +1,6 @@
1
-{}
1
+{
2
+  "Timeline": "Timeline",
3
+  "This content is archived.": "This content is archived.",
4
+  "Restore": "Restore",
5
+  "This content is deleted.": "This content is deleted."
6
+}

+ 6 - 1
frontend_lib/i18next.scanner/fr/translation.json Voir le fichier

@@ -1 +1,6 @@
1
-{}
1
+{
2
+  "Timeline": "Historique",
3
+  "This content is archived.": "Ce contenu est archivé.",
4
+  "Restore": "Restaurer",
5
+  "This content is deleted.": "Ce contenu est supprimé."
6
+}

+ 1 - 1
frontend_lib/src/component/Input/BtnSwitch/BtnSwitch.jsx Voir le fichier

@@ -9,7 +9,7 @@ export const BtnSwitch = props =>
9 9
       <span className='slider round' />
10 10
     </label>
11 11
     <div className='btnswitch__text'>
12
-      { props.checked ? 'actif' : 'inactif'}
12
+      { props.checked ? 'active' : 'inactive' }
13 13
     </div>
14 14
   </div>
15 15
 

+ 8 - 7
frontend_lib/src/component/Timeline/Timeline.jsx Voir le fichier

@@ -5,6 +5,7 @@ import Radium from 'radium'
5 5
 import color from 'color'
6 6
 import Comment from './Comment.jsx'
7 7
 import Revision from './Revision.jsx'
8
+import { translate } from 'react-i18next'
8 9
 
9 10
 require('./Timeline.styl')
10 11
 
@@ -38,7 +39,7 @@ class Timeline extends React.Component {
38 39
               <i className={classnames('fa fa-fw', {'fa-angle-double-right': props.rightPartOpen, 'fa-angle-double-left': !props.rightPartOpen})} />
39 40
             </div>
40 41
             <div className='timeline__header__title'>
41
-              Timeline
42
+              {this.props.t('Timeline')}
42 43
             </div>
43 44
             <div className='timeline__header__icon mb-3 mt-auto'>
44 45
               <i className={classnames('fa fa-fw', {'fa-angle-double-right': props.rightPartOpen, 'fa-angle-double-left': !props.rightPartOpen})} />
@@ -50,12 +51,12 @@ class Timeline extends React.Component {
50 51
           <div className='timeline__info'>
51 52
             <div className='timeline__info__msg'>
52 53
               <i className='fa fa-fw fa-archive' />
53
-              This content is archived.
54
+              {this.props.t('This content is archived.')}
54 55
             </div>
55 56
 
56 57
             <button className='timeline__info__btnrestore btn' onClick={props.onClickRestoreArchived}>
57 58
               <i className='fa fa-fw fa-archive' />
58
-              Restore
59
+              {this.props.t('Restore')}
59 60
             </button>
60 61
           </div>
61 62
         }
@@ -64,12 +65,12 @@ class Timeline extends React.Component {
64 65
           <div className='timeline__info'>
65 66
             <div className='timeline__info__msg'>
66 67
               <i className='fa fa-fw fa-trash' />
67
-              This content is deleted.
68
+              {this.props.t('This content is deleted.')}
68 69
             </div>
69 70
 
70 71
             <button className='timeline__info__btnrestore btn' onClick={props.onClickRestoreDeleted}>
71 72
               <i className='fa fa-fw fa-trash' />
72
-              Restore
73
+              {this.props.t('Restore')}
73 74
             </button>
74 75
           </div>
75 76
         }
@@ -135,7 +136,7 @@ class Timeline extends React.Component {
135 136
                   }}
136 137
                   key={'timeline__comment__advancedtext'}
137 138
                 >
138
-                  {props.wysiwyg ? 'Texte Simple' : 'Texte Riche'}
139
+                  {props.wysiwyg ? 'Texte simple' : 'Texte riche'}
139 140
                 </button>
140 141
               </div>
141 142
 
@@ -169,7 +170,7 @@ class Timeline extends React.Component {
169 170
   }
170 171
 }
171 172
 
172
-export default Radium(Timeline)
173
+export default Radium(translate()(Timeline))
173 174
 
174 175
 Timeline.propTypes = {
175 176
   timelineData: PropTypes.array.isRequired,