i18n: translate frontend UI strings to English
This commit is contained in:
@@ -30,7 +30,7 @@ export default function IssueDetailPage() {
|
||||
setIssue(data)
|
||||
}
|
||||
|
||||
if (!issue) return <div className="loading">加载中...</div>
|
||||
if (!issue) return <div className="loading">Loading...</div>
|
||||
|
||||
const statusActions: Record<string, string[]> = {
|
||||
open: ['in_progress', 'blocked'],
|
||||
@@ -42,7 +42,7 @@ export default function IssueDetailPage() {
|
||||
|
||||
return (
|
||||
<div className="issue-detail">
|
||||
<button className="btn-back" onClick={() => navigate('/issues')}>← 返回</button>
|
||||
<button className="btn-back" onClick={() => navigate('/issues')}>← Back</button>
|
||||
|
||||
<div className="issue-header">
|
||||
<h2>#{issue.id} {issue.title}</h2>
|
||||
@@ -56,21 +56,21 @@ export default function IssueDetailPage() {
|
||||
|
||||
<div className="issue-body">
|
||||
<div className="section">
|
||||
<h3>描述</h3>
|
||||
<p>{issue.description || '暂无描述'}</p>
|
||||
<h3>Description</h3>
|
||||
<p>{issue.description || 'No description'}</p>
|
||||
</div>
|
||||
|
||||
<div className="section">
|
||||
<h3>详情</h3>
|
||||
<h3>Details</h3>
|
||||
<dl>
|
||||
<dt>创建时间</dt><dd>{dayjs(issue.created_at).format('YYYY-MM-DD HH:mm')}</dd>
|
||||
{issue.due_date && <><dt>截止日期</dt><dd>{dayjs(issue.due_date).format('YYYY-MM-DD')}</dd></>}
|
||||
{issue.updated_at && <><dt>更新时间</dt><dd>{dayjs(issue.updated_at).format('YYYY-MM-DD HH:mm')}</dd></>}
|
||||
<dt>Created</dt><dd>{dayjs(issue.created_at).format('YYYY-MM-DD HH:mm')}</dd>
|
||||
{issue.due_date && <><dt>Due date</dt><dd>{dayjs(issue.due_date).format('YYYY-MM-DD')}</dd></>}
|
||||
{issue.updated_at && <><dt>Updated</dt><dd>{dayjs(issue.updated_at).format('YYYY-MM-DD HH:mm')}</dd></>}
|
||||
</dl>
|
||||
</div>
|
||||
|
||||
<div className="section">
|
||||
<h3>状态变更</h3>
|
||||
<h3>Status changes</h3>
|
||||
<div className="actions">
|
||||
{(statusActions[issue.status] || []).map((s) => (
|
||||
<button key={s} className="btn-transition" onClick={() => transition(s)}>{s}</button>
|
||||
@@ -79,16 +79,16 @@ export default function IssueDetailPage() {
|
||||
</div>
|
||||
|
||||
<div className="section">
|
||||
<h3>评论 ({comments.length})</h3>
|
||||
<h3>Comments ({comments.length})</h3>
|
||||
{comments.map((c) => (
|
||||
<div className="comment" key={c.id}>
|
||||
<div className="comment-meta">用户 #{c.author_id} · {dayjs(c.created_at).format('MM-DD HH:mm')}</div>
|
||||
<div className="comment-meta">User #{c.author_id} · {dayjs(c.created_at).format('MM-DD HH:mm')}</div>
|
||||
<p>{c.content}</p>
|
||||
</div>
|
||||
))}
|
||||
<div className="comment-form">
|
||||
<textarea value={newComment} onChange={(e) => setNewComment(e.target.value)} placeholder="添加评论..." />
|
||||
<button onClick={addComment} disabled={!newComment.trim()}>提交评论</button>
|
||||
<textarea value={newComment} onChange={(e) => setNewComment(e.target.value)} placeholder="Add a comment..." />
|
||||
<button onClick={addComment} disabled={!newComment.trim()}>Submit comment</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user