feat(i18n): localize remaining task panes and create-dialog surfaces (#2326)
Co-authored-by: Kandev Agent <agent@kandev.dev>
This commit is contained in:
@@ -40,6 +40,7 @@ import {
|
||||
ExternalVcsFileLink,
|
||||
useExternalVcsFileStatus,
|
||||
} from "@/components/editors/external-vcs-file-link";
|
||||
import { useTranslation } from "react-i18next";
|
||||
|
||||
interface MarkdownPreviewToolbarProps {
|
||||
path: string;
|
||||
@@ -66,13 +67,14 @@ function MarkdownPreviewToolbar({
|
||||
showExternalVcsLink,
|
||||
onTogglePreview,
|
||||
}: MarkdownPreviewToolbarProps) {
|
||||
const { t } = useTranslation();
|
||||
const fileStatus = useExternalVcsFileStatus(path, sessionId, repositoryName);
|
||||
return (
|
||||
<PanelHeaderBarSplit
|
||||
left={
|
||||
<div className="flex items-center gap-2 text-xs text-muted-foreground">
|
||||
<span className="font-mono">{toRelativePath(path, worktreePath)}</span>
|
||||
<span className="text-xs text-muted-foreground/60">Preview</span>
|
||||
<span className="text-xs text-muted-foreground/60">{t("task:preview")}</span>
|
||||
</div>
|
||||
}
|
||||
right={
|
||||
@@ -92,9 +94,7 @@ function MarkdownPreviewToolbar({
|
||||
{commentsEnabled && commentCount > 0 && (
|
||||
<div className="flex items-center gap-1 px-2 py-1 text-xs text-primary">
|
||||
<IconMessagePlus className="h-3.5 w-3.5" />
|
||||
<span>
|
||||
{commentCount} comment{commentCount > 1 ? "s" : ""}
|
||||
</span>
|
||||
<span>{t("task:commentCount", { count: commentCount })}</span>
|
||||
</div>
|
||||
)}
|
||||
<Tooltip>
|
||||
@@ -109,7 +109,7 @@ function MarkdownPreviewToolbar({
|
||||
<IconCode className="h-4 w-4" />
|
||||
</Button>
|
||||
</TooltipTrigger>
|
||||
<TooltipContent>Show code</TooltipContent>
|
||||
<TooltipContent>{t("task:showCode")}</TooltipContent>
|
||||
</Tooltip>
|
||||
</div>
|
||||
}
|
||||
@@ -179,12 +179,13 @@ function CommentBadge({
|
||||
}: {
|
||||
onClick: (event: React.MouseEvent<HTMLButtonElement>) => void;
|
||||
}) {
|
||||
const { t } = useTranslation();
|
||||
return (
|
||||
<button
|
||||
type="button"
|
||||
className="markdown-preview-comment-badge"
|
||||
data-testid="markdown-preview-comment-badge"
|
||||
aria-label="Edit markdown comment"
|
||||
aria-label={t("task:editMarkdownComment")}
|
||||
onClick={onClick}
|
||||
>
|
||||
<IconMessagePlus className="h-3 w-3" />
|
||||
@@ -280,6 +281,7 @@ function MarkdownPreviewCommentOverlays({
|
||||
overlayRoot: HTMLElement | null;
|
||||
commentState: MarkdownPreviewCommentState;
|
||||
}) {
|
||||
const { t } = useTranslation();
|
||||
if (!commentsEnabled || !overlayRoot) return null;
|
||||
|
||||
return createPortal(
|
||||
@@ -298,7 +300,7 @@ function MarkdownPreviewCommentOverlays({
|
||||
onClick={commentState.openComposer}
|
||||
>
|
||||
<IconMessagePlus className="h-3.5 w-3.5" />
|
||||
Comment
|
||||
{t("task:comment")}
|
||||
</Button>
|
||||
)}
|
||||
{commentState.textSelection && (
|
||||
|
||||
Reference in New Issue
Block a user