From cefc685d7f7d9660cff5274d48c51d8f645ab504 Mon Sep 17 00:00:00 2001 From: Lifei Zhou Date: Mon, 18 May 2026 21:23:55 +1000 Subject: [PATCH] fix: reduce excessive MISSING_TRANSLATION warnings for fallback locales (#9294) --- ui/desktop/src/renderer.tsx | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/ui/desktop/src/renderer.tsx b/ui/desktop/src/renderer.tsx index c9df7f1ea9..3e6533188a 100644 --- a/ui/desktop/src/renderer.tsx +++ b/ui/desktop/src/renderer.tsx @@ -17,6 +17,20 @@ const App = lazy(() => import('./App')); const TELEMETRY_CONFIG_KEY = 'GOOSE_TELEMETRY_ENABLED'; +let warnedFallbackLocale = false; +function handleIntlError(err: { code: string; message?: string }) { + if (err.code === 'MISSING_TRANSLATION' && currentLocale !== currentMessageLocale) { + if (!warnedFallbackLocale) { + warnedFallbackLocale = true; + console.warn( + `[i18n] Locale "${currentLocale}" has no translations; falling back to "${currentMessageLocale}".` + ); + } + return; + } + console.error(err); +} + (async () => { // Check if we're in the launcher view (doesn't need goosed connection) const isLauncher = window.location.hash === '#/launcher'; @@ -50,7 +64,12 @@ const TELEMETRY_CONFIG_KEY = 'GOOSE_TELEMETRY_ENABLED'; ReactDOM.createRoot(document.getElementById('root')!).render( - +