Skip to content

Linger is An Open-Source Personal Agent That Runs Fully on Your PC. We aim to break Big Tech’s grip on AI by bringing powerful local AI to everyday computers through efficient model–harness co-design, so everyone can run their own.

feat(web): translate the Connectors pages

Kilyn7df84a8e0b85
diff --git a/apps/web/src/features/apps/agent-connectors.tsx b/apps/web/src/features/apps/agent-connectors.tsx
index 14da5cb8..3a4ba8b9 100644
--- a/apps/web/src/features/apps/agent-connectors.tsx
+++ b/apps/web/src/features/apps/agent-connectors.tsx
@@ -19,6 +19,9 @@ import type {
TeamHubExternalApp,
TeamHubExternalConnection,
} from "@/features/teamhub/teamhub-types";
+import { commonMessages } from "@/i18n/common.messages";
+import { useT } from "@/i18n/use-translation";
+
import { AppLogo } from "./app-logo";
import {
establishedExternalConnections,
@@ -30,8 +33,7 @@ import {
externalConnectionAgentAccessQueryKey,
externalConnectionAgentAccessQueryOptions,
} from "./connected-apps-queries";
-
-const GROUP_LABEL = "Accounts this Agent can use";
+import { connectorMessages as m } from "./connectors.messages";
export function AgentConnectors({
agentActorId,
@@ -41,21 +43,23 @@ export function AgentConnectors({
tenantId: string;
}) {
const { client } = useTeamHubRuntime();
+ const t = useT();
const apps = useQuery(externalAppsQueryOptions(client));
const connections = useQuery(externalConnectionsQueryOptions(client));
+ const groupLabel = t(m.agentAccounts);
if (apps.isPending || connections.isPending)
return (
- <SettingsGroup ariaLabel={GROUP_LABEL}>
+ <SettingsGroup ariaLabel={groupLabel}>
<SettingsRow icon={<Icon icon={PlugSocketIcon} size={16} />}>
<p className="flex-1 text-[14px] text-muted-foreground" role="status">
- Loading connectors...
+ {t(m.loadingConnectors)}
</p>
</SettingsRow>
</SettingsGroup>
);
if (apps.error || connections.error)
return (
- <SettingsGroup ariaLabel={GROUP_LABEL}>
+ <SettingsGroup ariaLabel={groupLabel}>
<SettingsRow icon={<Icon icon={PlugSocketIcon} size={16} />}>
<p
className="min-w-0 flex-1 text-[14px] text-app-danger"
@@ -70,7 +74,7 @@ export function AgentConnectors({
}
>
<Icon icon={RefreshIcon} size={14} />
- Retry
+ {t(commonMessages.retry)}
</Button>
</SettingsRow>
</SettingsGroup>
@@ -88,7 +92,7 @@ export function AgentConnectors({
const appsPath = `/t/${tenantId}/apps`;
return (
<div className="flex flex-col gap-5">
- <SettingsGroup ariaLabel={GROUP_LABEL}>
+ <SettingsGroup ariaLabel={groupLabel}>
{connected.length ? (
connected.map(({ app, accounts }) => (
<section key={app.key} aria-label={app.display_name}>
@@ -106,7 +110,7 @@ export function AgentConnectors({
))
) : (
<SettingsRow icon={<Icon icon={PlugSocketIcon} size={16} />}>
- <SettingsRowText muted title="No connected accounts yet." />
+ <SettingsRowText muted title={t(m.noConnectedAccounts)} />
</SettingsRow>
)}
</SettingsGroup>
@@ -117,7 +121,7 @@ export function AgentConnectors({
>
<SettingsRow icon={<Icon icon={PlusSignIcon} size={16} />}>
<span className="flex-1 text-[14px] font-medium text-foreground">
- Connect another app
+ {t(m.connectAnotherApp)}
</span>
<Icon
className="text-muted-foreground/70"
@@ -146,6 +150,7 @@ function AgentConnectionAccess({
}) {
const { client } = useTeamHubRuntime();
const queryClient = useQueryClient();
+ const t = useT();
const access = useQuery({
...externalConnectionAgentAccessQueryOptions(client, connection.id),
enabled: connection.status === "active",
@@ -177,14 +182,16 @@ function AgentConnectionAccess({
<span
className={connection.status === "pending" ? "town-shimmer-text" : ""}
>
- {connection.status === "pending"
- ? "Connection pending"
- : "Connection needs attention"}
+ {t(
+ connection.status === "pending"
+ ? m.connectionPending
+ : m.connectionNeedsAttention,
+ )}
</span>
) : access.data && !agent ? (
- "Access unavailable for this Agent"
+ t(m.accessUnavailable)
) : (
- accountIdentityText(connection.provider, connection.identity_label)
+ accountIdentityText(connection.provider, connection.identity_label, t)
);
return (
<SettingsRow
@@ -202,21 +209,23 @@ function AgentConnectionAccess({
className="shrink-0 text-xs font-medium text-app-link hover:underline"
to={managePath}
>
- Manage
+ {t(m.manage)}
</Link>
) : access.isPending ? (
<span className="shrink-0 text-xs text-muted-foreground" role="status">
- Loading access...
+ {t(m.loadingAccess)}
</span>
) : access.error ? (
<Button size="compact" onClick={() => void access.refetch()}>
- Retry access
+ {t(m.retryAccess)}
</Button>
) : (
<input
type="checkbox"
role="switch"
- aria-label={`Allow Agent access to ${connection.identity_label || connection.provider}`}
+ aria-label={t(m.allowAgentAccess, {
+ account: connection.identity_label || connection.provider,
+ })}
checked={agent?.granted ?? false}
disabled={!agent || update.isPending}
onChange={(event) => update.mutate(event.target.checked)}
diff --git a/apps/web/src/features/apps/app-groups.ts b/apps/web/src/features/apps/app-groups.ts
index 54f181e1..f86d4a65 100644
--- a/apps/web/src/features/apps/app-groups.ts
+++ b/apps/web/src/features/apps/app-groups.ts
@@ -1,9 +1,13 @@
import type { TeamHubExternalApp } from "@/features/teamhub/teamhub-types";
+import { type Translate, translate } from "@/i18n/language";
+import type { Message } from "@/i18n/messages";
+
+import { connectorMessages as m } from "./connectors.messages";
export interface AppGroup {
apps: readonly string[];
id: string;
- title: string;
+ title: Message;
}
/**
@@ -19,7 +23,7 @@ export const WEB_SEARCH_FILTER = { id: "web-search", label: "Web search" };
export const APP_GROUPS: readonly AppGroup[] = [
{
id: "mail-calendar",
- title: "Mail & Calendar",
+ title: m.groupMailCalendar,
apps: [
"gmail",
"outlook",
@@ -28,46 +32,52 @@ export const APP_GROUPS: readonly AppGroup[] = [
"calendly",
],
},
- { id: "meetings", title: "Meetings", apps: ["granola", "google_meet"] },
+ { id: "meetings", title: m.groupMeetings, apps: ["granola", "google_meet"] },
{
id: "productivity",
- title: "Productivity",
+ title: m.groupProductivity,
apps: ["github", "notion", "linear"],
},
- { id: "messaging", title: "Messaging", apps: ["slack", "discord"] },
+ { id: "messaging", title: m.groupMessaging, apps: ["slack", "discord"] },
{
id: "design-creative",
- title: "Design & Creative",
+ title: m.groupDesignCreative,
apps: ["figma", "canva"],
},
- { id: "multimodal", title: "Multimodal", apps: ["higgsfield", "fal_ai"] },
+ {
+ id: "multimodal",
+ title: m.groupMultimodal,
+ apps: ["higgsfield", "fal_ai"],
+ },
];
/**
* One-line card labels. TeamHub's longer descriptions stay in the manage
* dialog, where their import limits and scope matter.
*/
-const APP_SUMMARIES: Record<string, string> = {
- calendly: "Scheduling links and events",
- canva: "Designs and presentations",
- discord: "Servers and channels",
- fal_ai: "Generative media models",
- figma: "Design files",
- github: "Repositories and activity",
- gmail: "Email",
- google_calendar: "Calendars and events",
- google_meet: "Video call records",
- granola: "Meeting notes",
- higgsfield: "AI images and video",
- linear: "Issues and projects",
- notion: "Pages and databases",
- outlook: "Email",
- outlook_calendar: "Calendars and events",
- slack: "Workspaces and channels",
+const APP_SUMMARIES: Record<string, Message> = {
+ calendly: m.summaryCalendly,
+ canva: m.summaryCanva,
+ discord: m.summaryDiscord,
+ fal_ai: m.summaryFalAi,
+ figma: m.summaryFigma,
+ github: m.summaryGitHub,
+ gmail: m.summaryMail,
+ google_calendar: m.summaryCalendar,
+ google_meet: m.summaryGoogleMeet,
+ granola: m.summaryGranola,
+ higgsfield: m.summaryHiggsfield,
+ linear: m.summaryLinear,
+ notion: m.summaryNotion,
+ outlook: m.summaryMail,
+ outlook_calendar: m.summaryCalendar,
+ slack: m.summarySlack,
};
-export function appSummary(app: TeamHubExternalApp) {
- return APP_SUMMARIES[app.key] ?? app.description;
+/** What the app holds, in a few words; TeamHub's description for other apps. */
+export function appSummary(app: TeamHubExternalApp, t: Translate = translate) {
+ const summary = APP_SUMMARIES[app.key];
+ return summary ? t(summary) : app.description;
}
/** Each group with the catalog apps it holds, in group order; empty groups drop. */
diff --git a/apps/web/src/features/apps/app-logo.tsx b/apps/web/src/features/apps/app-logo.tsx
index 3f8dd2da..68c4efe2 100644
--- a/apps/web/src/features/apps/app-logo.tsx
+++ b/apps/web/src/features/apps/app-logo.tsx
@@ -1,7 +1,10 @@
import { PlugSocketIcon } from "@hugeicons/core-free-icons";
import { Icon } from "@/components/ui/icon";
+import { useT } from "@/i18n/use-translation";
import { useState } from "react";
+import { connectorMessages as m } from "./connectors.messages";
+
const SIZES = {
md: { image: "size-6", icon: 20 },
sm: { image: "size-3", icon: 12 },
@@ -18,6 +21,7 @@ export function AppLogo({
url?: string;
}) {
const [failedUrl, setFailedUrl] = useState<string>();
+ const t = useT();
return url && failedUrl !== url ? (
<img
alt=""
@@ -28,7 +32,11 @@ export function AppLogo({
onError={() => setFailedUrl(url)}
/>
) : (
- <span aria-label={`${name} icon`} className="inline-flex" role="img">
+ <span
+ aria-label={t(m.appIcon, { name })}
+ className="inline-flex"
+ role="img"
+ >
<Icon icon={PlugSocketIcon} size={SIZES[size].icon} />
</span>
);
diff --git a/apps/web/src/features/apps/app-manage-dialog.tsx b/apps/web/src/features/apps/app-manage-dialog.tsx
index 007053b9..24aca984 100644
--- a/apps/web/src/features/apps/app-manage-dialog.tsx
+++ b/apps/web/src/features/apps/app-manage-dialog.tsx
@@ -16,11 +16,9 @@ import type {
TeamHubExternalApp,
TeamHubExternalConnection,
} from "@/features/teamhub/teamhub-types";
+import { commonMessages } from "@/i18n/common.messages";
+import { useT } from "@/i18n/use-translation";
-import {
- DISCORD_SERVER_UNCONFIRMED_MESSAGE,
- INSUFFICIENT_PERMISSION_MESSAGE,
-} from "./authorization-error";
import {
externalConnectionQueryOptions,
externalConnectionsQueryKey,
@@ -34,6 +32,7 @@ import {
externalConnectionEstablished,
externalConnectionUnconfirmed,
} from "./connection-state";
+import { connectorMessages as m } from "./connectors.messages";
export function AppManageDialog({
app,
@@ -44,6 +43,7 @@ export function AppManageDialog({
connections: TeamHubExternalConnection[];
onClose: () => void;
}) {
+ const t = useT();
const [disconnecting, setDisconnecting] =
useState<TeamHubExternalConnection | null>(null);
// Without a Composio key, Connect opens the key dialog on top of this one.
@@ -76,8 +76,8 @@ export function AppManageDialog({
<Button
aria-label={
established.length
- ? `Add another ${app.display_name} account`
- : `Connect ${app.display_name}`
+ ? t(m.addAnotherAccount, { app: app.display_name })
+ : t(m.connectApp, { app: app.display_name })
}
disabled={connectFlow.connection.isPending}
onClick={() =>
@@ -90,11 +90,11 @@ export function AppManageDialog({
tone="secondary"
>
<Icon icon={PlusSignIcon} size={14} />
- {established.length ? "Add account" : "Connect"}
+ {established.length ? t(m.addAccount) : t(m.connect)}
</Button>
) : (
<Button disabled size="compact">
- Connect
+ {t(m.connect)}
</Button>
)}
<ConnectAppStatus className="mt-3" flow={connectFlow} />
@@ -149,6 +149,7 @@ function ConnectionRow({
}) {
const { client } = useTeamHubRuntime();
const queryClient = useQueryClient();
+ const t = useT();
const needsReconnecting = externalConnectionNeedsAttention(connection);
const statusCheck = useMutation({
mutationFn: () =>
@@ -166,7 +167,7 @@ function ConnectionRow({
const duplicateIdentity =
connection.status_error_code === "duplicate_remote_principal";
const unconfirmed = externalConnectionUnconfirmed(connection);
- const label = connection.identity_label ?? connection.provider;
+ const account = connection.identity_label ?? connection.provider;
return (
<div className="flex min-h-[58px] flex-wrap items-center gap-3 py-2.5">
@@ -175,11 +176,12 @@ function ConnectionRow({
{accountIdentityText(
connection.provider,
connection.identity_label,
- ) ?? "Authorization in progress"}
+ t,
+ ) ?? t(m.authorizationInProgress)}
</p>
<div className="mt-1 flex flex-wrap items-center gap-2">
{needsReconnecting ? (
- <StatusPill tone="warning">Needs reconnecting</StatusPill>
+ <StatusPill tone="warning">{t(m.needsReconnecting)}</StatusPill>
) : (
<ConnectionStatus
status={connection.status}
@@ -191,11 +193,13 @@ function ConnectionRow({
<div className="flex flex-wrap items-center gap-1.5">
{connection.status === "active" || unconfirmed ? (
<Button
- aria-label={unconfirmed ? `Check again ${label}` : `Check ${label}`}
+ aria-label={t(unconfirmed ? m.checkAccountAgain : m.checkAccount, {
+ account,
+ })}
disabled={statusCheck.isPending || checking}
onClick={() => statusCheck.mutate()}
size="compactIcon"
- title={unconfirmed ? "Check again" : "Check connection"}
+ title={t(unconfirmed ? m.checkAgain : m.checkConnection)}
tone="ghost"
>
<Icon
@@ -209,21 +213,21 @@ function ConnectionRow({
) : null}
{needsReconnecting && canReconnect ? (
<Button
- aria-label={`Reconnect ${connection.identity_label ?? connection.provider}`}
+ aria-label={t(m.reconnectAccount, { account })}
disabled={reconnecting}
onClick={onReconnect}
size="compact"
tone="secondary"
>
- Reconnect
+ {t(m.reconnect)}
</Button>
) : null}
{!["disconnecting", "revoke_pending"].includes(connection.status) ? (
<Button
- aria-label={`Disconnect ${connection.identity_label ?? connection.provider}`}
+ aria-label={t(m.disconnectAccount, { account })}
onClick={onDisconnect}
size="compactIcon"
- title="Disconnect"
+ title={t(m.disconnect)}
tone="ghost"
>
<Icon icon={Delete02Icon} size={14} />
@@ -232,24 +236,26 @@ function ConnectionRow({
</div>
{unconfirmed ? (
<p className="basis-full text-xs text-app-danger" role="alert">
- {connection.status_error_code === "discord_guild_required"
- ? `${DISCORD_SERVER_UNCONFIRMED_MESSAGE} Check again, or disconnect and reconnect.`
- : "The connection couldn't be confirmed yet. Check again."}
+ {t(
+ connection.status_error_code === "discord_guild_required"
+ ? m.discordUnconfirmedInDialog
+ : m.connectionUnconfirmed,
+ )}
</p>
) : null}
{connection.status_error_code === "provider_auth_failed" ? (
<p className="basis-full text-xs text-app-danger" role="alert">
- {INSUFFICIENT_PERMISSION_MESSAGE}
+ {t(m.insufficientPermission)}
</p>
) : null}
{statusCheck.error ? (
<p className="basis-full text-xs text-app-danger" role="alert">
- {errorMessage(statusCheck.error, "Connection action failed.")}
+ {errorMessage(statusCheck.error, t(m.connectionActionFailed))}
</p>
) : null}
{duplicateIdentity ? (
<p className="basis-full text-xs text-app-danger" role="alert">
- This account is already connected.
+ {t(m.accountAlreadyConnected)}
</p>
) : null}
{connection.status === "active" && supportsAutoReminders ? (
@@ -266,6 +272,7 @@ function AutoReminders({
}) {
const { client } = useTeamHubRuntime();
const queryClient = useQueryClient();
+ const t = useT();
const update = useMutation({
mutationFn: (enabled: boolean) =>
client.setExternalConnectionAutoReminders(connection.id, enabled),
@@ -284,14 +291,16 @@ function AutoReminders({
<label className="flex min-h-8 items-center justify-between gap-3">
<span className="min-w-0">
<span className="block text-sm font-medium text-foreground">
- Auto reminders
+ {t(m.autoReminders)}
</span>
<span className="block text-xs text-muted-foreground">
- Agents check this account for things that need your attention.
+ {t(m.autoRemindersHint)}
</span>
</span>
<input
- aria-label={`Auto reminders for ${connection.identity_label ?? connection.provider}`}
+ aria-label={t(m.autoRemindersFor, {
+ account: connection.identity_label ?? connection.provider,
+ })}
checked={enabled}
className="agent-connector-switch"
disabled={update.isPending}
@@ -302,7 +311,7 @@ function AutoReminders({
</label>
{update.error ? (
<p className="mt-1 text-xs text-app-danger" role="alert">
- {errorMessage(update.error, "Auto reminders could not be updated.")}
+ {errorMessage(update.error, t(m.autoRemindersNotUpdated))}
</p>
) : null}
</div>
@@ -318,6 +327,7 @@ export function DisconnectConnectionDialog({
}) {
const { client } = useTeamHubRuntime();
const queryClient = useQueryClient();
+ const t = useT();
const [disconnected, setDisconnected] = useState(false);
const disconnect = useMutation({
mutationFn: () =>
@@ -349,16 +359,23 @@ export function DisconnectConnectionDialog({
return (
<ModalDialog
description={
- accountIdentityText(connection.provider, connection.identity_label) ??
- connection.provider
+ accountIdentityText(
+ connection.provider,
+ connection.identity_label,
+ t,
+ ) ?? connection.provider
}
onClose={onClose}
size="md"
- title="Disconnect account?"
+ title={t(m.disconnectTitle)}
footer={
<>
- <Button disabled={disconnect.isPending} onClick={onClose}>
- {disconnected ? "Close" : "Cancel"}
+ <Button
+ data-voice-close={disconnected ? "" : undefined}
+ disabled={disconnect.isPending}
+ onClick={onClose}
+ >
+ {t(disconnected ? commonMessages.close : commonMessages.cancel)}
</Button>
{!disconnected ? (
<Button
@@ -366,24 +383,22 @@ export function DisconnectConnectionDialog({
onClick={() => disconnect.mutate()}
tone="danger"
>
- Disconnect
+ {t(m.disconnect)}
</Button>
) : null}
</>
}
>
<div className="px-5 py-4">
- <p className="text-sm text-muted-foreground">
- Agents lose access to this account. Content already imported is kept.
- </p>
+ <p className="text-sm text-muted-foreground">{t(m.disconnectBody)}</p>
{ended ? (
<div
className="mt-4 space-y-1 border-y border-border py-3 text-sm"
role="status"
>
- <p>App access stopped in Linger.</p>
+ <p>{t(m.accessStopped)}</p>
<p className="text-muted-foreground">
- Provider authorization: {revokeLabel(ended)}
+ {t(providerAuthorization(ended))}
</p>
</div>
) : null}
@@ -391,7 +406,7 @@ export function DisconnectConnectionDialog({
<p className="mt-3 text-sm text-app-danger" role="alert">
{errorMessage(
disconnect.error ?? current.error,
- "Account could not be disconnected.",
+ t(m.accountNotDisconnected),
)}
</p>
) : null}
@@ -407,13 +422,16 @@ function ConnectionStatus({
status: TeamHubExternalConnection["status"];
unconfirmed: boolean;
}) {
+ const t = useT();
return (
<StatusPill tone={status === "active" ? "success" : "warning"}>
- {status === "active"
- ? "Active"
- : unconfirmed
- ? "Not confirmed"
- : "Disconnecting"}
+ {t(
+ status === "active"
+ ? m.statusActive
+ : unconfirmed
+ ? m.statusNotConfirmed
+ : m.statusDisconnecting,
+ )}
</StatusPill>
);
}
@@ -424,9 +442,10 @@ function errorMessage(error: unknown, fallback: string) {
return fallback;
}
-function revokeLabel(connection: TeamHubExternalConnection) {
- if (connection.status === "revoked") return "revoked";
+/** How far the provider is with taking the authorization back. */
+function providerAuthorization(connection: TeamHubExternalConnection) {
+ if (connection.status === "revoked") return m.providerAuthorizationRevoked;
if (connection.status_error_code?.startsWith("provider_revoke_"))
- return "retrying";
- return "pending";
+ return m.providerAuthorizationRetrying;
+ return m.providerAuthorizationPending;
}
diff --git a/apps/web/src/features/apps/authorization-error.ts b/apps/web/src/features/apps/authorization-error.ts
index 5cfda0b8..361a17c3 100644
--- a/apps/web/src/features/apps/authorization-error.ts
+++ b/apps/web/src/features/apps/authorization-error.ts
@@ -1,32 +1,40 @@
-export const INSUFFICIENT_PERMISSION_MESSAGE =
- "This app did not grant enough permission. Reconnect and approve all requested access.";
+import { type Translate, translate } from "@/i18n/language";
-export const DISCORD_SERVER_UNCONFIRMED_MESSAGE =
- "Discord is authorized, but the Server couldn't be confirmed.";
+import { connectorMessages as m } from "./connectors.messages";
+
+/**
+ * The English of `connectorMessages.insufficientPermission`, for comparing
+ * with. Show the message itself, so it follows the language on screen.
+ */
+export const INSUFFICIENT_PERMISSION_MESSAGE = m.insufficientPermission.source;
export function connectionStatusErrorMessage(
statusErrorCode: string | null | undefined,
+ t: Translate = translate,
): string | undefined {
switch (statusErrorCode) {
case "discord_guild_required":
- return `${DISCORD_SERVER_UNCONFIRMED_MESSAGE} Check it again from Apps.`;
+ return t(m.discordUnconfirmedFromApps);
case "duplicate_remote_principal":
- return "This account is already connected.";
+ return t(m.accountAlreadyConnected);
case "provider_auth_failed":
- return INSUFFICIENT_PERMISSION_MESSAGE;
+ return t(m.insufficientPermission);
default:
return undefined;
}
}
-export function connectionAuthorizationError(connection: {
- status: string;
- status_error_code?: string | null;
-}): string | undefined {
+export function connectionAuthorizationError(
+ connection: {
+ status: string;
+ status_error_code?: string | null;
+ },
+ t: Translate = translate,
+): string | undefined {
return (
- connectionStatusErrorMessage(connection.status_error_code) ??
+ connectionStatusErrorMessage(connection.status_error_code, t) ??
(connection.status === "failed" || connection.status === "expired"
- ? "Authorization failed. Reconnect this app and approve the requested access."
+ ? t(m.authorizationFailed)
: undefined)
);
}
diff --git a/apps/web/src/features/apps/connect-app-flow.tsx b/apps/web/src/features/apps/connect-app-flow.tsx
index 80ed2250..cca38c75 100644
--- a/apps/web/src/features/apps/connect-app-flow.tsx
+++ b/apps/web/src/features/apps/connect-app-flow.tsx
@@ -9,9 +9,11 @@ import type {
TeamHubExternalApp,
TeamHubExternalConnection,
} from "@/features/teamhub/teamhub-types";
+import { RichMessage, useT } from "@/i18n/use-translation";
import { AppLogoTile } from "./app-logo";
import { externalAppsQueryOptions } from "./connected-apps-queries";
+import { connectorMessages as m } from "./connectors.messages";
import { openOAuthUrl } from "./oauth-popup";
import { ComposioKeyForm } from "./provider-key-form";
import { ComposioKeyGuide } from "./provider-key-guide";
@@ -22,6 +24,11 @@ import {
export type ConnectAppFlow = ReturnType<typeof useConnectAppFlow>;
+/** Variable and file names inside a sentence. */
+const CODE_TAGS = {
+ code: (text: string) => <code className="font-mono">{text}</code>,
+};
+
/**
* The one way to connect an app. With a connection provider it creates the
* connection and opens OAuth; without one, or when Composio rejects the key,
@@ -86,20 +93,19 @@ export function ConnectAppStatus({
flow: ConnectAppFlow;
}) {
const { connection, setupApp } = flow;
+ const t = useT();
return (
<>
{connection.error && !isComposioKeyRejected(connection.error) ? (
<p className={cn("text-xs text-app-danger", className)} role="alert">
{connection.error instanceof Error
? connection.error.message
- : "Connection could not be started."}
+ : t(m.connectionNotStarted)}
</p>
) : null}
{connection.blockedConnectUrl ? (
<div className={cn("text-xs", className)} role="status">
- <p className="text-foreground">
- Your browser blocked the authorization popup.
- </p>
+ <p className="text-foreground">{t(m.popupBlocked)}</p>
<Button
className="mt-1.5"
onClick={() => {
@@ -110,7 +116,7 @@ export function ConnectAppStatus({
size="compact"
tone="primary"
>
- Open authorization window
+ {t(m.openAuthorizationWindow)}
</Button>
</div>
) : null}
@@ -122,11 +128,9 @@ export function ConnectAppStatus({
flow.configured && !flow.keyRejected
? undefined
: flow.keyRejected
- ? flow.canSaveKey
- ? "Composio no longer accepts the saved API key. Save a new key to keep connecting apps."
- : "Composio rejected this deployment's API key."
+ ? t(flow.canSaveKey ? m.keyNoLongerAccepted : m.keyRejected)
: flow.canSaveKey
- ? `Connect ${setupApp.display_name} securely through Composio. Add your API key once to enable your connectors.`
+ ? t(m.connectThroughComposio, { app: setupApp.display_name })
: undefined
}
onClose={flow.closeSetup}
@@ -138,7 +142,7 @@ export function ConnectAppStatus({
small
url={setupApp.logo_url}
/>
- Connect {setupApp.display_name}
+ {t(m.connectApp, { app: setupApp.display_name })}
</span>
}
>
@@ -151,7 +155,7 @@ export function ConnectAppStatus({
}}
tone="primary"
>
- Connect {setupApp.display_name}
+ {t(m.connectApp, { app: setupApp.display_name })}
</Button>
) : flow.canSaveKey ? (
<>
@@ -160,10 +164,7 @@ export function ConnectAppStatus({
</>
) : flow.keyRejected ? (
<p className="text-app-muted">
- Update <code className="font-mono">COMPOSIO_API_KEY</code> where
- the server reads it. When Linger is installed on this computer,
- that is <code className="font-mono">user.env</code>; reopen the
- Linger app afterwards.
+ <RichMessage message={m.updateServerKey} tags={CODE_TAGS} />
</p>
) : (
<ConnectorsNotConfiguredMessage />
@@ -178,13 +179,7 @@ export function ConnectAppStatus({
export function ConnectorsNotConfiguredMessage() {
return (
<p className="text-app-muted">
- Connecting Gmail, GitHub, Slack, Notion and other apps needs a Composio
- API key. When Linger is installed on this computer, set{" "}
- <code className="font-mono">COMPOSIO_API_KEY</code> in{" "}
- <code className="font-mono">user.env</code>, then reopen the Linger app.
- On a server you run yourself, set it there, or set{" "}
- <code className="font-mono">TEAMHUB_SECRET_ENCRYPTION_KEY</code> to save
- the key here.
+ <RichMessage message={m.notConfigured} tags={CODE_TAGS} />
</p>
);
}
diff --git a/apps/web/src/features/apps/connected-apps-page.tsx b/apps/web/src/features/apps/connected-apps-page.tsx
index dfb0dac4..1ea42e0d 100644
--- a/apps/web/src/features/apps/connected-apps-page.tsx
+++ b/apps/web/src/features/apps/connected-apps-page.tsx
@@ -19,6 +19,8 @@ import {
shownWebSearchBackends,
webSearchBackendsQueryOptions,
} from "@/features/web-search/web-search-backends";
+import { commonMessages } from "@/i18n/common.messages";
+import { useT } from "@/i18n/use-translation";
import { AppLogo } from "./app-logo";
import { appSummary, groupCatalogApps, WEB_SEARCH_FILTER } from "./app-groups";
@@ -37,6 +39,7 @@ import {
externalConnectionsQueryOptions,
} from "./connected-apps-queries";
import { ConnectAppStatus, useConnectAppFlow } from "./connect-app-flow";
+import { connectorMessages as m } from "./connectors.messages";
import { WebSearchSection } from "./web-search-connectors";
const APP_GRID_CLASS = "grid grid-cols-1 gap-3 sm:grid-cols-2 lg:grid-cols-3";
@@ -47,6 +50,7 @@ function stopCardClick(event: MouseEvent) {
export function ConnectedAppsPage() {
const { client } = useTeamHubRuntime();
+ const t = useT();
const [searchParams, setSearchParams] = useSearchParams();
const requestedApp = searchParams.get("app");
const apps = useQuery(externalAppsQueryOptions(client));
@@ -74,8 +78,8 @@ export function ConnectedAppsPage() {
).length > 0,
);
const filters = [
- { id: "all", label: "All" },
- ...groups.map(({ group }) => ({ id: group.id, label: group.title })),
+ { id: "all", label: t(m.filterAll) },
+ ...groups.map(({ group }) => ({ id: group.id, label: t(group.title) })),
WEB_SEARCH_FILTER,
];
const groupApps = groups.find((entry) => entry.group.id === filter)?.apps;
@@ -137,16 +141,16 @@ export function ConnectedAppsPage() {
<main className="workspace-scrollbar min-h-0 flex-1 overflow-y-auto bg-background [scrollbar-gutter:stable]">
<div className="workspace-file-browser">
<DesktopBarTitle>
- <h1 className="mb-5 text-2xl text-foreground">Connectors</h1>
+ <h1 className="mb-5 text-2xl text-foreground">{t(m.title)}</h1>
</DesktopBarTitle>
{apps.isPending || connections.isPending ? (
- <PageMessage busy>Loading connectors...</PageMessage>
+ <PageMessage busy>{t(m.loadingConnectors)}</PageMessage>
) : apps.error || connections.error ? (
<div className="py-10 text-center" role="alert">
<p className="text-sm text-app-danger">
{apps.error?.message ??
connections.error?.message ??
- "Connectors are unavailable."}
+ t(m.connectorsUnavailable)}
</p>
<Button
className="mt-3"
@@ -155,7 +159,7 @@ export function ConnectedAppsPage() {
}
size="compact"
>
- Retry
+ {t(commonMessages.retry)}
</Button>
</div>
) : (
@@ -166,7 +170,7 @@ export function ConnectedAppsPage() {
<UnderlineTabs
className="min-w-0 flex-1"
items={filters}
- label="Connector categories"
+ label={t(m.connectorCategories)}
onChange={setFilter}
value={filter}
/>
@@ -177,22 +181,22 @@ export function ConnectedAppsPage() {
size="large"
tone={connectedOnly ? "primary" : "secondary"}
>
- Connected only
+ {t(m.connectedOnly)}
</Button>
</div>
{!showApps ? null : filteredApps ? (
filteredApps.length ? (
<section
- aria-label="Application connections"
+ aria-label={t(m.applicationConnections)}
className={APP_GRID_CLASS}
>
{filteredApps.map(renderApp)}
</section>
) : (
- <PageMessage>No connected apps yet.</PageMessage>
+ <PageMessage>{t(m.noConnectedApps)}</PageMessage>
)
) : (
- <div aria-label="Application connections" role="region">
+ <div aria-label={t(m.applicationConnections)} role="region">
{groups.map(({ group, apps: groupApps }) => (
<section
aria-labelledby={`connector-group-${group.id}`}
@@ -203,7 +207,7 @@ export function ConnectedAppsPage() {
className="mb-2.5 text-[14px] font-medium text-muted-foreground"
id={`connector-group-${group.id}`}
>
- {group.title}
+ {t(group.title)}
</h2>
<div className={APP_GRID_CLASS}>
{groupApps.map(renderApp)}
@@ -248,6 +252,7 @@ function CatalogAppCard({
selected: boolean;
onOpen: () => void;
}) {
+ const t = useT();
const [disconnecting, setDisconnecting] =
useState<TeamHubExternalConnection | null>(null);
const connectFlow = useConnectAppFlow();
@@ -259,24 +264,29 @@ function CatalogAppCard({
const needsReconnecting = connections.filter(
externalConnectionNeedsAttention,
).length;
- const connectedLabel = active.length
- ? `${active.length === 1 ? "Connected" : `${active.length} accounts`}${
- needsReconnecting
- ? `, ${needsReconnecting} ${needsReconnecting === 1 ? "needs" : "need"} reconnecting`
- : ""
- }`
- : null;
+ const connectedLabel = !active.length
+ ? null
+ : active.length === 1
+ ? needsReconnecting
+ ? t(m.connectedNeedsReconnecting, { count: needsReconnecting })
+ : t(m.connected)
+ : needsReconnecting
+ ? t(m.accountsNeedReconnecting, {
+ accounts: active.length,
+ count: needsReconnecting,
+ })
+ : t(m.accountCount, { count: active.length });
const authorizing =
createConnection.isPending || Boolean(createConnection.blockedConnectUrl);
const unconfirmed = connections.some(externalConnectionUnconfirmed);
const summary =
connectFlow.configured && app.availability === "unavailable"
- ? "Unavailable"
+ ? t(m.unavailable)
: authorizing
- ? "Authorizing…"
+ ? t(m.authorizing)
: unconfirmed
- ? "Couldn't confirm connection"
- : appSummary(app);
+ ? t(m.couldNotConfirm)
+ : appSummary(app, t);
return (
<article
@@ -321,7 +331,7 @@ function CatalogAppCard({
</button>
{canStart && active.length === 0 ? (
<Button
- aria-label={`Connect ${app.display_name}`}
+ aria-label={t(m.connectApp, { app: app.display_name })}
className="px-2.5"
disabled={createConnection.isPending}
onClick={(event) => {
@@ -331,21 +341,21 @@ function CatalogAppCard({
size="compact"
tone="secondary"
>
- Connect
+ {t(m.connect)}
</Button>
) : null}
{canConnect && active.length === 1 ? (
// Disconnecting is destructive, so it sits in a menu, not beside Connect.
<ActionMenu
items={[
- { label: "Manage", onSelect: onOpen },
+ { label: t(m.manage), onSelect: onOpen },
{
danger: true,
- label: "Disconnect",
+ label: t(m.disconnect),
onSelect: () => setDisconnecting(active[0] ?? null),
},
]}
- label={`Actions for ${app.display_name}`}
+ label={t(m.actionsFor, { app: app.display_name })}
/>
) : null}
<ConnectAppStatus className="basis-full" flow={connectFlow} />
diff --git a/apps/web/src/features/apps/connection-state.ts b/apps/web/src/features/apps/connection-state.ts
index c24031ab..a90700ae 100644
--- a/apps/web/src/features/apps/connection-state.ts
+++ b/apps/web/src/features/apps/connection-state.ts
@@ -1,5 +1,8 @@
import type { TeamHubClient } from "@/features/teamhub/teamhub-client";
import type { TeamHubExternalConnection } from "@/features/teamhub/teamhub-types";
+import { type Translate, translate } from "@/i18n/language";
+
+import { connectorMessages as m } from "./connectors.messages";
const NEEDS_ATTENTION = new Set<TeamHubExternalConnection["status"]>([
"expired",
@@ -129,7 +132,8 @@ export function reauthorizationConnectUrl(connection?: {
export function accountIdentityText(
provider: string,
label: string | null | undefined,
+ t: Translate = translate,
): string | undefined {
if (!label) return undefined;
- return provider === "outlook" ? `Signed in as ${label}` : label;
+ return provider === "outlook" ? t(m.signedInAs, { account: label }) : label;
}
diff --git a/apps/web/src/features/apps/connectors.messages.ts b/apps/web/src/features/apps/connectors.messages.ts
new file mode 100644
index 00000000..cf7c364c
--- /dev/null
+++ b/apps/web/src/features/apps/connectors.messages.ts
@@ -0,0 +1,160 @@
+import { defineMessages } from "@/i18n/messages";
+
+/**
+ * The Connectors page, the dialog that manages one app's accounts, the
+ * connect and API key flow, and an Agent's connector access. App names,
+ * account names and descriptions TeamHub sends are data and are shown as
+ * they arrive.
+ */
+export const connectorMessages = defineMessages("connectors", {
+ // Connectors page
+ title: "Connectors",
+ loadingConnectors: "Loading connectors...",
+ connectorsUnavailable: "Connectors are unavailable.",
+ filterAll: "All",
+ connectorCategories: "Connector categories",
+ connectedOnly: "Connected only",
+ applicationConnections: "Application connections",
+ noConnectedApps: "No connected apps yet.",
+
+ // Groups of the catalog
+ groupMailCalendar: "Mail & Calendar",
+ groupMeetings: "Meetings",
+ groupProductivity: "Productivity",
+ groupMessaging: "Messaging",
+ groupDesignCreative: "Design & Creative",
+ groupMultimodal: "Multimodal",
+
+ // What each app of the catalog holds
+ summaryCalendly: "Scheduling links and events",
+ summaryCanva: "Designs and presentations",
+ summaryDiscord: "Servers and channels",
+ summaryFalAi: "Generative media models",
+ summaryFigma: "Design files",
+ summaryGitHub: "Repositories and activity",
+ summaryMail: "Email",
+ summaryCalendar: "Calendars and events",
+ summaryGoogleMeet: "Video call records",
+ summaryGranola: "Meeting notes",
+ summaryHiggsfield: "AI images and video",
+ summaryLinear: "Issues and projects",
+ summaryNotion: "Pages and databases",
+ summarySlack: "Workspaces and channels",
+
+ // App card
+ connected: "Connected",
+ accountCount: { one: "{count} account", other: "{count} accounts" },
+ // {count} is how many of the app's accounts need reconnecting.
+ connectedNeedsReconnecting: {
+ one: "Connected, {count} needs reconnecting",
+ other: "Connected, {count} need reconnecting",
+ },
+ // {accounts} is two or more.
+ accountsNeedReconnecting: {
+ one: "{accounts} accounts, {count} needs reconnecting",
+ other: "{accounts} accounts, {count} need reconnecting",
+ },
+ unavailable: "Unavailable",
+ authorizing: "Authorizing…",
+ couldNotConfirm: "Couldn't confirm connection",
+ connect: "Connect",
+ connectApp: "Connect {app}",
+ manage: "Manage",
+ disconnect: "Disconnect",
+ actionsFor: "Actions for {app}",
+ appIcon: "{name} icon",
+
+ // Dialog that manages one app's accounts
+ addAnotherAccount: "Add another {app} account",
+ addAccount: "Add account",
+ authorizationInProgress: "Authorization in progress",
+ needsReconnecting: "Needs reconnecting",
+ statusActive: "Active",
+ statusNotConfirmed: "Not confirmed",
+ statusDisconnecting: "Disconnecting",
+ checkAccountAgain: "Check again {account}",
+ checkAccount: "Check {account}",
+ checkAgain: "Check again",
+ checkConnection: "Check connection",
+ reconnectAccount: "Reconnect {account}",
+ reconnect: "Reconnect",
+ disconnectAccount: "Disconnect {account}",
+ discordUnconfirmedInDialog:
+ "Discord is authorized, but the Server couldn't be confirmed. Check again, or disconnect and reconnect.",
+ connectionUnconfirmed:
+ "The connection couldn't be confirmed yet. Check again.",
+ connectionActionFailed: "Connection action failed.",
+ accountAlreadyConnected: "This account is already connected.",
+ // Shown when the account name is the sign-in name, not the mailbox.
+ signedInAs: "Signed in as {account}",
+ autoReminders: "Auto reminders",
+ autoRemindersHint:
+ "Agents check this account for things that need your attention.",
+ autoRemindersFor: "Auto reminders for {account}",
+ autoRemindersNotUpdated: "Auto reminders could not be updated.",
+
+ // Disconnect account dialog
+ disconnectTitle: "Disconnect account?",
+ disconnectBody:
+ "Agents lose access to this account. Content already imported is kept.",
+ accessStopped: "App access stopped in Linger.",
+ providerAuthorizationRevoked: "Provider authorization: revoked",
+ providerAuthorizationRetrying: "Provider authorization: retrying",
+ providerAuthorizationPending: "Provider authorization: pending",
+ accountNotDisconnected: "Account could not be disconnected.",
+
+ // Authorization errors
+ insufficientPermission:
+ "This app did not grant enough permission. Reconnect and approve all requested access.",
+ discordUnconfirmedFromApps:
+ "Discord is authorized, but the Server couldn't be confirmed. Check it again from Apps.",
+ authorizationFailed:
+ "Authorization failed. Reconnect this app and approve the requested access.",
+
+ // Connect flow
+ connectionNotStarted: "Connection could not be started.",
+ reconnectNotStarted: "Reconnecting could not be started. Try again.",
+ popupBlocked: "Your browser blocked the authorization popup.",
+ openAuthorizationWindow: "Open authorization window",
+ keyNoLongerAccepted:
+ "Composio no longer accepts the saved API key. Save a new key to keep connecting apps.",
+ keyRejected: "Composio rejected this deployment's API key.",
+ connectThroughComposio:
+ "Connect {app} securely through Composio. Add your API key once to enable your connectors.",
+ updateServerKey:
+ "Update <code>COMPOSIO_API_KEY</code> where the server reads it. When Linger is installed on this computer, that is <code>user.env</code>; reopen the Linger app afterwards.",
+ notConfigured:
+ "Connecting Gmail, GitHub, Slack, Notion and other apps needs a Composio API key. When Linger is installed on this computer, set <code>COMPOSIO_API_KEY</code> in <code>user.env</code>, then reopen the Linger app. On a server you run yourself, set it there, or set <code>TEAMHUB_SECRET_ENCRYPTION_KEY</code> to save the key here.",
+
+ // API key guide and form. Read All and Write All are labels in Composio.
+ getYourApiKey: "Get your API key",
+ getAKey: "Get a key",
+ composioKeyNote:
+ "Permissions cannot be changed after a key is created. If Write All was not selected, create a new key. Read-only keys cannot create the authorization needed to connect apps.",
+ composioStepOpen: "Open Composio and sign in or create an account.",
+ composioStepCreate:
+ "Create a project API key and select <strong>Read All</strong> and <strong>Write All</strong> before creating it.",
+ composioStepPaste: "Copy the key, paste it below, and select Save key.",
+ composioStepReturn:
+ "Return to your app, select Connect, and complete authorization.",
+ composioApiKey: "Composio API key",
+ composioKeyHint:
+ "Use a key with full read and write access (Read All and Write All). It is stored encrypted and never shown again.",
+ checkingKey: "Checking key...",
+ saveKey: "Save key",
+
+ // Window the authorization returns to
+ authorizationComplete: "Authorization complete",
+ canCloseWindow: "You can close this window.",
+
+ // An Agent's connector access
+ agentAccounts: "Accounts this Agent can use",
+ noConnectedAccounts: "No connected accounts yet.",
+ connectAnotherApp: "Connect another app",
+ connectionPending: "Connection pending",
+ connectionNeedsAttention: "Connection needs attention",
+ accessUnavailable: "Access unavailable for this Agent",
+ loadingAccess: "Loading access...",
+ retryAccess: "Retry access",
+ allowAgentAccess: "Allow Agent access to {account}",
+});
diff --git a/apps/web/src/features/apps/oauth-complete-page.tsx b/apps/web/src/features/apps/oauth-complete-page.tsx
index 3a58dad7..c9ebf1d1 100644
--- a/apps/web/src/features/apps/oauth-complete-page.tsx
+++ b/apps/web/src/features/apps/oauth-complete-page.tsx
@@ -1,6 +1,9 @@
import { useEffect } from "react";
import { useTeamHubRuntime } from "@/features/teamhub/teamhub-runtime";
+import { useT } from "@/i18n/use-translation";
+
+import { connectorMessages as m } from "./connectors.messages";
export const OAUTH_COMPLETE_PATH = "/oauth/composio-complete";
@@ -9,6 +12,7 @@ const COMPLETE_WAIT_MS = 3000;
export function OAuthCompletePage() {
const { client } = useTeamHubRuntime();
+ const t = useT();
useEffect(() => {
// TeamHub checks the account with Composio; returning here is never
@@ -33,9 +37,9 @@ export function OAuthCompletePage() {
return (
<main className="flex min-h-dvh items-center justify-center bg-background px-6 text-center text-foreground">
<div className="max-w-md">
- <h1 className="text-lg">Authorization complete</h1>
+ <h1 className="text-lg">{t(m.authorizationComplete)}</h1>
<p className="mt-2 text-sm text-muted-foreground">
- You can close this window.
+ {t(m.canCloseWindow)}
</p>
</div>
</main>
diff --git a/apps/web/src/features/apps/provider-key-form.tsx b/apps/web/src/features/apps/provider-key-form.tsx
index 6c3ad6c5..f4becb78 100644
--- a/apps/web/src/features/apps/provider-key-form.tsx
+++ b/apps/web/src/features/apps/provider-key-form.tsx
@@ -4,8 +4,10 @@ import { useState } from "react";
import { Button } from "@/components/ui/button";
import { Field } from "@/components/ui/field";
import { useTeamHubRuntime } from "@/features/teamhub/teamhub-runtime";
+import { useT } from "@/i18n/use-translation";
import { externalAppsQueryOptions } from "./connected-apps-queries";
+import { connectorMessages as m } from "./connectors.messages";
/**
* Takes one provider API key and hands it to `save`. TeamHub checks a key
@@ -16,7 +18,7 @@ export function ProviderKeyForm({
hint,
label,
onSaved,
- pendingLabel = "Checking key...",
+ pendingLabel,
save,
}: {
/** The message shown under the field when `save` fails. */
@@ -24,10 +26,11 @@ export function ProviderKeyForm({
hint: string;
label: string;
onSaved?: () => void;
- /** The Save button's text while `save` runs. */
+ /** The Save button's text while `save` runs; "Checking key..." without one. */
pendingLabel?: string;
save: (apiKey: string) => Promise<unknown>;
}) {
+ const t = useT();
const [apiKey, setApiKey] = useState("");
const mutation = useMutation({
mutationFn: () => save(apiKey.trim()),
@@ -60,7 +63,7 @@ export function ProviderKeyForm({
tone="primary"
type="submit"
>
- {mutation.isPending ? pendingLabel : "Save key"}
+ {mutation.isPending ? (pendingLabel ?? t(m.checkingKey)) : t(m.saveKey)}
</Button>
</form>
);
@@ -70,10 +73,11 @@ export function ProviderKeyForm({
export function ComposioKeyForm({ onSaved }: { onSaved?: () => void } = {}) {
const { client } = useTeamHubRuntime();
const queryClient = useQueryClient();
+ const t = useT();
return (
<ProviderKeyForm
- hint="Use a key with full read and write access (Read All and Write All). It is stored encrypted and never shown again."
- label="Composio API key"
+ hint={t(m.composioKeyHint)}
+ label={t(m.composioApiKey)}
onSaved={onSaved}
save={async (apiKey) => {
await client.saveExternalProviderKey(apiKey);
diff --git a/apps/web/src/features/apps/provider-key-guide.tsx b/apps/web/src/features/apps/provider-key-guide.tsx
index 072b4b2b..ef0c1b4d 100644
--- a/apps/web/src/features/apps/provider-key-guide.tsx
+++ b/apps/web/src/features/apps/provider-key-guide.tsx
@@ -1,5 +1,9 @@
import type { ReactNode } from "react";
+import { RichMessage, useT } from "@/i18n/use-translation";
+
+import { connectorMessages as m } from "./connectors.messages";
+
const COMPOSIO_KEYS_URL =
"https://dashboard.composio.dev/~/project/settings/api-keys";
@@ -13,9 +17,10 @@ export function ProviderKeyGuide({
note?: string;
steps: ReactNode;
}) {
+ const t = useT();
return (
<div className="rounded-xl border border-app-border bg-app-surface-soft p-4">
- <p className="font-medium text-foreground">Get your API key</p>
+ <p className="font-medium text-foreground">{t(m.getYourApiKey)}</p>
<div className="mt-1.5 leading-5 text-muted-foreground">{steps}</div>
{note ? <p className="mt-2 leading-5 text-foreground">{note}</p> : null}
<a
@@ -24,28 +29,29 @@ export function ProviderKeyGuide({
rel="noopener noreferrer"
target="_blank"
>
- Get a key <span aria-hidden="true">↗</span>
+ {t(m.getAKey)} <span aria-hidden="true">↗</span>
</a>
</div>
);
}
export function ComposioKeyGuide() {
+ const t = useT();
return (
<ProviderKeyGuide
href={COMPOSIO_KEYS_URL}
- note="Permissions cannot be changed after a key is created. If Write All was not selected, create a new key. Read-only keys cannot create the authorization needed to connect apps."
+ note={t(m.composioKeyNote)}
steps={
<ol className="list-decimal space-y-1.5 pl-5">
- <li>Open Composio and sign in or create an account.</li>
- <li>
- Create a project API key and select <strong>Read All</strong> and{" "}
- <strong>Write All</strong> before creating it.
- </li>
- <li>Copy the key, paste it below, and select Save key.</li>
+ <li>{t(m.composioStepOpen)}</li>
<li>
- Return to your app, select Connect, and complete authorization.
+ <RichMessage
+ message={m.composioStepCreate}
+ tags={{ strong: (text) => <strong>{text}</strong> }}
+ />
</li>
+ <li>{t(m.composioStepPaste)}</li>
+ <li>{t(m.composioStepReturn)}</li>
</ol>
}
/>
diff --git a/apps/web/src/features/apps/use-create-external-connection.ts b/apps/web/src/features/apps/use-create-external-connection.ts
index da22e345..dc110a69 100644
--- a/apps/web/src/features/apps/use-create-external-connection.ts
+++ b/apps/web/src/features/apps/use-create-external-connection.ts
@@ -7,9 +7,11 @@ import type {
TeamHubExternalAppKey,
TeamHubExternalConnection,
} from "@/features/teamhub/teamhub-types";
+import { translate } from "@/i18n/language";
import { externalConnectionsQueryKey } from "./connected-apps-queries";
import { startReauthorization, usableConnectUrl } from "./connection-state";
+import { connectorMessages as m } from "./connectors.messages";
import { openOAuthUrl } from "./oauth-popup";
/** Composio refused the project API key, so a new key is needed to connect. */
@@ -46,8 +48,8 @@ export function useCreateExternalConnection({
const reauthorize = useMutation({
mutationFn: async (connection: TeamHubExternalConnection) => {
const connectUrl = await startReauthorization(client, connection);
- if (!connectUrl)
- throw new Error("Reconnecting could not be started. Try again.");
+ // Worded when it happens, like the errors TeamHub sends.
+ if (!connectUrl) throw new Error(translate(m.reconnectNotStarted));
resume(connectUrl);
},
onSettled: () =>
diff --git a/apps/web/src/i18n/locales/zh-CN.glossary.md b/apps/web/src/i18n/locales/zh-CN.glossary.md
index 903aa35e..1a29bbc2 100644
--- a/apps/web/src/i18n/locales/zh-CN.glossary.md
+++ b/apps/web/src/i18n/locales/zh-CN.glossary.md
@@ -20,6 +20,8 @@ elsewhere.
| Base URL, tokens, Dense, MoE | Model terms people meet in provider documentation. |
| Local Computer | Only when it names the background program. |
| Reconnect This Computer | A desktop menu item, quoted until it is translated. |
+| Read All, Write All | Permission names in Composio's dashboard. |
+| Issue | Linear's word for a work item. |
## Translated
@@ -147,6 +149,11 @@ elsewhere.
| Expand / Collapse | 展开 / 收起 | Never `关闭` for folding a tree. |
| Trash | 回收站 | |
| Archives (file type) | 压缩包 | Compressed files; `归档` is the archive action. |
+| Apps (the page) | 连接器 | An older name of Connectors. |
+| Provider (of an account) | 应用方 | The service a connected account belongs to. |
+| Active (a connection) | 正常 | A status; `已启用` is for a saved key. |
+| Auto reminders | 自动提醒 | |
+| Popup (authorization) | 弹窗 | `拦截` for a popup the browser blocked. |
## Style
diff --git a/apps/web/src/i18n/locales/zh-CN.json b/apps/web/src/i18n/locales/zh-CN.json
index 06494883..0b05ad24 100644
--- a/apps/web/src/i18n/locales/zh-CN.json
+++ b/apps/web/src/i18n/locales/zh-CN.json
@@ -1854,5 +1854,114 @@
"current": "当前位置",
"noFoldersFound": "没有找到文件夹。",
"folderSearchResults": "文件夹搜索结果"
+ },
+ "connectors": {
+ "title": "连接器",
+ "loadingConnectors": "正在加载连接器…",
+ "connectorsUnavailable": "连接器暂时不可用。",
+ "filterAll": "全部",
+ "connectorCategories": "连接器分类",
+ "connectedOnly": "只看已连接",
+ "applicationConnections": "应用连接",
+ "noConnectedApps": "还没有已连接的应用。",
+ "groupMailCalendar": "邮件与日历",
+ "groupMeetings": "会议",
+ "groupProductivity": "效率工具",
+ "groupMessaging": "即时通讯",
+ "groupDesignCreative": "设计与创意",
+ "groupMultimodal": "多模态",
+ "summaryCalendly": "预约链接和日程",
+ "summaryCanva": "设计和演示文稿",
+ "summaryDiscord": "服务器和频道",
+ "summaryFalAi": "生成式媒体模型",
+ "summaryFigma": "设计文件",
+ "summaryGitHub": "仓库和动态",
+ "summaryMail": "邮件",
+ "summaryCalendar": "日历和日程",
+ "summaryGoogleMeet": "视频通话记录",
+ "summaryGranola": "会议纪要",
+ "summaryHiggsfield": "AI 图片和视频",
+ "summaryLinear": "Issue 和项目",
+ "summaryNotion": "页面和数据库",
+ "summarySlack": "工作区和频道",
+ "connected": "已连接",
+ "accountCount": { "other": "{count} 个账号" },
+ "connectedNeedsReconnecting": { "other": "已连接,{count} 个需要重新连接" },
+ "accountsNeedReconnecting": {
+ "other": "{accounts} 个账号,{count} 个需要重新连接"
+ },
+ "unavailable": "不可用",
+ "authorizing": "正在授权…",
+ "couldNotConfirm": "无法确认连接",
+ "connect": "连接",
+ "connectApp": "连接 {app}",
+ "manage": "管理",
+ "disconnect": "断开连接",
+ "actionsFor": "{app} 的操作",
+ "appIcon": "{name} 图标",
+ "addAnotherAccount": "再添加一个 {app} 账号",
+ "addAccount": "添加账号",
+ "authorizationInProgress": "授权进行中",
+ "needsReconnecting": "需要重新连接",
+ "statusActive": "正常",
+ "statusNotConfirmed": "未确认",
+ "statusDisconnecting": "正在断开连接",
+ "checkAccountAgain": "重新检查 {account}",
+ "checkAccount": "检查 {account}",
+ "checkAgain": "重新检查",
+ "checkConnection": "检查连接",
+ "reconnectAccount": "重新连接 {account}",
+ "reconnect": "重新连接",
+ "disconnectAccount": "断开 {account} 的连接",
+ "discordUnconfirmedInDialog": "Discord 已授权,但无法确认服务器。请重新检查,或者断开连接后重新连接。",
+ "connectionUnconfirmed": "暂时无法确认连接,请重新检查。",
+ "connectionActionFailed": "连接操作失败。",
+ "accountAlreadyConnected": "这个账号已经连接。",
+ "signedInAs": "登录账号:{account}",
+ "autoReminders": "自动提醒",
+ "autoRemindersHint": "Agent 会检查这个账号里需要你留意的事项。",
+ "autoRemindersFor": "{account} 的自动提醒",
+ "autoRemindersNotUpdated": "无法更新自动提醒。",
+ "disconnectTitle": "断开账号连接?",
+ "disconnectBody": "Agent 将无法再访问这个账号,已导入的内容会保留。",
+ "accessStopped": "已在 Linger 中停止应用访问。",
+ "providerAuthorizationRevoked": "应用方授权:已撤销",
+ "providerAuthorizationRetrying": "应用方授权:正在重试",
+ "providerAuthorizationPending": "应用方授权:等待处理",
+ "accountNotDisconnected": "无法断开账号连接。",
+ "insufficientPermission": "这个应用没有授予足够的权限。请重新连接,并批准所有请求的访问权限。",
+ "discordUnconfirmedFromApps": "Discord 已授权,但无法确认服务器。请在“连接器”中重新检查。",
+ "authorizationFailed": "授权失败。请重新连接这个应用,并批准请求的访问权限。",
+ "connectionNotStarted": "无法开始连接。",
+ "reconnectNotStarted": "无法开始重新连接,请重试。",
+ "popupBlocked": "浏览器拦截了授权弹窗。",
+ "openAuthorizationWindow": "打开授权窗口",
+ "keyNoLongerAccepted": "Composio 不再接受已保存的 API 密钥。请保存新的密钥,才能继续连接应用。",
+ "keyRejected": "Composio 拒绝了这个部署的 API 密钥。",
+ "connectThroughComposio": "通过 Composio 安全连接 {app}。只需添加一次 API 密钥,即可启用你的连接器。",
+ "updateServerKey": "请在服务器读取配置的位置更新 <code>COMPOSIO_API_KEY</code>。Linger 安装在这台电脑上时,这个位置是 <code>user.env</code>;更新后请重新打开 Linger 应用。",
+ "notConfigured": "连接 Gmail、GitHub、Slack、Notion 等应用需要 Composio API 密钥。Linger 安装在这台电脑上时,请在 <code>user.env</code> 中设置 <code>COMPOSIO_API_KEY</code>,然后重新打开 Linger 应用。如果是你自己运行的服务器,请在服务器上设置,或者设置 <code>TEAMHUB_SECRET_ENCRYPTION_KEY</code> 后在这里保存密钥。",
+ "getYourApiKey": "获取你的 API 密钥",
+ "getAKey": "获取密钥",
+ "composioKeyNote": "密钥创建后无法更改权限。如果当时没有选择 Write All,请创建新的密钥。只读密钥无法创建连接应用所需的授权。",
+ "composioStepOpen": "打开 Composio,登录或创建账号。",
+ "composioStepCreate": "创建一个项目 API 密钥,创建前选中 <strong>Read All</strong> 和 <strong>Write All</strong>。",
+ "composioStepPaste": "复制密钥,粘贴到下方,然后选择“保存密钥”。",
+ "composioStepReturn": "回到你的应用,选择“连接”,然后完成授权。",
+ "composioApiKey": "Composio API 密钥",
+ "composioKeyHint": "请使用具有完整读写权限(Read All 和 Write All)的密钥。密钥会加密保存,之后不会再显示。",
+ "checkingKey": "正在检查密钥…",
+ "saveKey": "保存密钥",
+ "authorizationComplete": "授权完成",
+ "canCloseWindow": "你可以关闭这个窗口了。",
+ "agentAccounts": "这个 Agent 可以使用的账号",
+ "noConnectedAccounts": "还没有已连接的账号。",
+ "connectAnotherApp": "连接其他应用",
+ "connectionPending": "连接待完成",
+ "connectionNeedsAttention": "连接需要处理",
+ "accessUnavailable": "无法为这个 Agent 设置访问权限",
+ "loadingAccess": "正在加载访问权限…",
+ "retryAccess": "重新加载访问权限",
+ "allowAgentAccess": "允许 Agent 访问 {account}"
}
}