Skip to content

A reactive notebook for Python — run reproducible experiments, query with SQL, execute as a script, deploy as an app, and version with git. Stored as pure Python. All in a modern, AI-native editor.

improvement: add locale to display config (#6432)

Myles Scolnick3952c545f868
diff --git a/frontend/src/components/chat/acp/__tests__/atoms.test.ts b/frontend/src/components/chat/acp/__tests__/atoms.test.ts
index 950dbeef1b..22e4fd6c1b 100644
--- a/frontend/src/components/chat/acp/__tests__/atoms.test.ts
+++ b/frontend/src/components/chat/acp/__tests__/atoms.test.ts
@@ -1,4 +1,4 @@
-/* Copyright 2025 Marimo. All rights reserved. */
+/* Copyright 2024 Marimo. All rights reserved. */
import { createStore } from "jotai";
import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";
diff --git a/frontend/src/components/chat/acp/__tests__/state.test.ts b/frontend/src/components/chat/acp/__tests__/state.test.ts
index f9c236f46e..ae14397460 100644
--- a/frontend/src/components/chat/acp/__tests__/state.test.ts
+++ b/frontend/src/components/chat/acp/__tests__/state.test.ts
@@ -1,4 +1,4 @@
-/* Copyright 2025 Marimo. All rights reserved. */
+/* Copyright 2024 Marimo. All rights reserved. */
import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";
import {
@@ -100,8 +100,8 @@ describe("state utility functions", () => {
agentId: "gemini",
tabId: "tab_existing" as TabId,
title: "Existing gemini session",
- createdAt: 1735689600000,
- lastUsedAt: 1735689600000,
+ createdAt: 1_735_689_600_000,
+ lastUsedAt: 1_735_689_600_000,
externalAgentSessionId: null,
};
const initialState: AgentSessionState = {
@@ -139,8 +139,8 @@ describe("state utility functions", () => {
agentId: "claude",
tabId: "tab_existing" as TabId,
title: "Existing claude session",
- createdAt: 1735689600000,
- lastUsedAt: 1735689600000,
+ createdAt: 1_735_689_600_000,
+ lastUsedAt: 1_735_689_600_000,
externalAgentSessionId: null,
};
const initialState: AgentSessionState = {
@@ -194,24 +194,24 @@ describe("state utility functions", () => {
agentId: "claude",
tabId: "tab_1" as TabId,
title: "Claude session 1",
- createdAt: 1735689600000,
- lastUsedAt: 1735689600000,
+ createdAt: 1_735_689_600_000,
+ lastUsedAt: 1_735_689_600_000,
externalAgentSessionId: null,
},
{
agentId: "gemini",
tabId: "tab_2" as TabId,
title: "Gemini session",
- createdAt: 1735689600000,
- lastUsedAt: 1735689600000,
+ createdAt: 1_735_689_600_000,
+ lastUsedAt: 1_735_689_600_000,
externalAgentSessionId: null,
},
{
agentId: "claude",
tabId: "tab_3" as TabId,
title: "Claude session 2",
- createdAt: 1735689600000,
- lastUsedAt: 1735689600000,
+ createdAt: 1_735_689_600_000,
+ lastUsedAt: 1_735_689_600_000,
externalAgentSessionId: null,
},
];
@@ -264,8 +264,8 @@ describe("state utility functions", () => {
agentId: "claude",
tabId: "tab_single" as TabId,
title: "Single session",
- createdAt: 1735689600000,
- lastUsedAt: 1735689600000,
+ createdAt: 1_735_689_600_000,
+ lastUsedAt: 1_735_689_600_000,
externalAgentSessionId: null,
};
const singleSessionState: AgentSessionState = {
@@ -297,16 +297,16 @@ describe("state utility functions", () => {
agentId: "claude",
tabId: "tab_1" as TabId,
title: "Original title",
- createdAt: 1735689600000,
- lastUsedAt: 1735689600000,
+ createdAt: 1_735_689_600_000,
+ lastUsedAt: 1_735_689_600_000,
externalAgentSessionId: null,
},
{
agentId: "gemini",
tabId: "tab_2" as TabId,
title: "Another title",
- createdAt: 1735689600000,
- lastUsedAt: 1735689600000,
+ createdAt: 1_735_689_600_000,
+ lastUsedAt: 1_735_689_600_000,
externalAgentSessionId: null,
},
];
@@ -361,16 +361,16 @@ describe("state utility functions", () => {
agentId: "claude",
tabId: "tab_1" as TabId,
title: "Claude session",
- createdAt: 1735689600000,
- lastUsedAt: 1735689600000,
+ createdAt: 1_735_689_600_000,
+ lastUsedAt: 1_735_689_600_000,
externalAgentSessionId: null,
},
{
agentId: "gemini",
tabId: "tab_2" as TabId,
title: "Gemini session",
- createdAt: 1735689600000,
- lastUsedAt: 1735689600000,
+ createdAt: 1_735_689_600_000,
+ lastUsedAt: 1_735_689_600_000,
externalAgentSessionId: null,
},
];
@@ -384,7 +384,7 @@ describe("state utility functions", () => {
const originalTimestamp = sessions[0].lastUsedAt;
// Advance time by 1 hour
- vi.advanceTimersByTime(3600000);
+ vi.advanceTimersByTime(3_600_000);
const newState = updateSessionLastUsed(state, sessions[0].tabId);
@@ -405,7 +405,7 @@ describe("state utility functions", () => {
const fakeId = "fake_session_id" as TabId;
const originalTimestamp = sessions[0].lastUsedAt;
- vi.advanceTimersByTime(3600000);
+ vi.advanceTimersByTime(3_600_000);
const newState = updateSessionLastUsed(state, fakeId);
@@ -424,16 +424,16 @@ describe("state utility functions", () => {
agentId: "claude",
tabId: "tab_1" as TabId,
title: "Claude session",
- createdAt: 1735689600000,
- lastUsedAt: 1735689600000,
+ createdAt: 1_735_689_600_000,
+ lastUsedAt: 1_735_689_600_000,
externalAgentSessionId: null,
},
{
agentId: "gemini",
tabId: "tab_2" as TabId,
title: "Gemini session",
- createdAt: 1735689600000,
- lastUsedAt: 1735689600000,
+ createdAt: 1_735_689_600_000,
+ lastUsedAt: 1_735_689_600_000,
externalAgentSessionId: null,
},
];
@@ -448,7 +448,7 @@ describe("state utility functions", () => {
const agentSessionId = "agent_session_123" as ExternalAgentSessionId;
// Advance time by 1 hour
- vi.advanceTimersByTime(3600000);
+ vi.advanceTimersByTime(3_600_000);
const newState = updateSessionExternalAgentSessionId(
state,
@@ -498,32 +498,32 @@ describe("state utility functions", () => {
agentId: "claude",
tabId: "tab_1" as TabId,
title: "First claude",
- createdAt: 1735689600000, // 2025-01-01T00:00:00Z
- lastUsedAt: 1735689600000,
+ createdAt: 1_735_689_600_000, // 2025-01-01T00:00:00Z
+ lastUsedAt: 1_735_689_600_000,
externalAgentSessionId: null,
},
{
agentId: "gemini",
tabId: "tab_2" as TabId,
title: "First gemini",
- createdAt: 1735693200000, // 2025-01-01T01:00:00Z
- lastUsedAt: 1735693200000,
+ createdAt: 1_735_693_200_000, // 2025-01-01T01:00:00Z
+ lastUsedAt: 1_735_693_200_000,
externalAgentSessionId: null,
},
{
agentId: "claude",
tabId: "tab_3" as TabId,
title: "Second claude",
- createdAt: 1735696800000, // 2025-01-01T02:00:00Z
- lastUsedAt: 1735696800000,
+ createdAt: 1_735_696_800_000, // 2025-01-01T02:00:00Z
+ lastUsedAt: 1_735_696_800_000,
externalAgentSessionId: null,
},
{
agentId: "claude",
tabId: "tab_4" as TabId,
title: "Third claude",
- createdAt: 1735700400000, // 2025-01-01T03:00:00Z
- lastUsedAt: 1735700400000,
+ createdAt: 1_735_700_400_000, // 2025-01-01T03:00:00Z
+ lastUsedAt: 1_735_700_400_000,
externalAgentSessionId: null,
},
];
diff --git a/frontend/src/components/chat/acp/agent-panel.tsx b/frontend/src/components/chat/acp/agent-panel.tsx
index 6d3fb67ef8..32a4029b36 100644
--- a/frontend/src/components/chat/acp/agent-panel.tsx
+++ b/frontend/src/components/chat/acp/agent-panel.tsx
@@ -383,31 +383,29 @@ const PromptArea = memo<PromptAreaProps>(
<AtSignIcon className="h-3.5 w-3.5" />
</Button>
</Tooltip>
- <>
- <Tooltip content="Attach a file">
- <Button
- variant="text"
- size="icon"
- className="cursor-pointer"
- onClick={() => fileInputRef.current?.click()}
- title="Attach a file"
- >
- <PaperclipIcon className="h-3.5 w-3.5" />
- </Button>
- </Tooltip>
- <Input
- ref={fileInputRef}
- type="file"
- multiple={true}
- hidden={true}
- onChange={(event) => {
- if (event.target.files) {
- onAddFiles([...event.target.files]);
- }
- }}
- accept={SUPPORTED_ATTACHMENT_TYPES.join(",")}
- />
- </>
+ <Tooltip content="Attach a file">
+ <Button
+ variant="text"
+ size="icon"
+ className="cursor-pointer"
+ onClick={() => fileInputRef.current?.click()}
+ title="Attach a file"
+ >
+ <PaperclipIcon className="h-3.5 w-3.5" />
+ </Button>
+ </Tooltip>
+ <Input
+ ref={fileInputRef}
+ type="file"
+ multiple={true}
+ hidden={true}
+ onChange={(event) => {
+ if (event.target.files) {
+ onAddFiles([...event.target.files]);
+ }
+ }}
+ accept={SUPPORTED_ATTACHMENT_TYPES.join(",")}
+ />
<Tooltip content={isLoading ? "Stop" : "Submit"}>
<Button
variant="text"
@@ -844,8 +842,7 @@ const AgentPanel: React.FC = () => {
// Parse context from the prompt
const { contextBlocks, attachmentBlocks } =
await parseContextFromPrompt(prompt);
- promptBlocks.push(...contextBlocks);
- promptBlocks.push(...attachmentBlocks);
+ promptBlocks.push(...contextBlocks, ...attachmentBlocks);
// Add manually uploaded files as resource links
if (files && files.length > 0) {
diff --git a/frontend/src/components/chat/acp/blocks.tsx b/frontend/src/components/chat/acp/blocks.tsx
index 6c8a1f1972..21a522e125 100644
--- a/frontend/src/components/chat/acp/blocks.tsx
+++ b/frontend/src/components/chat/acp/blocks.tsx
@@ -501,11 +501,9 @@ export const SessionNotificationsBlock = <
}
if (kind === "current_mode_update") {
const lastItem = items.at(-1);
- if (lastItem?.sessionUpdate !== "current_mode_update") {
- return null;
- } else {
- return <CurrentModeBlock data={lastItem} />;
- }
+ return lastItem?.sessionUpdate === "current_mode_update" ? (
+ <CurrentModeBlock data={lastItem} />
+ ) : null;
}
return (
diff --git a/frontend/src/components/editor/renderers/slides-layout/types.ts b/frontend/src/components/editor/renderers/slides-layout/types.ts
index 5e5e93ff6e..24220fa776 100644
--- a/frontend/src/components/editor/renderers/slides-layout/types.ts
+++ b/frontend/src/components/editor/renderers/slides-layout/types.ts
@@ -5,6 +5,7 @@
* The serialized form of a slides layout.
* This must be backwards-compatible as it is stored on the user's disk.
*/
+// eslint-disable-next-line @typescript-eslint/no-empty-object-type
export type SerializedSlidesLayout = {};
export interface SlidesLayout extends SerializedSlidesLayout {
diff --git a/frontend/src/components/terminal/theme.tsx b/frontend/src/components/terminal/theme.tsx
index 1cdeab002b..c008c66865 100644
--- a/frontend/src/components/terminal/theme.tsx
+++ b/frontend/src/components/terminal/theme.tsx
@@ -1,3 +1,4 @@
+/* Copyright 2024 Marimo. All rights reserved. */
import type { ResolvedTheme } from "@/theme/useTheme";
// Terminal theme configuration
diff --git a/frontend/src/core/config/config-schema.ts b/frontend/src/core/config/config-schema.ts
index 3d0d08db20..771e43d0ba 100644
--- a/frontend/src/core/config/config-schema.ts
+++ b/frontend/src/core/config/config-schema.ts
@@ -144,6 +144,7 @@ export const UserConfigSchema = z
}
return width;
}),
+ locale: z.string().nullable().optional(),
reference_highlighting: z.boolean().default(false),
})
.passthrough()
diff --git a/frontend/src/core/config/config.ts b/frontend/src/core/config/config.ts
index 8b5de4039b..e2b128259b 100644
--- a/frontend/src/core/config/config.ts
+++ b/frontend/src/core/config/config.ts
@@ -82,6 +82,10 @@ export const editorFontSizeAtom = atom<number>((get) => {
return get(resolvedMarimoConfigAtom).display.code_editor_font_size;
});
+export const localeAtom = atom<string | null | undefined>((get) => {
+ return get(resolvedMarimoConfigAtom).display.locale;
+});
+
export function isAiEnabled(config: UserConfig) {
return (
Boolean(config.ai?.models?.chat_model) ||
diff --git a/frontend/src/core/i18n/__tests__/locale-provider.test.tsx b/frontend/src/core/i18n/__tests__/locale-provider.test.tsx
new file mode 100644
index 0000000000..5d01ff202e
--- /dev/null
+++ b/frontend/src/core/i18n/__tests__/locale-provider.test.tsx
@@ -0,0 +1,154 @@
+/* Copyright 2024 Marimo. All rights reserved. */
+
+import { cleanup, render } from "@testing-library/react";
+import { createStore, Provider } from "jotai";
+import { afterEach, describe, expect, it, vi } from "vitest";
+import { userConfigAtom } from "@/core/config/config";
+import { parseUserConfig } from "@/core/config/config-schema";
+import { LocaleProvider } from "../locale-provider";
+
+// Mock react-aria-components I18nProvider
+vi.mock("react-aria-components", () => ({
+ I18nProvider: ({
+ children,
+ locale,
+ }: {
+ children: React.ReactNode;
+ locale?: string;
+ }) => (
+ <div data-testid="i18n-provider" data-locale={locale}>
+ {children}
+ </div>
+ ),
+}));
+
+describe("LocaleProvider", () => {
+ afterEach(() => {
+ cleanup();
+ });
+
+ it("should render I18nProvider without locale when locale is null", () => {
+ const store = createStore();
+ const config = parseUserConfig({ display: { locale: null } });
+ store.set(userConfigAtom, config);
+
+ const { getByTestId } = render(
+ <Provider store={store}>
+ <LocaleProvider>
+ <div>Test content</div>
+ </LocaleProvider>
+ </Provider>,
+ );
+
+ const i18nProvider = getByTestId("i18n-provider");
+ expect(i18nProvider).toBeInTheDocument();
+ expect(i18nProvider.dataset.locale).toBe(undefined);
+ expect(i18nProvider).toHaveTextContent("Test content");
+ });
+
+ it("should render I18nProvider without locale when locale is undefined", () => {
+ const store = createStore();
+ const config = parseUserConfig({ display: { locale: undefined } });
+ store.set(userConfigAtom, config);
+
+ const { getByTestId } = render(
+ <Provider store={store}>
+ <LocaleProvider>
+ <div>Test content</div>
+ </LocaleProvider>
+ </Provider>,
+ );
+
+ const i18nProvider = getByTestId("i18n-provider");
+ expect(i18nProvider).toBeInTheDocument();
+ expect(i18nProvider.dataset.locale).toBe(undefined);
+ expect(i18nProvider).toHaveTextContent("Test content");
+ });
+
+ it("should render I18nProvider with locale when locale is provided", () => {
+ const store = createStore();
+ const testLocale = "es-ES";
+ const config = parseUserConfig({ display: { locale: testLocale } });
+ store.set(userConfigAtom, config);
+
+ const { getByTestId } = render(
+ <Provider store={store}>
+ <LocaleProvider>
+ <div>Test content</div>
+ </LocaleProvider>
+ </Provider>,
+ );
+
+ const i18nProvider = getByTestId("i18n-provider");
+ expect(i18nProvider).toBeInTheDocument();
+ expect(i18nProvider.dataset.locale).toBe(testLocale);
+ expect(i18nProvider).toHaveTextContent("Test content");
+ });
+
+ it("should render I18nProvider with different locale values", () => {
+ const testCases = ["en-US", "fr-FR", "de-DE", "ja-JP"];
+
+ testCases.forEach((locale) => {
+ const store = createStore();
+ const config = parseUserConfig({ display: { locale } });
+ store.set(userConfigAtom, config);
+
+ const { getByTestId } = render(
+ <Provider store={store}>
+ <LocaleProvider>
+ <div>Test content for {locale}</div>
+ </LocaleProvider>
+ </Provider>,
+ );
+
+ const i18nProvider = getByTestId("i18n-provider");
+ expect(i18nProvider.dataset.locale).toBe(locale);
+ expect(i18nProvider).toHaveTextContent(`Test content for ${locale}`);
+
+ // Clean up after each iteration
+ cleanup();
+ });
+ });
+
+ it("should render children correctly", () => {
+ const store = createStore();
+ const config = parseUserConfig({ display: { locale: "en-US" } });
+ store.set(userConfigAtom, config);
+
+ const { getByText, getByRole } = render(
+ <Provider store={store}>
+ <LocaleProvider>
+ <div>
+ <h1>Test Heading</h1>
+ <p>Test paragraph</p>
+ <button type="button">Test Button</button>
+ </div>
+ </LocaleProvider>
+ </Provider>,
+ );
+
+ expect(getByText("Test Heading")).toBeInTheDocument();
+ expect(getByText("Test paragraph")).toBeInTheDocument();
+ expect(getByRole("button", { name: "Test Button" })).toBeInTheDocument();
+ });
+
+ it("should auto-detect locale when no locale is set in config", () => {
+ const store = createStore();
+ const config = parseUserConfig({});
+ store.set(userConfigAtom, config);
+
+ const { getByTestId } = render(
+ <Provider store={store}>
+ <LocaleProvider>
+ <div>Test content</div>
+ </LocaleProvider>
+ </Provider>,
+ );
+
+ const i18nProvider = getByTestId("i18n-provider");
+ expect(i18nProvider).toBeInTheDocument();
+ // When no locale is specified in config, it should default to undefined/null
+ expect(i18nProvider.dataset.locale).toBe(undefined);
+ expect(i18nProvider).toHaveTextContent("Test content");
+ });
+});
diff --git a/frontend/src/core/i18n/local-provider.tsx b/frontend/src/core/i18n/local-provider.tsx
deleted file mode 100644
index f77162dc43..0000000000
--- a/frontend/src/core/i18n/local-provider.tsx
+++ /dev/null
@@ -1,12 +0,0 @@
-/* Copyright 2024 Marimo. All rights reserved. */
-
-import type { ReactNode } from "react";
-import { I18nProvider } from "react-aria-components";
-
-interface LocaleProviderProps {
- children: ReactNode;
-}
-
-export const LocaleProvider = ({ children }: LocaleProviderProps) => {
- return <I18nProvider>{children}</I18nProvider>;
-};
diff --git a/frontend/src/core/i18n/locale-provider.tsx b/frontend/src/core/i18n/locale-provider.tsx
new file mode 100644
index 0000000000..e727978142
--- /dev/null
+++ b/frontend/src/core/i18n/locale-provider.tsx
@@ -0,0 +1,21 @@
+/* Copyright 2024 Marimo. All rights reserved. */
+
+import { useAtomValue } from "jotai";
+import type { ReactNode } from "react";
+import { I18nProvider } from "react-aria-components";
+import { localeAtom } from "@/core/config/config";
+
+interface LocaleProviderProps {
+ children: ReactNode;
+}
+
+export const LocaleProvider = ({ children }: LocaleProviderProps) => {
+ const locale = useAtomValue(localeAtom);
+
+ // If locale is null or undefined, let React Aria auto-detect
+ if (!locale) {
+ return <I18nProvider>{children}</I18nProvider>;
+ }
+
+ return <I18nProvider locale={locale}>{children}</I18nProvider>;
+};
diff --git a/frontend/src/core/islands/components/web-components.tsx b/frontend/src/core/islands/components/web-components.tsx
index db5075b227..01924f9206 100644
--- a/frontend/src/core/islands/components/web-components.tsx
+++ b/frontend/src/core/islands/components/web-components.tsx
@@ -7,7 +7,7 @@ import { ErrorBoundary } from "@/components/editor/boundary/ErrorBoundary";
import { TooltipProvider } from "@/components/ui/tooltip";
import { notebookAtom } from "@/core/cells/cells";
import { UI_ELEMENT_REGISTRY } from "@/core/dom/uiregistry";
-import { LocaleProvider } from "@/core/i18n/local-provider";
+import { LocaleProvider } from "@/core/i18n/locale-provider";
import { renderHTML } from "@/plugins/core/RenderHTML";
import { invariant } from "@/utils/invariant";
import type { CellId } from "../../cells/ids";
diff --git a/frontend/src/core/kernel/messages.ts b/frontend/src/core/kernel/messages.ts
index db37864e11..0f880a27e2 100644
--- a/frontend/src/core/kernel/messages.ts
+++ b/frontend/src/core/kernel/messages.ts
@@ -46,9 +46,9 @@ export type Capabilities = OperationMessageData<"kernel-ready">["capabilities"];
export type MessageOperationUnion = schemas["KnownUnions"]["operation"];
export type OperationMessageType = MessageOperationUnion["op"];
-export type OperationMessage = {
+export interface OperationMessage {
data: MessageOperationUnion;
-};
+}
export type OperationMessageData<T extends OperationMessageType> = Omit<
Extract<MessageOperationUnion, { op: T }>,
diff --git a/frontend/src/mount.tsx b/frontend/src/mount.tsx
index 8a0f2964e9..ac45be7218 100644
--- a/frontend/src/mount.tsx
+++ b/frontend/src/mount.tsx
@@ -26,7 +26,7 @@ import {
parseConfigOverrides,
parseUserConfig,
} from "./core/config/config-schema";
-import { LocaleProvider } from "./core/i18n/local-provider";
+import { LocaleProvider } from "./core/i18n/locale-provider";
import { MarimoApp, preloadPage } from "./core/MarimoApp";
import { type AppMode, initialModeAtom, viewStateAtom } from "./core/mode";
import { cleanupAuthQueryParams } from "./core/network/auth";
diff --git a/frontend/src/plugins/core/registerReactComponent.tsx b/frontend/src/plugins/core/registerReactComponent.tsx
index 868a9671c5..be81bdd6da 100644
--- a/frontend/src/plugins/core/registerReactComponent.tsx
+++ b/frontend/src/plugins/core/registerReactComponent.tsx
@@ -8,6 +8,7 @@
* component. The factory handles the logic of communicating UI element values
* to and from the rest of marimo.
*/
+import { Provider } from "jotai";
import React, {
createRef,
type JSX,
@@ -29,7 +30,7 @@ import { createInputEvent, MarimoValueUpdateEvent } from "@/core/dom/events";
import { getUIElementObjectId } from "@/core/dom/ui-element";
import { UIElementRegistry } from "@/core/dom/uiregistry";
import { FUNCTIONS_REGISTRY } from "@/core/functions/FunctionRegistry";
-import { LocaleProvider } from "@/core/i18n/local-provider";
+import { LocaleProvider } from "@/core/i18n/locale-provider";
import { store } from "@/core/state/jotai";
import {
type HTMLElementNotDerivedFromRef,
@@ -364,18 +365,20 @@ export function registerReactComponent<T>(plugin: IPlugin<T, unknown>): void {
invariant(this.root, "Root must be defined");
this.root.render(
- <LocaleProvider>
- <PluginSlot
- hostElement={this}
- plugin={plugin}
- ref={this.pluginRef}
- getInitialValue={() => {
- return parseInitialValue(this, UIElementRegistry.INSTANCE);
- }}
- >
- {this.getChildren()}
- </PluginSlot>
- </LocaleProvider>,
+ <Provider store={store}>
+ <LocaleProvider>
+ <PluginSlot
+ hostElement={this}
+ plugin={plugin}
+ ref={this.pluginRef}
+ getInitialValue={() => {
+ return parseInitialValue(this, UIElementRegistry.INSTANCE);
+ }}
+ >
+ {this.getChildren()}
+ </PluginSlot>
+ </LocaleProvider>
+ </Provider>,
);
}
diff --git a/frontend/src/utils/errors.ts b/frontend/src/utils/errors.ts
index 5789372605..016474d4f1 100644
--- a/frontend/src/utils/errors.ts
+++ b/frontend/src/utils/errors.ts
@@ -64,7 +64,7 @@ function safeJSONParse(message: string): unknown {
export class CellNotInitializedError extends Error {
constructor(
- message: string = "The cell containing this UI element has not been run yet. Please run the cell first.",
+ message = "The cell containing this UI element has not been run yet. Please run the cell first.",
) {
super(message);
this.name = "CellNotInitializedError";
diff --git a/marimo/_config/config.py b/marimo/_config/config.py
index aa4eecc97d..9183f4e49a 100644
--- a/marimo/_config/config.py
+++ b/marimo/_config/config.py
@@ -174,6 +174,7 @@ class DisplayConfig(TypedDict):
- `default_table_page_size`: default number of rows to display in tables
- `default_table_max_columns`: default maximum number of columns to display in tables
- `reference_highlighting`: if `True`, highlight reactive variable references
+ - `locale`: locale for date formatting and internationalization (e.g., "en-US", "en-GB", "de-DE")
"""
theme: Theme
@@ -185,6 +186,7 @@ class DisplayConfig(TypedDict):
default_table_page_size: int
default_table_max_columns: int
reference_highlighting: NotRequired[bool]
+ locale: NotRequired[Optional[str]]
@mddoc
diff --git a/packages/openapi/api.yaml b/packages/openapi/api.yaml
index c2de0b612d..d5240531be 100644
--- a/packages/openapi/api.yaml
+++ b/packages/openapi/api.yaml
@@ -1067,7 +1067,9 @@ components:
\ of paths to custom CSS files\n - `default_table_page_size`: default number\
\ of rows to display in tables\n - `default_table_max_columns`: default\
\ maximum number of columns to display in tables\n - `reference_highlighting`:\
- \ if `True`, highlight reactive variable references"
+ \ if `True`, highlight reactive variable references\n - `locale`: locale\
+ \ for date formatting and internationalization (e.g., \"en-US\", \"en-GB\"\
+ , \"de-DE\")"
properties:
cell_output:
enum:
@@ -1094,6 +1096,10 @@ components:
- full
- medium
- normal
+ locale:
+ anyOf:
+ - type: string
+ - type: 'null'
reference_highlighting:
type: boolean
theme:
@@ -3387,7 +3393,7 @@ components:
type: object
info:
title: marimo API
- version: 0.15.3
+ version: 0.15.5
openapi: 3.1.0
paths:
/@file/{filename_and_length}:
diff --git a/packages/openapi/src/api.ts b/packages/openapi/src/api.ts
index e44fe7567c..7e8d9a7617 100644
--- a/packages/openapi/src/api.ts
+++ b/packages/openapi/src/api.ts
@@ -3208,6 +3208,7 @@ export interface components {
* - `default_table_page_size`: default number of rows to display in tables
* - `default_table_max_columns`: default maximum number of columns to display in tables
* - `reference_highlighting`: if `True`, highlight reactive variable references
+ * - `locale`: locale for date formatting and internationalization (e.g., "en-US", "en-GB", "de-DE")
*/
DisplayConfig: {
/** @enum {unknown} */
@@ -3220,6 +3221,7 @@ export interface components {
default_table_page_size: number;
/** @enum {unknown} */
default_width: "columns" | "compact" | "full" | "medium" | "normal";
+ locale?: string | null;
reference_highlighting?: boolean;
/** @enum {unknown} */
theme: "dark" | "light" | "system";