Skip to content

feat: add Simplified Chinese localization#2008

Open
Sunnnnch wants to merge 1 commit into
CapSoftware:mainfrom
Sunnnnch:codex/chinese-localization
Open

feat: add Simplified Chinese localization#2008
Sunnnnch wants to merge 1 commit into
CapSoftware:mainfrom
Sunnnnch:codex/chinese-localization

Conversation

@Sunnnnch

@Sunnnnch Sunnnnch commented Jul 15, 2026

Copy link
Copy Markdown

add Simplified Chinese localization

@greptile-apps

greptile-apps Bot commented Jul 15, 2026

Copy link
Copy Markdown
Contributor

Too many files changed for review. (426 files found, 100 file limit)

Bypass the limit by tagging @greptile-apps to review.

reject(
new Error(chrome.runtime.lastError.message ?? "Failed to open tab"),
);
reject(new Error(chrome.runtime.lastError.message ?? "打开标签页失败"));

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These fallback error strings are now Chinese. If the extension isn’t actually locale-switched yet, this will surface Chinese for everyone and makes logs/debugging harder to search. Consider sourcing user-facing copy via chrome.i18n.getMessage(...) (with an English fallback) and keeping thrown/logged messages stable.

url: OFFSCREEN_URL,
reasons: ["USER_MEDIA", "DISPLAY_MEDIA", "BLOBS", "AUDIO_PLAYBACK"],
justification: "Record and upload Cap videos from an extension page.",
justification: "从扩展页面录制并上传 Cap 视频。",

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

chrome.offscreen.createDocument’s justification can show up in review / debugging contexts; hardcoding one locale may be confusing. If you want this localized, pulling it from chrome.i18n keeps it consistent and lets you keep a safe English default.

if (!panelFrame) throw new Error("panel frame missing");
await panelFrame
.locator('button[aria-label="Close Cap and hide all recorder UI"]')
.locator('button[aria-label="关闭 Cap 并隐藏所有录制界面"]')

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These e2e selectors are now coupled to translated aria-label copy. That tends to be brittle as soon as copy tweaks happen (or more locales get added). Consider adding a non-localized hook (e.g. data-testid or a stable id) to the close button and target that in tests instead.

const panelFrame = frameWithUrl(targetPage, "popup.html");
if (!panelFrame) throw new Error("panel frame missing");
await expect(panelFrame.getByText("Recording failed.")).toBeVisible({
await expect(panelFrame.getByText("录制失败。")).toBeVisible({

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same idea here: asserting exact localized sentences (getByText("录制失败。")) makes the test fragile. If possible, assert on a stable error state/hook (test id, role + status attribute, or an error code) and keep the copy free to change per-locale.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant