diff --git a/apps/geolibre-desktop/src/components/comments/AddCommentDialog.tsx b/apps/geolibre-desktop/src/components/comments/AddCommentDialog.tsx index 3042a5e11e..3951d28aa5 100644 --- a/apps/geolibre-desktop/src/components/comments/AddCommentDialog.tsx +++ b/apps/geolibre-desktop/src/components/comments/AddCommentDialog.tsx @@ -1,5 +1,5 @@ import { useState } from "react"; -import { useTranslation } from "react-i18next"; +import { Trans, useTranslation } from "react-i18next"; import { Button, Dialog, @@ -46,7 +46,7 @@ export function AddCommentDialog({ pendingComment, onSubmit, onCancel }: AddComm e.preventDefault(); if (!text.trim()) return; - const finalName = authorName.trim() || savedName?.trim() || "Author"; + const finalName = authorName.trim() || savedName?.trim() || t("comments.defaultAuthorName"); if (typeof localStorage !== "undefined" && finalName) { try { localStorage.setItem("geolibre_author_name", finalName); @@ -99,15 +99,21 @@ export function AddCommentDialog({ pendingComment, onSubmit, onCancel }: AddComm <> - Anchored to Feature #{String(anchor.featureId)} ({anchor.layerId}) + {t("comments.anchoredToFeature", { + id: String(anchor.featureId), + layer: anchor.layerId, + })} ) : ( <> - Anchored to ( - {lngLat ? `${lngLat[1].toFixed(4)}, ${lngLat[0].toFixed(4)}` : "Map Point"}) + {t("comments.anchoredToPoint", { + coords: lngLat + ? `${lngLat[1].toFixed(4)}, ${lngLat[0].toFixed(4)}` + : t("comments.mapPoint"), + })} )} @@ -135,7 +141,11 @@ export function AddCommentDialog({ pendingComment, onSubmit, onCancel }: AddComm ) : (
- Posting as {savedName} + }} + />
)} @@ -175,7 +185,7 @@ export function AddCommentDialog({ pendingComment, onSubmit, onCancel }: AddComm
@@ -88,7 +88,7 @@ export function CommentThread({ size="icon" className="h-7 w-7 text-muted-foreground hover:text-foreground" onClick={() => onZoomTo(comment)} - title="Zoom to location" + title={t("comments.zoomToLocation")} > @@ -106,7 +106,7 @@ export function CommentThread({ : "text-muted-foreground hover:text-emerald-500", )} onClick={() => onToggleResolve(comment.id, !comment.resolved)} - title={comment.resolved ? "Reopen comment thread" : "Mark as resolved"} + title={comment.resolved ? t("comments.reopenThread") : t("comments.markResolved")} > {comment.resolved ? ( @@ -128,7 +128,7 @@ export function CommentThread({ onDelete(comment.id); } }} - title="Delete comment thread" + title={t("comments.deleteThread")} > @@ -143,18 +143,21 @@ export function CommentThread({ <> - Feature #{String(comment.anchor.featureId)} ({comment.anchor.layerId}) + {t("comments.anchorFeature", { + id: String(comment.anchor.featureId), + layer: comment.anchor.layerId, + })} ) : ( <> - Point ( - {comment.anchor.lngLat - ? `${comment.anchor.lngLat[1].toFixed(4)}, ${comment.anchor.lngLat[0].toFixed(4)}` - : "Map"} - ) + {t("comments.anchorPoint", { + coords: comment.anchor.lngLat + ? `${comment.anchor.lngLat[1].toFixed(4)}, ${comment.anchor.lngLat[0].toFixed(4)}` + : t("comments.anchorMap"), + })} )} @@ -174,7 +177,7 @@ export function CommentThread({ style={{ backgroundColor: reply.author?.color || "#3b82f6" }} /> - {reply.author?.name || "Author"} + {reply.author?.name || t("comments.defaultAuthorName")} {new Date(reply.createdAt).toLocaleDateString(undefined, { @@ -202,14 +205,14 @@ export function CommentThread({ onClick={() => setIsReplying(true)} > - Reply + {t("comments.reply")} ) : (