itizawa 7 лет назад
Родитель
Сommit
c6bcbd8c0d

+ 1 - 0
resource/locales/ja/translation.json

@@ -111,6 +111,7 @@
   "Shareable link": "このページの共有用URL",
   "Shareable link": "このページの共有用URL",
   "The whitelist of registration permission E-mail address": "登録許可メールアドレスの<br>ホワイトリスト",
   "The whitelist of registration permission E-mail address": "登録許可メールアドレスの<br>ホワイトリスト",
   "Selecting authentication mechanism": "認証機構選択",
   "Selecting authentication mechanism": "認証機構選択",
+  "Add tags for this page": "タグを付ける",
 
 
 
 
 
 

+ 1 - 1
src/client/js/app.js

@@ -312,7 +312,7 @@ if (pagePath) {
   componentMappings['revision-path'] = <RevisionPath pagePath={pagePath} crowi={crowi} />;
   componentMappings['revision-path'] = <RevisionPath pagePath={pagePath} crowi={crowi} />;
   // [TODO] there is a need to decide the destination of RevisionUrl
   // [TODO] there is a need to decide the destination of RevisionUrl
   componentMappings['revision-url'] = <RevisionUrl crowi={crowi} pageId={pageId} pagePath={pagePath} sendTagData={setTagData} />;
   componentMappings['revision-url'] = <RevisionUrl crowi={crowi} pageId={pageId} pagePath={pagePath} sendTagData={setTagData} />;
-  componentMappings['tag-label'] = <TagLabel crowi={crowi} pageId={pageId} sendTagData={setTagData} />;
+  componentMappings['tag-label'] = <I18nextProvider i18n={i18n}><TagLabel crowi={crowi} pageId={pageId} sendTagData={setTagData} /></I18nextProvider>;
 }
 }
 
 
 Object.keys(componentMappings).forEach((key) => {
 Object.keys(componentMappings).forEach((key) => {

+ 7 - 2
src/client/js/components/Page/TagLabel.jsx

@@ -1,10 +1,11 @@
 import React from 'react';
 import React from 'react';
 import PropTypes from 'prop-types';
 import PropTypes from 'prop-types';
+import { withTranslation } from 'react-i18next';
 import Button from 'react-bootstrap/es/Button';
 import Button from 'react-bootstrap/es/Button';
 import Modal from 'react-bootstrap/es/Modal';
 import Modal from 'react-bootstrap/es/Modal';
 import PageTagForm from '../PageTagForm';
 import PageTagForm from '../PageTagForm';
 
 
-export default class TagLabel extends React.Component {
+class TagLabel extends React.Component {
 
 
   constructor(props) {
   constructor(props) {
     super(props);
     super(props);
@@ -50,11 +51,12 @@ export default class TagLabel extends React.Component {
 
 
   render() {
   render() {
     const tags = [];
     const tags = [];
+    const { t } = this.props;
 
 
     if (this.state.currentPageTags.length === 0) {
     if (this.state.currentPageTags.length === 0) {
       tags.push(
       tags.push(
         <a onClick={this.handleShowModal}>
         <a onClick={this.handleShowModal}>
-        Add tags for this page
+          <span>{ t('Add tags for this page') }</span>
         </a>,
         </a>,
       );
       );
     }
     }
@@ -96,7 +98,10 @@ export default class TagLabel extends React.Component {
 }
 }
 
 
 TagLabel.propTypes = {
 TagLabel.propTypes = {
+  t: PropTypes.func.isRequired, // i18next
   crowi: PropTypes.object.isRequired,
   crowi: PropTypes.object.isRequired,
   pageId: PropTypes.string,
   pageId: PropTypes.string,
   sendTagData: PropTypes.func.isRequired,
   sendTagData: PropTypes.func.isRequired,
 };
 };
+
+export default withTranslation()(TagLabel);

+ 1 - 1
src/client/styles/scss/_tag.scss

@@ -6,7 +6,7 @@
     .manage-tags {
     .manage-tags {
       cursor: pointer;
       cursor: pointer;
       font-size: 12px;
       font-size: 12px;
-      margin-left: 10px;
+      margin-left: 5px;
     }
     }
 
 
     .tag-icon {
     .tag-icon {