Răsfoiți Sursa

Add translation auther info

satof3 2 ani în urmă
părinte
comite
24ff35018b

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

@@ -174,6 +174,10 @@
   "custom_navigation": {
   "custom_navigation": {
     "no_pages_under_this_page": "There are no pages under this page."
     "no_pages_under_this_page": "There are no pages under this page."
   },
   },
+  "author_info": {
+    "created_at": "Created at",
+    "last_revision_posted_at": "Last revision posted at"
+  },
   "installer": {
   "installer": {
     "tab": "Create account",
     "tab": "Create account",
     "title": "Installer",
     "title": "Installer",

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

@@ -175,6 +175,10 @@
   "custom_navigation": {
   "custom_navigation": {
     "no_pages_under_this_page": "このページの配下にはページが存在しません。"
     "no_pages_under_this_page": "このページの配下にはページが存在しません。"
   },
   },
+  "author_info": {
+    "created_at": "作成日",
+    "last_revision_posted_at": "最終更新日"
+  },
   "installer": {
   "installer": {
     "tab": "アカウント作成",
     "tab": "アカウント作成",
     "title": "インストーラー",
     "title": "インストーラー",

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

@@ -181,6 +181,10 @@
   "custom_navigation": {
   "custom_navigation": {
     "no_pages_under_this_page": "There are no pages under this page."
     "no_pages_under_this_page": "There are no pages under this page."
   },
   },
+  "author_info": {
+    "created_at": "Created at",
+    "last_revision_posted_at": "Last revision posted at"
+  },
   "installer": {
   "installer": {
     "tab": "创建账户",
     "tab": "创建账户",
     "title": "安装",
     "title": "安装",

+ 4 - 2
apps/app/src/components/AuthorInfo/AuthorInfo.tsx

@@ -4,6 +4,7 @@ import type { IUser } from '@growi/core';
 import { pagePathUtils } from '@growi/core/dist/utils';
 import { pagePathUtils } from '@growi/core/dist/utils';
 import { UserPicture } from '@growi/ui/dist/components';
 import { UserPicture } from '@growi/ui/dist/components';
 import { format } from 'date-fns';
 import { format } from 'date-fns';
+import { useTranslation } from 'next-i18next';
 import Link from 'next/link';
 import Link from 'next/link';
 
 
 
 
@@ -18,6 +19,7 @@ export type AuthorInfoProps = {
 }
 }
 
 
 export const AuthorInfo = (props: AuthorInfoProps): JSX.Element => {
 export const AuthorInfo = (props: AuthorInfoProps): JSX.Element => {
+  const { t } = useTranslation();
   const {
   const {
     date, user, mode = 'create', locate = 'subnav',
     date, user, mode = 'create', locate = 'subnav',
   } = props;
   } = props;
@@ -31,8 +33,8 @@ export const AuthorInfo = (props: AuthorInfoProps): JSX.Element => {
     ? 'Created by'
     ? 'Created by'
     : 'Updated by';
     : 'Updated by';
   const infoLabelForFooter = mode === 'create'
   const infoLabelForFooter = mode === 'create'
-    ? 'Created at'
-    : 'Last revision posted at';
+    ? `${t('author_info.created_at')}`
+    : `${t('author_info.last_revision_posted_at')}`;
   const userLabel = user != null
   const userLabel = user != null
     ? (
     ? (
       <Link href={pagePathUtils.userHomepagePath(user)} prefetch={false}>
       <Link href={pagePathUtils.userHomepagePath(user)} prefetch={false}>