Просмотр исходного кода

Merge pull request #2463 from weseek/imprv/i18n-share-link

Imprv/i18n share link
Ryuichi Paul E. Egoshi 5 лет назад
Родитель
Сommit
646f03d982

+ 18 - 4
resource/locales/en_US/translation.json

@@ -19,6 +19,7 @@
   "Tag": "Tag",
   "Tags": "Tags",
   "New": "New",
+  "Close": "Close",
   "Shortcuts": "Shortcuts",
   "eg": "e.g.",
   "add": "Add",
@@ -47,7 +48,6 @@
   "History": "History",
   "Presentation Mode": "Presentation",
   "Not available for guest": "Not available for guest",
-  "Shere this page link to public": "Shere this page link to public",
   "Create Archive Page": "Create Archive Page",
   "File type": "File type",
   "Include Attachment File": "Include Attachment File",
@@ -58,9 +58,6 @@
   "Last updated": "Updated",
   "Last_Login": "Last login",
   "Share": "Share",
-  "Share Link": "Share Link",
-  "share_link_notice":"remove {{count}} share links",
-  "delete_all_share_links":"Delete all share links",
   "Markdown Link": "Markdown Link",
   "Create/Edit Template": "Create/Edit template page",
   "Go to this version": "View this version",
@@ -198,6 +195,23 @@
     "password_is_not_set": "Password is not set"
   },
   "security_settings": "Security settings",
+  "share_links": {
+    "Shere this page link to public": "Shere this page link to public",
+    "share_link_list": "Share link list",
+    "share_link_management": "Share Link Management",
+    "No_share_links":"No share links",
+    "Share Link": "Share Link",
+    "Page Path": "Page Path",
+    "share_link_notice":"remove {{count}} share links",
+    "delete_all_share_links":"Delete all share links",
+    "expire": "Expiration",
+    "Days": "Days",
+    "Custom": "Custom",
+    "description": "description",
+    "enter_desc": "Enter description",
+    "Unlimited": "unlimited",
+    "Issue": "Issue"
+  },
   "API Settings": "API settings",
   "API Token Settings": "API token settings",
   "Current API Token": "Current API token",

+ 18 - 4
resource/locales/ja_JP/translation.json

@@ -19,6 +19,7 @@
   "Tag": "タグ",
   "Tags": "タグ",
   "New": "作成",
+  "Close": "閉じる",
   "Shortcuts": "ショートカット",
   "eg": "例:",
   "add": "追加",
@@ -47,7 +48,6 @@
   "History": "更新履歴",
   "Presentation Mode": "プレゼンテーション",
   "Not available for guest": "ゲストユーザーは利用できません",
-  "Shere this page link to public": "外部に共有するリンクを発行する",
   "Create Archive Page": "アーカイブページの作成",
   "File type": "ファイル形式",
   "Include Attachment File": "添付ファイルも含める",
@@ -58,9 +58,6 @@
   "Last updated": "最終更新",
   "Last_Login": "最終ログイン",
   "Share": "共有",
-  "Share Link": "共有用リンク",
-  "share_link_notice":"{{count}} 件の共有リンクを削除します",
-  "delete_all_share_links":"全ての共有リンクを削除します",
   "Markdown Link": "Markdown形式のリンク",
   "Create/Edit Template": "テンプレートページの作成/編集",
   "Go to this version": "このバージョンを見る",
@@ -200,6 +197,23 @@
     "password_is_not_set": "パスワードが設定されていません"
   },
   "security_settings": "セキュリティ設定",
+  "share_links": {
+    "Shere this page link to public": "外部に共有するリンクを発行する",
+    "share_link_list": "共有リンクリスト",
+    "share_link_management": "共有リンク管理",
+    "No_share_links":"共有リンクが存在しません",
+    "Share Link": "共有用リンク",
+    "Page Path": "ページパス",
+    "share_link_notice":"{{count}} 件の共有リンクを削除します",
+    "delete_all_share_links":"全ての共有リンクを削除します",
+    "expire": "有効期限",
+    "Days": "日間",
+    "Custom": "カスタム",
+    "description": "概要",
+    "enter_desc": "概要を入力",
+    "Unlimited": "無期限",
+    "Issue": "発行"
+  },
   "API Settings": "API設定",
   "API Token Settings": "API Token設定",
   "Current API Token": "現在のAPI Token",

+ 22 - 6
resource/locales/zh_CN/translation.json

@@ -19,7 +19,8 @@
 	"administrator": "管理员",
 	"Tag": "标签",
 	"Tags": "Tags",
-	"New": "新建",
+  "New": "新建",
+  "Close": "Close",
 	"Shortcuts": "快捷方式",
 	"eg": "e.g.",
 	"add": "添加",
@@ -47,15 +48,13 @@
 	"Timeline View": "时间线",
 	"History": "历史",
 	"Presentation Mode": "演示文稿",
-	"Not available for guest": "Not available for guest",
+  "Not available for guest": "Not available for guest",
 	"username": "用户名",
 	"Created": "创建",
 	"Last updated": "上次更新",
-	"Last_Login": "上次登录",
+  "Last_Login": "上次登录",
 	"Share": "分享",
   "Share Link": "分享链接",
-  "share_link_notice":"remove {{count}} share links",
-  "delete_all_share_links":"Delete all share links",
 	"Markdown Link": "Markdown链接",
 	"Create/Edit Template": "创建/编辑 模板页面",
 	"Unportalize": "未启动",
@@ -409,7 +408,24 @@
 		"someone_editing": "Someone editing this page on HackMD",
 		"this_page_has_draft": "This page has a draft on HackMD"
 	},
-	"security_settings": "安全设置",
+  "security_settings": "安全设置",
+  "share_links": {
+    "Shere this page link to public": "Shere this page link to public",
+    "share_link_list": "Share link list",
+    "share_link_management": "Share Link Management",
+    "No_share_links":"No share links",
+    "Share Link": "Share Link",
+    "Page Path": "Page Path",
+    "share_link_notice":"remove {{count}} share links",
+    "delete_all_share_links":"Delete all share links",
+    "expire": "Expiration",
+    "Days": "Days",
+    "Custom": "Custom",
+    "description": "description",
+    "enter_desc": "Enter description",
+    "Unlimited": "unlimited",
+    "Issue": "Issue"
+  },
 	"security_setting": {
 		"Security settings": "安全设置",
 		"Guest Users Access": "来宾用户访问",

+ 4 - 4
src/client/js/components/Admin/Security/DeleteAllShareLinksModal.jsx

@@ -37,17 +37,17 @@ const DeleteAllShareLinksModal = React.memo((props) => {
       <ModalHeader tag="h4" toggle={closeButtonHandler} className="bg-danger text-light">
         <span>
           <i className="icon-fw icon-fire"></i>
-          {t('delete_all_share_links')}
+          {t('share_links.delete_all_share_links')}
         </span>
       </ModalHeader>
       <ModalBody>
-        { t('share_link_notice', { count: props.count })}
+        { t('share_links.share_link_notice', { count: props.count })}
       </ModalBody>
       <ModalFooter>
-        <Button onClick={closeButtonHandler}>Cancel</Button>
+        <Button onClick={closeButtonHandler}>{t('Cancel')}</Button>
         <Button color="danger" onClick={deleteAllLinkHandler}>
           <i className="icon icon-fire"></i>
-            Delete
+          {t('Delete')}
         </Button>
       </ModalFooter>
     </Modal>

+ 10 - 10
src/client/js/components/Admin/Security/ShareLinkSetting.jsx

@@ -81,7 +81,7 @@ class ShareLinkSetting extends React.Component {
 
 
   render() {
-    const { adminGeneralSecurityContainer } = this.props;
+    const { t, adminGeneralSecurityContainer } = this.props;
 
     const pager = (
       <div className="pull-right my-3">
@@ -102,11 +102,11 @@ class ShareLinkSetting extends React.Component {
             type="button"
             onClick={this.showDeleteConfirmModal}
           >
-            Delete all links
+            {t('share_links.delete_all_share_links')}
           </button>
         )
         : (
-          <p className="pull-right mr-2">No share links</p>
+          <p className="pull-right mr-2">{t('share_links.No_share_links')}</p>
         )
     );
 
@@ -114,7 +114,7 @@ class ShareLinkSetting extends React.Component {
       <Fragment>
         <div className="mb-3">
           {deleteAllButton}
-          <h2 className="alert-anchor border-bottom">Shared Link List</h2>
+          <h2 className="alert-anchor border-bottom">{t('share_links.share_link_management')}</h2>
         </div>
 
         {pager}
@@ -122,11 +122,11 @@ class ShareLinkSetting extends React.Component {
           <table className="table table-bordered">
             <thead>
               <tr>
-                <th>Link</th>
-                <th>PagePath</th>
-                <th>Expiration</th>
-                <th>Description</th>
-                <th>Order</th>
+                <th>{t('share_links.Share Link')}</th>
+                <th>{t('share_links.Page Path')}</th>
+                <th>{t('share_links.expire')}</th>
+                <th>{t('share_links.description')}</th>
+                <th></th>
               </tr>
             </thead>
             <tbody>
@@ -144,7 +144,7 @@ class ShareLinkSetting extends React.Component {
                         shareLinks={sharelink._id}
                         onClick={() => { this.deleteLinkById(sharelink._id) }}
                       >
-                        <i className="icon-trash mr-2"></i>Delete
+                        <i className="icon-trash mr-2"></i>{t('Delete')}
                       </button>
                     </td>
                   </tr>

+ 5 - 4
src/client/js/components/OutsideShareLinkModal.jsx

@@ -87,15 +87,16 @@ class OutsideShareLinkModal extends React.Component {
   }
 
   render() {
+    const { t } = this.props;
     return (
       <Modal size="lg" isOpen={this.props.isOpen} toggle={this.props.onClose}>
-        <ModalHeader tag="h4" toggle={this.props.onClose} className="bg-primary text-light">Title
+        <ModalHeader tag="h4" toggle={this.props.onClose} className="bg-primary text-light">{t('share_links.Shere this page link to public')}
         </ModalHeader>
         <ModalBody>
           <div className="container">
             <div className="form-inline mb-3">
-              <h4>Shared Link List</h4>
-              <button className="ml-auto btn btn-danger" type="button" onClick={this.deleteAllLinksButtonHandler}>Delete all links</button>
+              <h4>{t('share_links.share_link_list')}</h4>
+              <button className="ml-auto btn btn-danger" type="button" onClick={this.deleteAllLinksButtonHandler}>{t('delete_all')}</button>
             </div>
 
             <div>
@@ -108,7 +109,7 @@ class OutsideShareLinkModal extends React.Component {
                 type="button"
                 onClick={this.toggleShareLinkFormHandler}
               >
-                {this.state.isOpenShareLinkForm ? 'Close' : 'New'}
+                {this.state.isOpenShareLinkForm ? t('Close') : t('New')}
               </button>
               {this.state.isOpenShareLinkForm && <ShareLinkForm onCloseForm={this.toggleShareLinkFormHandler} />}
             </div>

+ 1 - 1
src/client/js/components/Page/PageShareManagement.jsx

@@ -71,7 +71,7 @@ const PageShareManagement = (props) => {
       {currentUser == null ? renderGuestUser() : renderCurrentUser()}
       <div className="dropdown-menu dropdown-menu-right">
         <button className="dropdown-item" type="button" onClick={openOutsideShareLinkModalHandler}>
-          <i className="icon-fw icon-link"></i>{t('Shere this page link to public')}
+          <i className="icon-fw icon-link"></i>{t('share_links.Shere this page link to public')}
           <span className="ml-2 badge badge-info badge-pill">{pageContainer.state.shareLinksNumber}</span>
         </button>
       </div>

+ 10 - 7
src/client/js/components/ShareLinkForm.jsx

@@ -133,6 +133,7 @@ class ShareLinkForm extends React.Component {
 
   renderExpirationTypeOptions() {
     const { expirationType } = this.state;
+    const { t } = this.props;
 
     return (
       <div className="form-group">
@@ -146,7 +147,7 @@ class ShareLinkForm extends React.Component {
             checked={expirationType === 'unlimited'}
             onChange={() => { this.handleChangeExpirationType('unlimited') }}
           />
-          <label className="custom-control-label" htmlFor="customRadio1">Unlimited</label>
+          <label className="custom-control-label" htmlFor="customRadio1">{t('share_links.Unlimited')}</label>
         </div>
 
         <div className="custom-control custom-radio offset-4 mb-2">
@@ -170,7 +171,7 @@ class ShareLinkForm extends React.Component {
                 onFocus={() => { this.handleChangeExpirationType('numberOfDays') }}
                 onChange={e => this.handleChangeNumberOfDays(Number(e.target.value))}
               />
-              <span className="col-auto">Days</span>
+              <span className="col-auto">{t('share_links.Days')}</span>
             </div>
           </label>
         </div>
@@ -186,7 +187,7 @@ class ShareLinkForm extends React.Component {
             onChange={() => { this.handleChangeExpirationType('custom') }}
           />
           <label className="custom-control-label" htmlFor="customRadio3">
-            Custom
+            {t('share_links.Custom')}
           </label>
           <input
             type="date"
@@ -210,15 +211,16 @@ class ShareLinkForm extends React.Component {
   }
 
   renderDescriptionForm() {
+    const { t } = this.props;
     return (
       <div className="form-group row">
-        <label htmlFor="inputDesc" className="col-md-4 col-form-label">Description</label>
+        <label htmlFor="inputDesc" className="col-md-4 col-form-label">{t('share_links.description')}</label>
         <div className="col-md-4">
           <input
             type="text"
             className="form-control"
             id="inputDesc"
-            placeholder="Enter description"
+            placeholder={t('share_links.enter_desc')}
             value={this.state.description}
             onChange={e => this.handleChangeDescription(e.target.value)}
           />
@@ -228,15 +230,16 @@ class ShareLinkForm extends React.Component {
   }
 
   render() {
+    const { t } = this.props;
     return (
       <div className="share-link-form border p-3">
-        <h4>Expiration Date</h4>
+        <h4>{t('share_links.expire')}</h4>
         {this.renderExpirationTypeOptions()}
         <hr />
         {this.renderDescriptionForm()}
         <div className="text-right">
           <button type="button" className="btn btn-primary" onClick={this.handleIssueShareLink}>
-            Issue
+            {t('share_links.Issue')}
           </button>
         </div>
       </div>

+ 6 - 5
src/client/js/components/ShareLinkList.jsx

@@ -11,6 +11,7 @@ import AppContainer from '../services/AppContainer';
 
 const ShareLinkList = (props) => {
 
+  const { t } = props;
   function deleteLinkHandler(shareLinkId) {
     if (props.onClickDeleteButton == null) {
       return;
@@ -28,7 +29,7 @@ const ShareLinkList = (props) => {
             <td>{shareLink.description}</td>
             <td>
               <button className="btn btn-outline-warning" type="button" onClick={() => deleteLinkHandler(shareLink._id)}>
-                <i className="icon-trash"></i>Delete
+                <i className="icon-trash"></i>{t('Delete')}
               </button>
             </td>
           </tr>
@@ -42,10 +43,10 @@ const ShareLinkList = (props) => {
       <table className="table table-bordered">
         <thead>
           <tr>
-            <th>Link</th>
-            <th>Expiration</th>
-            <th>Description</th>
-            <th>Order</th>
+            <th>{t('share_links.Share Link')}</th>
+            <th>{t('share_links.expire')}</th>
+            <th>{t('share_links.description')}</th>
+            <th></th>
           </tr>
         </thead>
         <tbody>