From 78c3839ae7e57ce2e6dfe5c70419d6d62a7670dc Mon Sep 17 00:00:00 2001 From: Philipinho <16838612+Philipinho@users.noreply.github.com> Date: Sat, 7 Mar 2026 23:22:46 +0000 Subject: [PATCH] fix translations --- .../public/locales/en-US/translation.json | 22 ++++++++-------- .../src/ee/ai/components/mcp-settings.tsx | 19 ++++++-------- .../src/ee/api-key/pages/user-api-keys.tsx | 13 +++++----- .../ee/api-key/pages/workspace-api-keys.tsx | 14 +++++------ .../components/notification-item.tsx | 25 ++++++++++--------- 5 files changed, 45 insertions(+), 48 deletions(-) diff --git a/apps/client/public/locales/en-US/translation.json b/apps/client/public/locales/en-US/translation.json index 5370cc2a..fbb1f173 100644 --- a/apps/client/public/locales/en-US/translation.json +++ b/apps/client/public/locales/en-US/translation.json @@ -629,18 +629,16 @@ "MCP": "MCP", "Model Context Protocol (MCP)": "Model Context Protocol (MCP)", "Enable the MCP server to allow AI assistants and tools to interact with your workspace content.": "Enable the MCP server to allow AI assistants and tools to interact with your workspace content.", - "MCP requires a paid plan. Visit docmost.com for more information.": "MCP requires a paid plan. Visit docmost.com for more information.", - "MCP documentation": "MCP documentation", + "MCP is only available in the Docmost enterprise edition. Contact sales@docmost.com.": "MCP is only available in the Docmost enterprise edition. Contact sales@docmost.com.", "MCP Server URL": "MCP Server URL", "Use your API key for authentication. You can manage API keys in your account settings.": "Use your API key for authentication. You can manage API keys in your account settings.", "Supported tools": "Supported tools", "Your workspace has MCP enabled. Use your API key to connect AI assistants.": "Your workspace has MCP enabled. Use your API key to connect AI assistants.", "MCP server URL:": "MCP server URL:", "Learn more": "Learn more", - "View the": "View the", - "for usage details.": "for usage details.", - "for setup instructions.": "for setup instructions.", - "API documentation": "API documentation", + "Manage API keys for all users in the workspace. View the API documentation for usage details.": "Manage API keys for all users in the workspace. View the API documentation for usage details.", + "View the API documentation for usage details.": "View the API documentation for usage details.", + "View the MCP documentation.": "View the MCP documentation.", "Sources": "Sources", "AI Answers not available for attachments": "AI Answers not available for attachments", "No answer available": "No answer available", @@ -655,12 +653,12 @@ "Mark all as read": "Mark all as read", "Mark as read": "Mark as read", "More options": "More options", - "mentioned you in a comment": "mentioned you in a comment", - "commented on a page": "commented on a page", - "resolved a comment": "resolved a comment", - "mentioned you on a page": "mentioned you on a page", - "gave you edit access to a page": "gave you edit access to a page", - "gave you view access to a page": "gave you view access to a page", + "{{name}} mentioned you in a comment": "{{name}} mentioned you in a comment", + "{{name}} commented on a page": "{{name}} commented on a page", + "{{name}} resolved a comment": "{{name}} resolved a comment", + "{{name}} mentioned you on a page": "{{name}} mentioned you on a page", + "{{name}} gave you edit access to a page": "{{name}} gave you edit access to a page", + "{{name}} gave you view access to a page": "{{name}} gave you view access to a page", "Today": "Today", "Yesterday": "Yesterday", "This week": "This week", diff --git a/apps/client/src/ee/ai/components/mcp-settings.tsx b/apps/client/src/ee/ai/components/mcp-settings.tsx index b09ee1b2..e7cc2234 100644 --- a/apps/client/src/ee/ai/components/mcp-settings.tsx +++ b/apps/client/src/ee/ai/components/mcp-settings.tsx @@ -13,7 +13,7 @@ import { import { useAtom } from "jotai"; import { workspaceAtom } from "@/features/user/atoms/current-user-atom.ts"; import React, { useState } from "react"; -import { useTranslation } from "react-i18next"; +import { Trans, useTranslation } from "react-i18next"; import { updateWorkspace } from "@/features/workspace/services/workspace-service.ts"; import { notifications } from "@mantine/notifications"; import { useHasFeature } from "@/ee/hooks/use-feature"; @@ -51,7 +51,7 @@ export default function McpSettings() { {!hasAccess && ( } title={upgradeLabel} color="blue"> {t( - "MCP requires a paid plan. Visit docmost.com for more information.", + "MCP is only available in the Docmost enterprise edition. Contact sales@docmost.com.", )} )} @@ -63,15 +63,12 @@ export default function McpSettings() { {t( "Enable the MCP server to allow AI assistants and tools to interact with your workspace content.", )}{" "} - {t("View the")}{" "} - - {t("MCP documentation")} - - . + , + }} + /> diff --git a/apps/client/src/ee/api-key/pages/user-api-keys.tsx b/apps/client/src/ee/api-key/pages/user-api-keys.tsx index e4951805..c305f4af 100644 --- a/apps/client/src/ee/api-key/pages/user-api-keys.tsx +++ b/apps/client/src/ee/api-key/pages/user-api-keys.tsx @@ -2,7 +2,7 @@ import React, { useState } from "react"; import { Anchor, Alert, Button, Group, Space, Text } from "@mantine/core"; import { IconInfoCircle } from "@tabler/icons-react"; import { Helmet } from "react-helmet-async"; -import { useTranslation } from "react-i18next"; +import { Trans, useTranslation } from "react-i18next"; import SettingsTitle from "@/components/settings/settings-title"; import { getAppName, getAppUrl } from "@/lib/config"; import { ApiKeyTable } from "@/ee/api-key/components/api-key-table"; @@ -58,11 +58,12 @@ export default function UserApiKeys() { - {t("View the")}{" "} - - {t("API documentation")} - {" "} - {t("for usage details.")} + , + }} + /> {mcpEnabled && canCreate && ( diff --git a/apps/client/src/ee/api-key/pages/workspace-api-keys.tsx b/apps/client/src/ee/api-key/pages/workspace-api-keys.tsx index 155f7651..8476f445 100644 --- a/apps/client/src/ee/api-key/pages/workspace-api-keys.tsx +++ b/apps/client/src/ee/api-key/pages/workspace-api-keys.tsx @@ -1,7 +1,7 @@ import React, { useState } from "react"; import { Anchor, Button, Divider, Group, Space, Text } from "@mantine/core"; import { Helmet } from "react-helmet-async"; -import { useTranslation } from "react-i18next"; +import { Trans, useTranslation } from "react-i18next"; import SettingsTitle from "@/components/settings/settings-title"; import { getAppName } from "@/lib/config"; import { ApiKeyTable } from "@/ee/api-key/components/api-key-table"; @@ -56,12 +56,12 @@ export default function WorkspaceApiKeys() { - {t("Manage API keys for all users in the workspace.")}{" "} - {t("View the")}{" "} - - {t("API documentation")} - {" "} - {t("for usage details.")} + , + }} + /> diff --git a/apps/client/src/features/notification/components/notification-item.tsx b/apps/client/src/features/notification/components/notification-item.tsx index c041dd48..0d7db515 100644 --- a/apps/client/src/features/notification/components/notification-item.tsx +++ b/apps/client/src/features/notification/components/notification-item.tsx @@ -12,7 +12,7 @@ import { } from "@tabler/icons-react"; import { CustomAvatar } from "@/components/ui/custom-avatar"; import { INotification } from "../types/notification.types"; -import { useTranslation } from "react-i18next"; +import { Trans, useTranslation } from "react-i18next"; import { useNavigate } from "react-router-dom"; import { useState } from "react"; import { useMarkReadMutation } from "../queries/notification-query"; @@ -36,20 +36,20 @@ export function NotificationItem({ const isUnread = !notification.readAt; - const getNotificationMessage = (): string => { + const getNotificationMessageKey = (): string => { switch (notification.type) { case "comment.user_mention": - return t("mentioned you in a comment"); + return "{{name}} mentioned you in a comment"; case "comment.created": - return t("commented on a page"); + return "{{name}} commented on a page"; case "comment.resolved": - return t("resolved a comment"); + return "{{name}} resolved a comment"; case "page.user_mention": - return t("mentioned you on a page"); + return "{{name}} mentioned you on a page"; case "page.permission_granted": return notification.data?.role === "writer" - ? t("gave you edit access to a page") - : t("gave you view access to a page"); + ? "{{name}} gave you edit access to a page" + : "{{name}} gave you view access to a page"; default: return ""; } @@ -95,10 +95,11 @@ export function NotificationItem({
- - {notification.actor?.name} - {" "} - {getNotificationMessage()} + }} + /> {notification.page && (