فهرست منبع

update UsersHomePageFooter

jam411 3 سال پیش
والد
کامیت
91219a0493

+ 4 - 0
packages/app/public/static/locales/en_US/translation.json

@@ -864,5 +864,9 @@
   "page_operation":{
     "paths_recovered": "Paths recovered successfully",
     "path_recovery_failed":"Path recovery failed"
+  },
+  "footer": {
+    "bookmarks": "Bookmarks",
+    "recently_created": "Recently Created"
   }
 }

+ 4 - 0
packages/app/public/static/locales/ja_JP/translation.json

@@ -1136,5 +1136,9 @@
   "page_operation":{
     "paths_recovered": "パスを修復しました",
     "path_recovery_failed":"パスを修復できませんでした"
+  },
+  "footer": {
+    "bookmarks": "ブックマーク",
+    "recently_created": "最近作成したページ"
   }
 }

+ 4 - 0
packages/app/public/static/locales/zh_CN/translation.json

@@ -1146,5 +1146,9 @@
   "page_operation":{
     "paths_recovered": "成功恢复了页面路径",
     "path_recovery_failed":"路径恢复失败"
+  },
+  "footer": {
+    "bookmarks": "书签",
+    "recently_created": "最近创建页面"
   }
 }

+ 6 - 4
packages/app/src/components/UsersHomePageFooter.tsx

@@ -1,16 +1,18 @@
 import React from 'react';
 
+import { useTranslation } from 'next-i18next';
+
 import { RecentlyCreatedIcon } from '~/components/Icons/RecentlyCreatedIcon';
 import BookmarkList from '~/components/PageList/BookmarkList';
 import { RecentCreated } from '~/components/RecentCreated/RecentCreated';
 import styles from '~/components/UsersHomePageFooter.module.scss';
 
-type UsersHomePageFooterProps = {
+export type UsersHomePageFooterProps = {
   creatorId: string,
 }
 
 export const UsersHomePageFooter = (props: UsersHomePageFooterProps): JSX.Element => {
-
+  const { t } = useTranslation();
   const { creatorId } = props;
 
   return (
@@ -18,7 +20,7 @@ export const UsersHomePageFooter = (props: UsersHomePageFooterProps): JSX.Elemen
       <div className="grw-user-page-list-m d-edit-none">
         <h2 id="bookmarks-list" className="grw-user-page-header border-bottom pb-2 mb-3">
           <i style={{ fontSize: '1.3em' }} className="fa fa-fw fa-bookmark-o"></i>
-          Bookmarks
+          {t('footer.bookmarks')}
         </h2>
         <div id="user-bookmark-list" className="page-list">
           <BookmarkList userId={creatorId} />
@@ -27,7 +29,7 @@ export const UsersHomePageFooter = (props: UsersHomePageFooterProps): JSX.Elemen
       <div className="grw-user-page-list-m mt-5 d-edit-none">
         <h2 id="recently-created-list" className="grw-user-page-header border-bottom pb-2 mb-3">
           <i id="recent-created-icon" className="mr-1"><RecentlyCreatedIcon /></i>
-          Recently Created
+          {t('footer.recently_created')}
         </h2>
         <div id="user-created-list" className="page-list">
           <RecentCreated userId={creatorId} />

+ 3 - 1
packages/app/src/pages/[[...path]].page.tsx

@@ -20,7 +20,7 @@ import { Comments } from '~/components/Comments';
 import { PageAlerts } from '~/components/PageAlert/PageAlerts';
 // import { useTranslation } from '~/i18n';
 import { PageContentFooter } from '~/components/PageContentFooter';
-import { UsersHomePageFooter } from '~/components/UsersHomePageFooter';
+import { UsersHomePageFooterProps } from '~/components/UsersHomePageFooter';
 import { CrowiRequest } from '~/interfaces/crowi-request';
 // import { renderScriptTagByName, renderHighlightJsStyleTag } from '~/service/cdn-resources-loader';
 // import { useIndentSize } from '~/stores/editor';
@@ -74,6 +74,8 @@ const NotCreatablePage = dynamic(() => import('../components/NotCreatablePage').
 const ForbiddenPage = dynamic(() => import('../components/ForbiddenPage'), { ssr: false });
 const UnsavedAlertDialog = dynamic(() => import('./UnsavedAlertDialog'), { ssr: false });
 const GrowiSubNavigationSwitcher = dynamic(() => import('../components/Navbar/GrowiSubNavigationSwitcher'), { ssr: false });
+const UsersHomePageFooter = dynamic<UsersHomePageFooterProps>(() => import('../components/UsersHomePageFooter')
+  .then(mod => mod.UsersHomePageFooter), { ssr: false });
 
 const logger = loggerFactory('growi:pages:all');