読み込み中...
+ ?
@@ -97,7 +99,7 @@ const HelpChangesPage: FC = () => {
{entry.pred != null && (
- 差分
+ {label ('shared:actions.diff')}
)}
|
diff --git a/frontend/src/pages/help/HelpDetailPage.tsx b/frontend/src/pages/help/HelpDetailPage.tsx
index 11f234c..256c1e9 100644
--- a/frontend/src/pages/help/HelpDetailPage.tsx
+++ b/frontend/src/pages/help/HelpDetailPage.tsx
@@ -12,6 +12,7 @@ import { getHelpArticle,
resolveHelpLanguage } from '@/lib/help'
import { localeLanguage } from '@/lib/locales'
import { useLocale } from '@/lib/useLocale'
+import { useUITranslation } from '@/lib/useUITranslation'
import { dateString } from '@/lib/utils'
import { helpKeys } from '@/lib/queryKeys'
import NotFound from '@/pages/NotFound'
@@ -20,6 +21,7 @@ import type { FC } from 'react'
const HelpDetailPage: FC = () => {
+ const { message, label } = useUITranslation ('help')
const locale = useLocale ()
const { identifier = '' } = useParams ()
const location = useLocation ()
@@ -71,7 +73,9 @@ const HelpDetailPage: FC = () => {
return (
- {current?.title || identifier} ヘルプ | {SITE_TITLE}
+
+ {message ('articleTitle', { title: current?.title || identifier }).text} | {SITE_TITLE}
+
{requestedEdition && (
@@ -81,9 +85,9 @@ const HelpDetailPage: FC = () => {
? (
- < 古
+ {label ('shared:actions.old')}
)
- : '(最古)'}
+ : label ('shared:actions.oldest')}
{editionDate != null && dateString (editionDate, 'hour')}
@@ -94,13 +98,13 @@ const HelpDetailPage: FC = () => {
? (
- 新 >
+ {label ('shared:actions.new')}
)
- : '(最新)'}
+ : label ('shared:actions.latest')}
)}
- {Content ? : Loading... }
+ {Content ? : {label ('common:loading')} }
)
}
diff --git a/frontend/src/pages/help/HelpDiffPage.tsx b/frontend/src/pages/help/HelpDiffPage.tsx
index 53ef0b4..09ca2b5 100644
--- a/frontend/src/pages/help/HelpDiffPage.tsx
+++ b/frontend/src/pages/help/HelpDiffPage.tsx
@@ -9,6 +9,7 @@ import { SITE_TITLE } from '@/config'
import { getHelpArticle, getHelpDiff, resolveHelpLanguage } from '@/lib/help'
import { localeLanguage } from '@/lib/locales'
import { useLocale } from '@/lib/useLocale'
+import { useUITranslation } from '@/lib/useUITranslation'
import { helpKeys } from '@/lib/queryKeys'
import { cn } from '@/lib/utils'
import NotFound from '@/pages/NotFound'
@@ -19,6 +20,7 @@ const markers = { added: '+ ', removed: '- ', unchanged: ' ' }
const HelpDiffPage: FC = () => {
+ const { message } = useUITranslation ('help')
const locale = useLocale ()
const { identifier = '' } = useParams ()
const [searchParams] = useSearchParams ()
@@ -47,7 +49,7 @@ const HelpDiffPage: FC = () => {
return (
- {`ヘルプ 差分: ${ title } | ${ SITE_TITLE }`}
+ {message ('diffTitle', { title }).text} | {SITE_TITLE}
{title}
diff --git a/frontend/src/pages/help/HelpListPage.tsx b/frontend/src/pages/help/HelpListPage.tsx
index 0bbf5c1..48a5a1c 100644
--- a/frontend/src/pages/help/HelpListPage.tsx
+++ b/frontend/src/pages/help/HelpListPage.tsx
@@ -17,6 +17,7 @@ import { compareHelpEditions,
normaliseHelpSearchText } from '@/lib/help'
import { localeLanguage } from '@/lib/locales'
import { useLocale } from '@/lib/useLocale'
+import { useUITranslation } from '@/lib/useUITranslation'
import { helpKeys } from '@/lib/queryKeys'
import { LIST_LIMIT_OPTIONS } from '@/lib/settings'
import { dateString, inputClass } from '@/lib/utils'
@@ -32,6 +33,7 @@ const defaultDirection: Record = {
const HelpSearchPage: FC = () => {
+ const { message, label } = useUITranslation ('help')
const language = localeLanguage (useLocale ())
const [searchParams, setSearchParams] = useSearchParams ()
const pageValue = searchParams.get ('page') ?? '1'
@@ -111,14 +113,14 @@ const HelpSearchPage: FC = () => {
return (
- {`ヘルプ | ${ SITE_TITLE }`}
+ {message ('title').text} | {SITE_TITLE}
- ヘルプ検索
+ {label ('search')}
{loading
- ? 読み込み中...
+ ? {label ('shared:messages.loading')}
: (error
? {error.message}
: (
- {results.length} 件
+
+ {label ('shared:labels.resultsCount', { count: results.length })}
+
@@ -170,14 +174,14 @@ const HelpSearchPage: FC = () => {
|
by="title"
- label="タイトル"
+ label={label ('shared:labels.title')}
currentOrder={order}
defaultDirection={defaultDirection}/>
|
by="updated_at"
- label="有効開始年月日"
+ label={label ('effectiveSince')}
currentOrder={order}
defaultDirection={defaultDirection}/>
|
@@ -206,7 +210,7 @@ const HelpSearchPage: FC = () => {
{totalPages > 0 && }
- {results.length === 0 && 該当する記事がありません. }
+ {results.length === 0 && {label ('empty')} }
))}
)
}
diff --git a/frontend/src/pages/tags/TagListPage.tsx b/frontend/src/pages/tags/TagListPage.tsx
index 5f160b3..ad7d512 100644
--- a/frontend/src/pages/tags/TagListPage.tsx
+++ b/frontend/src/pages/tags/TagListPage.tsx
@@ -8,7 +8,6 @@ import LocalisedText from '@/components/LocalisedText'
import PrefetchLink from '@/components/PrefetchLink'
import SortHeader from '@/components/SortHeader'
import TagLink from '@/components/TagLink'
-import TranslatedText from '@/components/TranslatedText'
import DateTimeField from '@/components/common/DateTimeField'
import FormField from '@/components/common/FormField'
import PageTitle from '@/components/common/PageTitle'
@@ -76,8 +75,7 @@ const parseOrder = (value: string | null): FetchTagsOrder | null => {
const TagListPage: FC = () => {
const locale = useLocale ()
- const { message } = useUITranslation ('tags')
- const label = (key: string) =>
+ const { message, label } = useUITranslation ('tags')
const behaviourSettings = useClientBehaviourSettings ()
const animationMode = behaviourSettings.animation ?? 'normal'
const location = useLocation ()
@@ -265,7 +263,9 @@ const TagListPage: FC = () => {
className={inputClass (invalid)}>
{CATEGORIES.map (cat => (
- ))}
diff --git a/frontend/src/pages/wiki/WikiDetailPage.tsx b/frontend/src/pages/wiki/WikiDetailPage.tsx
index 5b4421f..5cd06a6 100644
--- a/frontend/src/pages/wiki/WikiDetailPage.tsx
+++ b/frontend/src/pages/wiki/WikiDetailPage.tsx
@@ -4,6 +4,7 @@ import { Helmet } from 'react-helmet-async'
import { useLocation, useParams } from 'react-router-dom'
import { useLocale, useLocaleNavigate } from '@/lib/useLocale'
+import { useUITranslation } from '@/lib/useUITranslation'
import PostList from '@/components/PostList'
import PrefetchLink from '@/components/PrefetchLink'
import TagLink from '@/components/TagLink'
@@ -25,6 +26,7 @@ import type { Tag } from '@/types'
const WikiDetailPage: FC = () => {
+ const { message, label } = useUITranslation ('shared')
const locale = useLocale ()
const params = useParams ()
const title = params.title ?? ''
@@ -128,7 +130,8 @@ const WikiDetailPage: FC = () => {
return (
- {`${ effectiveTitle }${ deprecated ? '(廃止)' : '' } Wiki | ${ SITE_TITLE }`}
+ {`${ effectiveTitle }${ deprecated
+ ? message ('labels.deprecatedSuffix').text : '' } Wiki | ${ SITE_TITLE }`}
{!(wikiPage?.body) && }
@@ -137,15 +140,15 @@ const WikiDetailPage: FC = () => {
border border-gray-700 rounded px-2 py-1 mb-4">
{wikiPage.pred ? (
- < 古
- ) : '(最古)'}
+ {label ('actions.old')}
+ ) : label ('actions.oldest')}
{wikiPage.updatedAt}
{wikiPage.succ ? (
- 新 >
- ) : '(最新)'}
+ {label ('actions.new')}
+ ) : label ('actions.latest')}
)}
@@ -156,14 +159,14 @@ const WikiDetailPage: FC = () => {
withWiki={false}
withCount={false}
{...(version && { to: `/wiki/${ encodeURIComponent (title) }` })}/>
- {deprecated && (廃止)}
+ {deprecated && label ('labels.deprecatedSuffix')}
- {waiting ? Loading... : }
+ {waiting ? label ('common:loading') : }
{(!(version) && posts.length > 0) && (
-
+
diff --git a/frontend/src/pages/wiki/WikiDiffPage.tsx b/frontend/src/pages/wiki/WikiDiffPage.tsx
index b30533e..5850509 100644
--- a/frontend/src/pages/wiki/WikiDiffPage.tsx
+++ b/frontend/src/pages/wiki/WikiDiffPage.tsx
@@ -5,6 +5,7 @@ import { Helmet } from 'react-helmet-async'
import { useLocation, useParams } from 'react-router-dom'
import { useLocale } from '@/lib/useLocale'
+import { useUITranslation } from '@/lib/useUITranslation'
import PageTitle from '@/components/common/PageTitle'
import MainArea from '@/components/layout/MainArea'
import { SITE_TITLE } from '@/config'
@@ -15,6 +16,7 @@ import type { WikiPageDiff } from '@/types'
const WikiDiffPage: FC = () => {
+ const { message, label } = useUITranslation ('wiki')
const locale = useLocale ()
const { id } = useParams ()
@@ -26,7 +28,8 @@ const WikiDiffPage: FC = () => {
const from = query.get ('from')
const to = query.get ('to')
const displayTitle = diff
- ? `${ diff.title }${ diff.deprecatedAt != null ? '(廃止)' : '' }`
+ ? `${ diff.title }${ diff.deprecatedAt != null
+ ? message ('shared:labels.deprecatedSuffix').text : '' }`
: ''
useEffect (() => {
@@ -38,7 +41,7 @@ const WikiDiffPage: FC = () => {
return (
- {`Wiki 差分: ${ displayTitle } | ${ SITE_TITLE }`}
+ {message ('diffTitle', { title: displayTitle }).text} | {SITE_TITLE}
{displayTitle}
@@ -49,7 +52,7 @@ const WikiDiffPage: FC = () => {
d.type === 'removed' && 'bg-red-200 dark:bg-red-800')}>
{d.content}
)))
- : 'Loading...'}
+ : label ('common:loading')}
)
}
diff --git a/frontend/src/pages/wiki/WikiEditPage.tsx b/frontend/src/pages/wiki/WikiEditPage.tsx
index ef41c70..bd19ea8 100644
--- a/frontend/src/pages/wiki/WikiEditPage.tsx
+++ b/frontend/src/pages/wiki/WikiEditPage.tsx
@@ -6,6 +6,7 @@ import MdEditor from 'react-markdown-editor-lite'
import { useParams } from 'react-router-dom'
import { useLocale, useLocaleNavigate } from '@/lib/useLocale'
+import { useUITranslation } from '@/lib/useUITranslation'
import FieldError from '@/components/common/FieldError'
import FormField from '@/components/common/FormField'
import MainArea from '@/components/layout/MainArea'
@@ -37,6 +38,7 @@ type WikiFormField = 'title' | 'body'
const WikiEditPage: FC = ({ user }) => {
+ const { message, label } = useUITranslation ('wiki')
const locale = useLocale ()
const editable = canEditContent (user)
@@ -66,13 +68,14 @@ const WikiEditPage: FC = ({ user }) => {
qc.setQueryData (wikiKeys.show (title, { }, locale),
(prev: WikiPage) => ({ ...prev, title, body }))
qc.invalidateQueries ({ queryKey: wikiKeys.root })
- toast ({ title: '投稿成功!' })
+ toast ({ title: label ('shared:messages.postSuccess') })
navigate (`/wiki/${ title }`)
}
catch (e)
{
applyValidationError (e)
- toast ({ title: '投稿失敗', description: '入力を確認してください。' })
+ toast ({ title: label ('shared:messages.postFailed'),
+ description: label ('shared:messages.checkInputModern') })
}
}
@@ -95,18 +98,18 @@ const WikiEditPage: FC = ({ user }) => {
return (
- {`Wiki ページを編輯 | ${ SITE_TITLE }`}
+ {`${ message ('editPage').text } | ${ SITE_TITLE }`}
- Wiki ページを編輯
+ {label ('editPage')}
- {loading ? 'Loading...' : (
+ {loading ? label ('common:loading') : (
<>
{/* タイトル */}
{/* TODO: タグ補完 */}
-
+
{({ describedBy, invalid }) => (
= ({ user }) => {
{/* 本文 */}
-
+
{() => (
= ({ user }) => {
{/* 送信 */}
>)}
diff --git a/frontend/src/pages/wiki/WikiHistoryPage.tsx b/frontend/src/pages/wiki/WikiHistoryPage.tsx
index 2d072e7..53a6683 100644
--- a/frontend/src/pages/wiki/WikiHistoryPage.tsx
+++ b/frontend/src/pages/wiki/WikiHistoryPage.tsx
@@ -5,6 +5,7 @@ import { Helmet } from 'react-helmet-async'
import { useLocation } from 'react-router-dom'
import { useLocale } from '@/lib/useLocale'
+import { useUITranslation } from '@/lib/useUITranslation'
import PrefetchLink from '@/components/PrefetchLink'
import PageTitle from '@/components/common/PageTitle'
import MainArea from '@/components/layout/MainArea'
@@ -16,6 +17,7 @@ import type { WikiPageChange } from '@/types'
const WikiHistoryPage: FC = () => {
+ const { message, label } = useUITranslation ('wiki')
const locale = useLocale ()
const [changes, setChanges] = useState ([])
@@ -32,18 +34,18 @@ const WikiHistoryPage: FC = () => {
return (
- {`Wiki 変更履歴 | ${ SITE_TITLE }`}
+ {message ('history').text} | {SITE_TITLE}
- Wiki 履歴
+ {label ('historyHeading')}
|
- タイトル |
- 変更 |
- 日時 |
+ {label ('shared:labels.title')} |
+ {label ('change')} |
+ {label ('dateTime')} |
@@ -53,7 +55,7 @@ const WikiHistoryPage: FC = () => {
{change.pred != null && (
- 差分
+ {label ('shared:actions.diff')}
)}
@@ -61,10 +63,10 @@ const WikiHistoryPage: FC = () => {
to={`/wiki/${ encodeURIComponent (change.wikiPage.title) }?version=${ change.revisionId }`}>
{change.wikiPage.title}
- {change.wikiPage.deprecatedAt != null && (廃止)}
+ {change.wikiPage.deprecatedAt != null && label ('shared:labels.deprecatedSuffix')}
|
- {change.pred == null ? '新規' : '更新'}
+ {change.pred == null ? label ('navigation:create') : label ('shared:actions.update')}
|
diff --git a/frontend/src/pages/wiki/WikiNewPage.tsx b/frontend/src/pages/wiki/WikiNewPage.tsx
index 7b107fa..ae88928 100644
--- a/frontend/src/pages/wiki/WikiNewPage.tsx
+++ b/frontend/src/pages/wiki/WikiNewPage.tsx
@@ -7,6 +7,7 @@ import { useLocation } from 'react-router-dom'
import 'react-markdown-editor-lite/lib/index.css'
import { useLocale, useLocaleNavigate } from '@/lib/useLocale'
+import { useUITranslation } from '@/lib/useUITranslation'
import FieldError from '@/components/common/FieldError'
import FormField from '@/components/common/FormField'
import MainArea from '@/components/layout/MainArea'
@@ -36,6 +37,7 @@ type WikiFormField = 'title' | 'body'
const WikiNewPage: FC = ({ user }) => {
+ const { message, label } = useUITranslation ('wiki')
const locale = useLocale ()
const editable = canEditContent (user)
@@ -67,13 +69,14 @@ const WikiNewPage: FC = ({ user }) => {
await Promise.all ([
qc.invalidateQueries ({ queryKey: wikiKeys.root }),
qc.invalidateQueries ({ queryKey: tagsKeys.root })])
- toast ({ title: '投稿成功!' })
+ toast ({ title: label ('shared:messages.postSuccess') })
navigate (`/wiki/${ encodeURIComponent (data.title) }`)
}
catch (e)
{
applyValidationError (e)
- toast ({ title: '投稿失敗', description: '入力を確認してください。' })
+ toast ({ title: label ('shared:messages.postFailed'),
+ description: label ('shared:messages.checkInputModern') })
}
}
@@ -83,15 +86,15 @@ const WikiNewPage: FC = ({ user }) => {
return (
- {`新規 Wiki ページ | ${ SITE_TITLE }`}
+ {`${ message ('newPage').text } | ${ SITE_TITLE }`}
- 新規 Wiki ページ
+ {label ('newPage')}
{/* タイトル */}
{/* TODO: タグ補完 */}
-
+
{({ describedBy, invalid }) => (
= ({ user }) => {
{/* 本文 */}
-
+
{() => (
= ({ user }) => {
{/* 送信 */}
)
diff --git a/frontend/src/pages/wiki/WikiSearchPage.tsx b/frontend/src/pages/wiki/WikiSearchPage.tsx
index 97dc047..2f88ddb 100644
--- a/frontend/src/pages/wiki/WikiSearchPage.tsx
+++ b/frontend/src/pages/wiki/WikiSearchPage.tsx
@@ -2,6 +2,7 @@ import { useEffect, useState } from 'react'
import { Helmet } from 'react-helmet-async'
import { useLocale } from '@/lib/useLocale'
+import { useUITranslation } from '@/lib/useUITranslation'
import PrefetchLink from '@/components/PrefetchLink'
import FormField from '@/components/common/FormField'
import PageTitle from '@/components/common/PageTitle'
@@ -16,6 +17,7 @@ import type { WikiPage } from '@/types'
const WikiSearchPage: FC = () => {
+ const { label } = useUITranslation ('shared')
const locale = useLocale ()
const [title, setTitle] = useState ('')
const [text, setText] = useState ('')
@@ -46,7 +48,7 @@ const WikiSearchPage: FC = () => {
Wiki
@@ -77,8 +79,8 @@ const WikiSearchPage: FC = () => {
- | タイトル |
- 最終更新 |
+ {label ('labels.title')} |
+ {label ('labels.lastUpdated')} |
@@ -89,7 +91,7 @@ const WikiSearchPage: FC = () => {
{page.title}
- {page.deprecatedAt != null && (廃止)}
+ {page.deprecatedAt != null && label ('labels.deprecatedSuffix')}
{dateString (page.updatedAt)}
| | |