Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
7b2841f
Localize scheduler navigation, preview and initial MCP messages
haltakov Nov 5, 2026
9622582
Translate sign-in and connected account controls
haltakov Nov 5, 2026
6403b1d
Keep scheduler drafts when refreshing interface language
haltakov Nov 5, 2026
3ad4d58
Localize SimplePost MCP tools and publishing widgets
haltakov Nov 5, 2026
dd15ee4
Translate editor settings and scheduler preferences
haltakov Nov 5, 2026
597cb8b
Translate API key management and sign-in emails
haltakov Nov 6, 2026
786a925
Localize social account setup and authorization recovery
haltakov Nov 6, 2026
00544af
Load only the selected widget language catalog
haltakov Nov 6, 2026
9c19622
Localize scheduler metadata and share artwork in fifteen languages
haltakov Nov 6, 2026
a88d6d4
Route remaining billing and publishing-option copy through locale ove…
haltakov Nov 6, 2026
bbdc2f8
Extract scheduler static pages and error UI into complete-sentence ca…
haltakov Nov 6, 2026
a27d431
Localize billing and trial display copy without changing payment cont…
haltakov Nov 6, 2026
f4a377b
Localize admin reports and authorization screen copy
haltakov Nov 6, 2026
0fa37cf
Localize composer feedback uploads and MCP documentation
haltakov Nov 6, 2026
d7c12aa
Localize recovery scheduling and image review display copy
haltakov Nov 6, 2026
877714d
Localize scheduling calendars dates and pagination controls
haltakov Nov 6, 2026
d6134c6
Localize composer consent and browser WebMCP descriptions and validation
haltakov Nov 6, 2026
88535ba
Localize quote, onboarding, account customization and accessible UI copy
haltakov Nov 6, 2026
1a9f874
Localize client fallback errors and preserve draft state across UI la…
haltakov Nov 6, 2026
66d53a4
Propagate per-host widget locale and localize authored chat prompts
haltakov Nov 6, 2026
9ff867a
Preserve opaque rich-text slots across server rendering
haltakov Nov 6, 2026
34b65bc
Route scheduling and trial errors by stable reasons before localization
haltakov Nov 6, 2026
085ca75
fix(i18n): retain locale handoff from public sites
haltakov Nov 6, 2026
b9b51ca
feat(i18n): scope Core server messages and persist UI language
haltakov Nov 6, 2026
e300b18
feat(i18n): localize widget bootstrap and toast accessibility
haltakov Nov 6, 2026
1ed004b
Translate complete scheduler UI copy across 15 locales
haltakov Nov 6, 2026
54c4f82
Localize SDK validation diagnostics at response boundaries
haltakov Nov 6, 2026
90d45bc
Localize OAuth, account health, and editor diagnostics
haltakov Nov 6, 2026
885b4e3
Activate localized scheduler server and MCP catalogs
haltakov Nov 6, 2026
6da5cfa
Translate MCP operating instructions into Bulgarian, German, and Italian
haltakov Nov 6, 2026
74ba21d
Translate MCP operating instructions into Korean
haltakov Nov 6, 2026
49e237f
Preserve MCP image fit values in localized retry instructions
haltakov Nov 8, 2026
561ba7b
Fix localization checks and keep test fixtures deterministic
haltakov Nov 8, 2026
bf09569
Integrate current error reporting with localized MCP tools
haltakov Nov 8, 2026
b572f48
Complete MCP workflow guide translations in all target locales
haltakov Nov 8, 2026
320a94f
Use compact footer locale control across scheduler pages
haltakov Nov 11, 2026
08d1e23
Merge remote-tracking branch 'origin/main' into codex/i18n-all-locales
haltakov Nov 11, 2026
0087582
Localize standalone recovery after integrating current main
haltakov Nov 11, 2026
0e25b79
Format user menu after moving language control to footer
haltakov Nov 11, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
5 changes: 5 additions & 0 deletions .github/workflows/check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,11 @@ jobs:
run: corepack enable
- name: Install dependencies
run: yarn install --immutable
- name: Validate complete scheduler localization
run: |
yarn workspace @simple-post/scheduler test:i18n
yarn workspace @simple-post/scheduler i18n:copy:check
yarn workspace @simple-post/scheduler artwork:check
- name: Run Scheduler tests
env:
NODE_OPTIONS: --max_old_space_size=4096
Expand Down
51 changes: 50 additions & 1 deletion e2e/scripts/extensions-smoke.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ if(location.search.includes('review')) {
window.addEventListener('message', async event => {
const req=event.data; if(req.jsonrpc!=='2.0') return;
const send=(result)=>event.source.postMessage({jsonrpc:'2.0',id:req.id,result},'*');
if(req.method==='ui/initialize') send({protocolVersion:req.params.protocolVersion,hostInfo:{name:'SimplePost smoke host',version:'1'},hostCapabilities:{serverTools:{},openLinks:{},updateModelContext:{text:{},structuredContent:{}},message:{text:{}}},hostContext:{theme:'dark',displayMode:'fullscreen',availableDisplayModes:['fullscreen']}});
if(req.method==='ui/initialize') send({protocolVersion:req.params.protocolVersion,hostInfo:{name:'SimplePost smoke host',version:'1'},hostCapabilities:{serverTools:{},openLinks:{},updateModelContext:{text:{},structuredContent:{}},message:{text:{}}},hostContext:{theme:'dark',locale:new URLSearchParams(location.search).get('locale') || 'en',displayMode:'fullscreen',availableDisplayModes:['fullscreen']}});
else if(req.method==='ui/notifications/initialized') {
if(location.search.includes('launch-error')) event.source.postMessage({jsonrpc:'2.0',method:'ui/notifications/tool-result',params:{isError:true,content:[{type:'text',text:'The workspace could not be opened. Reconnect SimplePost and try again.'}]}},'*');
else if(location.search.includes('missing-result')) { /* Sidebar host did not deliver the opening result. */ }
Expand Down Expand Up @@ -198,6 +198,11 @@ try {
browser = await chromium.launch({ headless: true });
const page = await browser.newPage({ viewport: { width: 1440, height: 1000 }, timezoneId: "America/Los_Angeles" });
const errors = [];
const requestedLocales = new Set();
page.on("request", (request) => {
const locale = new URL(request.url()).pathname.match(/\/mcp-widgets\/locale-(.+)-[A-Z0-9]{8}\.js$/)?.[1];
if (locale) requestedLocales.add(locale);
});
page.on("pageerror", (error) => {
errors.push(error.message);
console.error("Widget error:", error.message);
Expand Down Expand Up @@ -361,6 +366,36 @@ try {
await ui.getByLabel("Post text", { exact: true }).fill("LinkedIn version");
await ui.getByRole("tab", { name: "Preview LinkedIn for Test linkedin", exact: true }).click();
await expect(ui.locator("simple-post-preview")).toContainText("LinkedIn version");
const setWidgetLocale = (locale) =>
page.evaluate(
(locale) =>
document.querySelector("iframe").contentWindow.postMessage(
{
jsonrpc: "2.0",
method: "ui/notifications/host-context-changed",
params: { locale },
},
"*",
),
locale,
);
await setWidgetLocale("ja-JP");
await expect(ui.getByLabel("投稿本文", { exact: true })).toHaveValue("LinkedIn version");
await ui.getByText("LinkedIn の公開オプション", { exact: true }).click();
const audience = ui.locator(".sp-options").getByRole("combobox");
await expect(audience).toHaveAccessibleName(/公開範囲/);
await audience.selectOption({ label: "つながり" });
await expect
.poll(() =>
page.evaluate(
() =>
window.calls.filter((c) => c.name === "update_post_editor_session").at(-1)?.args.content.accountOptions
.linkedin?.visibility,
),
)
.toBe("CONNECTIONS");
await setWidgetLocale("en-US");
await expect(ui.getByLabel("Post text", { exact: true })).toHaveValue("LinkedIn version");
await ui.getByRole("tab", { name: "Preview X for Test x", exact: true }).click();
await expect(ui.locator("simple-post-preview")).toContainText("Launch day. Working on the details.");
await ui.getByRole("button", { name: "Hide manual editor", exact: true }).click();
Expand Down Expand Up @@ -501,6 +536,20 @@ try {
await ui.getByRole("radio", { name: "Month view", exact: true }).click();
await expect.poll(() => page.evaluate(() => window.calls.at(-1)?.args.view)).toBe("month");
await expect(ui.getByRole("button", { name: "Expand", exact: true })).toBeVisible();
await page.goto(`${base}/?legacy-schedule&week&locale=ar-EG`);
await expect(ui.locator("html")).toHaveAttribute("lang", "ar");
await expect(ui.locator("html")).toHaveAttribute("dir", "rtl");
await expect(ui.getByRole("button", { name: "اليوم", exact: true })).toBeVisible();
await expect(ui.getByText("Europe/Berlin", { exact: true })).toBeVisible();
await expect(
ui.getByText("A little behind the scenes from today’s launch.", { exact: true }).filter({ visible: true }),
).toBeVisible();
await setWidgetLocale("ja-JP");
await expect(ui.locator("html")).toHaveAttribute("lang", "ja");
await expect(ui.locator("html")).toHaveAttribute("dir", "ltr");
await expect(ui.getByRole("button", { name: "今日", exact: true })).toBeVisible();
await expect(ui.getByText("Europe/Berlin", { exact: true })).toBeVisible();
assert.deepEqual([...requestedLocales].sort(), ["ar", "ja"]);
assert.deepEqual(errors, []);
console.log(
"PASS extensions browser smoke: AM/PM labels across calendar views and legacy widget, workspace timezone independent of browser, sidebar startup errors/retry, missing and late launch data, calendar, selection chat, slot time, autosave, 11 platform tabs, keyboard navigation, legacy review, variant isolation, AI proposals, recovery, context removal, explicit review, narrow layout, onboarding, editor entrypoint.",
Expand Down
17 changes: 16 additions & 1 deletion e2e/tests/assistant-connection.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,12 @@ test.beforeAll(async () => {
import Accounts from './app/(protected)/accounts/page';
import ProtectedLayout from './app/(protected)/layout';
import {QueryClientProvider} from './lib/query-client';
createRoot(document.getElementById('root')).render(<QueryClientProvider><ProtectedLayout><Accounts/></ProtectedLayout></QueryClientProvider>);
import {UiLocaleProvider} from './lib/i18n/client';
import arabic from './lib/i18n/messages/ar.json';
const locale = new URLSearchParams(location.search).get('locale') === 'ar' ? 'ar' : 'en';
document.documentElement.lang = locale;
document.documentElement.dir = locale === 'ar' ? 'rtl' : 'ltr';
createRoot(document.getElementById('root')).render(<UiLocaleProvider locale={locale} messages={locale === 'ar' ? arabic : {}}><QueryClientProvider><ProtectedLayout><Accounts/></ProtectedLayout></QueryClientProvider></UiLocaleProvider>);
`,
},
bundle: true,
Expand Down Expand Up @@ -143,3 +148,13 @@ test("AI-origin success stays on confirmation; ordinary connection keeps its pre
await page.goto("https://handoff.test/accounts?success=true&platform=x");
await expect(page.getByText("Account connected. Continue in your AI assistant.")).toHaveCount(0);
});

test("Arabic connection guidance keeps the exact provider and handoff token", async ({ page }) => {
await install(page, 403);
const prepared = page.waitForRequest("**/api/connect/handoff");
await page.goto("https://handoff.test/accounts?onboarding=connect&platform=x&handoffToken=fixture&locale=ar");
expect((await prepared).postDataJSON()).toEqual({ platform: "x", handoffToken: "fixture" });
await expect(page.locator("html")).toHaveAttribute("dir", "rtl");
await expect(page.getByText("سجّل الدخول بحساب SimplePost المرتبط بمساعد الذكاء الاصطناعي لديك.")).toBeVisible();
await expect(page.getByRole("button", { name: "استخدم حساب SimplePost آخر" })).toBeVisible();
});
2 changes: 2 additions & 0 deletions e2e/tests/billing-translation.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,9 @@ test.beforeAll(async () => {
"next/link": "export {default as default} from 'react-link-mock';",
"next/navigation": `
const params = new URLSearchParams();
const router = { refresh() {}, replace() {} };
export const usePathname = () => location.pathname;
export const useRouter = () => router;
export const useSearchParams = () => params;
`,
"@/lib/auth/auth-client": `export const useSession = () => ({data: {user: {name: 'Test User', email: 'test@example.test'}}}); export const authClient = {};`,
Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@
"test:error-reporting": "node --test tests/error-reporting.test.mjs"
},
"resolutions": {
"postcss": "^8.5.16"
"postcss": "^8.5.16",
"@simple-post/preview@npm:0.4.0-i18n.0": "file:./vendor/simple-post-preview-0.4.0-i18n.0.tgz"
},
"engines": {
"node": ">=22.23.4 <23 || >=24.22.1 <25 || >=26.12.1 <27"
Expand Down
72 changes: 39 additions & 33 deletions scheduler/app/(protected)/accounts/connect/[platform]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ import { Button } from "@/components/ui/button";
import { Checkbox } from "@/components/ui/checkbox";
import { getPlatformById, isSocialPlatformEnabled } from "@/lib/config";
import { platformHelpPath } from "@/lib/docs";
import { useUiTranslation } from "@/lib/i18n/client";
import type { MessageKey } from "@/lib/i18n/translate";

type PendingAccount = {
id: string;
Expand All @@ -30,7 +32,15 @@ type PendingConnection = {
accounts: PendingAccount[];
};

function pendingError(status: number, fallback: MessageKey): MessageKey {
if (status === 404) return "pendingConnectionMissing";
if (status === 410) return "pendingConnectionExpired";
if (status === 401) return "oauthSessionMismatch";
return fallback;
}

export default function ConnectAccountPickerPage() {
const { t } = useUiTranslation();
const router = useRouter();
const params = useParams<{ platform: string }>();
const searchParams = useSearchParams();
Expand All @@ -41,18 +51,18 @@ export default function ConnectAccountPickerPage() {
const [selectedIds, setSelectedIds] = useState<string[]>([]);
const [loading, setLoading] = useState(true);
const [submitting, setSubmitting] = useState(false);
const [error, setError] = useState<string | null>(null);
const [error, setError] = useState<MessageKey | null>(null);

const platformConfig = useMemo(() => getPlatformById(platformId), [platformId]);

useEffect(() => {
if (!isSocialPlatformEnabled(platformId)) {
setError("This social platform is not enabled in this environment.");
setError("platformNotEnabled");
setLoading(false);
return;
}
if (!pendingId) {
setError("Missing pending connection ID.");
setError("pendingConnectionMissing");
setLoading(false);
return;
}
Expand All @@ -62,18 +72,19 @@ export default function ConnectAccountPickerPage() {
setLoading(true);
const response = await fetch(`/api/connect/pending/${pendingId}`);
if (!response.ok) {
const data = await response.json().catch(() => ({}));
throw new Error(data.error || "Failed to load pending connection");
setError(pendingError(response.status, "pendingConnectionLoadFailed"));
return;
}
const data = (await response.json()) as PendingConnection;
if (data.platform !== platformId) {
throw new Error("Pending connection does not match the selected platform.");
setError("oauthPlatformMismatch");
return;
}
setPending(data);
setSelectedIds(data.accounts.map((account) => account.id));
setError(null);
} catch (error_) {
setError(error_ instanceof Error ? error_.message : "Failed to load pending connection");
} catch {
setError("pendingConnectionLoadFailed");
} finally {
setLoading(false);
}
Expand Down Expand Up @@ -108,16 +119,16 @@ export default function ConnectAccountPickerPage() {
});

if (!response.ok) {
const data = await response.json().catch(() => ({}));
throw new Error(data.error || "Failed to connect accounts");
setError(pendingError(response.status, "connectAccountsFailed"));
return;
}

const data = await response.json();
router.push(
`/accounts?success=true&platform=${platformId}&count=${data.count || 0}${data.source === "assistant_handoff" ? "&source=assistant_handoff" : ""}`,
);
} catch (error_) {
setError(error_ instanceof Error ? error_.message : "Failed to connect accounts");
} catch {
setError("connectAccountsFailed");
} finally {
setSubmitting(false);
}
Expand All @@ -142,12 +153,12 @@ export default function ConnectAccountPickerPage() {
<div className="max-w-4xl mx-auto px-[clamp(18px,4vw,48px)] py-12 space-y-6">
<Alert variant="destructive">
<AlertCircle className="h-4 w-4" />
<AlertTitle>Unable to continue</AlertTitle>
<AlertDescription>{error || "Pending connection not found."}</AlertDescription>
<AlertTitle>{t("unableToContinue")}</AlertTitle>
<AlertDescription>{t(error ?? "pendingConnectionMissing")}</AlertDescription>
</Alert>
<HelpLink path={platformHelpPath(platformId)}>Connection help</HelpLink>
<HelpLink path={platformHelpPath(platformId)}>{t("connectionHelp")}</HelpLink>
<Link href="/accounts">
<Button variant="outline">Back to Accounts</Button>
<Button variant="outline">{t("backToAccounts")}</Button>
</Link>
</div>
</div>
Expand All @@ -159,35 +170,27 @@ export default function ConnectAccountPickerPage() {
<Navbar />

<main className="max-w-5xl mx-auto px-[clamp(18px,4vw,48px)] py-6 space-y-5">
{error && (
<Alert variant="destructive">
<AlertCircle className="h-4 w-4" />
<AlertTitle>Something went wrong</AlertTitle>
<AlertDescription>{error}</AlertDescription>
</Alert>
)}

<div className="space-y-3">
<BackLink href="/accounts" label="Back to accounts" />
<HelpLink path={platformHelpPath(platformId)}>Account requirements and connection help</HelpLink>
<BackLink href="/accounts" label={t("backToAccounts")} />
<HelpLink path={platformHelpPath(platformId)}>{t("connectionRequirements")}</HelpLink>
<div className="flex items-center gap-3">
<div className="section-kicker !mb-0">
<span className="section-kicker-dot" />
<span className="section-kicker-label">{platformConfig.name}</span>
</div>
<span className="h-3 w-px bg-border" />
<h1 className="text-xl font-semibold tracking-[-0.025em] text-foreground">
Available <span className="text-primary">accounts</span>
<span className="text-primary">{t("availableAccounts")}</span>
</h1>
</div>
</div>

<div className="flex gap-2">
<Button variant="outline" size="sm" onClick={selectAll} disabled={pending.accounts.length === 0}>
Select all
{t("selectAll")}
</Button>
<Button variant="outline" size="sm" onClick={clearAll} disabled={selectedIds.length === 0}>
Clear
{t("clearSelection")}
</Button>
</div>

Expand All @@ -202,8 +205,9 @@ export default function ConnectAccountPickerPage() {
}`}>
<button
type="button"
aria-pressed={isSelected}
onClick={() => toggleSelection(account.id)}
className="flex w-full items-center gap-4 text-left">
className="flex w-full items-center gap-4 text-start">
<Checkbox
checked={isSelected}
onCheckedChange={() => toggleSelection(account.id)}
Expand All @@ -218,7 +222,9 @@ export default function ConnectAccountPickerPage() {
)}
</div>
<div>
<div className="font-medium text-sm">{account.name || account.username || account.id}</div>
<div dir="auto" className="font-medium text-sm">
{account.name || account.username || account.id}
</div>
{account.username && (
<div className="font-mono text-[11px] uppercase tracking-[0.08em] text-muted-foreground mt-0.5">
@{account.username.replace(/^@/, "")}
Expand All @@ -234,10 +240,10 @@ export default function ConnectAccountPickerPage() {

<div className="flex gap-3 pt-2">
<Button variant="outline" onClick={() => router.push("/accounts")} disabled={submitting} className="flex-1">
Cancel
{t("cancel")}
</Button>
<Button onClick={handleSubmit} disabled={submitting || selectedIds.length === 0} className="flex-1">
{submitting ? "Connecting..." : `Connect ${selectedIds.length} account(s)`}
{submitting ? t("connecting") : t("connectSelectedCount", { count: selectedIds.length })}
</Button>
</div>
</main>
Expand Down
Loading
Loading