Skip to content

i18n#27

Merged
TXT0Law merged 1 commit into
mainfrom
law_unstable
Jun 12, 2026
Merged

i18n#27
TXT0Law merged 1 commit into
mainfrom
law_unstable

Conversation

@TXT0Law

@TXT0Law TXT0Law commented Jun 12, 2026

Copy link
Copy Markdown
Owner

No description provided.

Copilot AI review requested due to automatic review settings June 12, 2026 02:24
@TXT0Law TXT0Law merged commit 2dea515 into main Jun 12, 2026
15 checks passed
@github-actions

Copy link
Copy Markdown

Coverage Summary

Service Coverage
Frontend coverage unavailable
Backend coverage unavailable
OSINT coverage unavailable

Overall status: unavailable

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

This PR introduces dashboard/settings internationalization (English + Chinese) by centralizing UI copy in a new lib/i18n/dashboard.ts message bundle, wiring dashboard-related pages/components to useAppearanceLanguage(), and adding tests that assert Chinese UI chrome. It also adds an HTML lang synchronization mechanism and extends ConfirmDialog to accept localized button labels.

Changes:

  • Add a DashboardMessages bundle (EN/ZH) and update dashboard/monitor/reports/settings UI to render from it.
  • Sync document.documentElement.lang with the saved appearance language (via Providers and settings UI).
  • Expand/adjust Vitest coverage to validate Chinese translations across key pages/components.

Reviewed changes

Copilot reviewed 34 out of 34 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
tests/pages/scan-page.test.tsx Adds Chinese UI assertions; clears localStorage between tests.
tests/pages/reports-pages.test.tsx Adds Chinese UI assertions; introduces schedules mock and localStorage reset.
tests/pages/core-pages.test.tsx Adds language mock to test dashboard/settings Chinese rendering.
tests/lib/providers.test.tsx Adds coverage for syncing <html lang> with stored appearance language.
tests/components/settings-components.test.tsx Updates assertions to include <html lang> and Chinese “Dark” label.
tests/components/report/report-list-table.test.tsx Adds Chinese table/action assertions; clears localStorage in beforeEach.
tests/components/report/report-generate-dialog.test.tsx Adds Chinese dialog chrome assertions; clears localStorage.
tests/components/monitor/monitor-list-content.test.tsx Adds Chinese pagination/control assertions; clears localStorage.
lib/providers.tsx Adds HtmlLanguageSync to keep <html lang> aligned with appearance language.
lib/i18n/dashboard.ts New centralized EN/ZH message bundle for dashboard/settings/scan/monitor/reports.
components/settings/settings-nav.tsx Localizes nav labels using message keys; marks component as client.
components/settings/placeholder-section.tsx Localizes “Coming Soon”; marks component as client.
components/settings/appearance-settings.tsx Localizes section labels; applies <html lang> when language changes.
components/settings/api-keys-settings.tsx Localizes labels/buttons/toasts using dashboard messages.
components/report/report-status-badge.tsx Localizes status labels via i18n bundle.
components/report/report-schedule-list.tsx Localizes table headers, actions, statuses, and toast strings.
components/report/report-schedule-dialog.tsx Localizes dialog copy/labels and weekday/day formatting.
components/report/report-list-table.tsx Localizes table headers, button labels, confirm dialog strings, and toasts.
components/report/report-generate-dialog.tsx Localizes dialog copy/labels and default title placeholder generation.
components/monitor/monitor-list-table.tsx Localizes table headers/ARIA labels and “Never” label.
components/monitor/monitor-list-content.tsx Localizes pagination and empty/error states.
components/monitor/monitor-filter-bar.tsx Localizes placeholders, ARIA labels, filter/sort labels, and advanced filters UI.
components/dashboard/ssl-watchlist.tsx Localizes titles/errors/status labels and expiry formatting.
components/dashboard/scan-input.tsx Localizes validation/error strings and UI copy for port scanning and submit button.
components/dashboard/recent-scans.tsx Localizes titles, empty/error states, status badges, and ARIA labels.
components/dashboard/quick-scan.tsx Localizes quick-scan copy and ARIA label.
components/dashboard/monitor-health.tsx Localizes titles/errors/empty state/link text and formatting helpers.
components/dashboard/dashboard-stats.tsx Localizes stat labels and error message + retry button.
components/common/confirm-dialog.tsx Adds optional cancelLabel and loadingLabel props for i18n.
app/dashboard/settings/page.tsx Localizes settings page title/subtitle and placeholder section copy.
app/dashboard/scan/page.tsx Localizes scan page copy, filters, statuses, and error/success strings.
app/dashboard/reports/page.tsx Localizes reports page chrome, tabs, and loading/empty states.
app/dashboard/page.tsx Marks dashboard home as client; localizes title/subtitle.
app/dashboard/monitor/page.tsx Marks monitor list page as client; localizes title/subtitle/loading fallback.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines 274 to 276
setStartError((prev) =>
prev ? `${prev}\nFailed ${url}: ${reason}` : `Failed to start scan for ${url}: ${reason}`
prev ? `${prev}\nFailed ${url}: ${reason}` : messages.startFailed(url, reason)
);
Comment on lines 40 to 44
const { theme, setTheme } = useTheme();
const appearanceLanguage = useAppearanceLanguage();
const messages = getDashboardMessages(appearanceLanguage).settings;
const [fontSize, setFontSize] = useState<FontSizeOption>("default");
const [language, setLanguage] = useState<LanguageOption>("en");
Comment thread lib/i18n/dashboard.ts
Comment on lines +364 to +371
viewAllMonitors: (count) => `View all ${count} monitors ->`,
neverChecked: "Never checked",
uptimeValue: (value) => `${value}% uptime`,
uptimeUnavailable: "Uptime unavailable",
latencyUnavailable: "No latency yet",
sslWatchlist: "SSL Expiry Watchlist",
failedToLoadSslWatchlist: "Failed to load SSL watchlist",
viewAllMonitorsShort: "View all monitors ->",
Comment thread lib/i18n/dashboard.ts
Comment on lines +694 to +701
viewAllMonitors: (count) => `查看全部 ${count} 個監控 ->`,
neverChecked: "尚未檢查",
uptimeValue: (value) => `${value}% 可用率`,
uptimeUnavailable: "無法取得可用率",
latencyUnavailable: "尚無延遲資料",
sslWatchlist: "SSL 到期觀察清單",
failedToLoadSslWatchlist: "無法載入 SSL 觀察清單",
viewAllMonitorsShort: "查看全部監控 ->",
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.

2 participants