From 926034750fb9f60f72fcb743b6bebebb4519f65b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Padez?= Date: Sun, 23 Aug 2026 04:40:39 +0000 Subject: [PATCH] keyed the dock, header and shell chrome (555 -> 487) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Layout reaches zero. The dock, header, user menu, theme switcher, spotlight, shortcuts modal, screen-error fallback, rescan and bug report. Three things worth knowing: CORE_DOCK_ITEMS now carries labelKey instead of label, and one useDockItems() hook resolves the composed list. DashboardLayout, Spotlight and DockSettings each spread the same two sources before, so each would have had to resolve labels itself. Plugin tiles keep the name from their own manifest — a plugin's strings are not ours. Spotlight resolves labels INSIDE the hook, so rank() still matches what the reader can see rather than a dot-path. Its to: '/settings/...' literals are untouched, which is what docs:check parses — verified still 20 offered, 0 missing. The rescan toast said 'N skill(s)'. That is English giving up on a plural, so it is now a real plural entry per noun and reads correctly at 0, 1 and 2 in both locales. ThemeSwitcher used t as its theme loop variable; renamed to entry. --- .../Layout/BugReport/BugReportButton.tsx | 4 +- .../Layout/BugReport/BugReportDialog.tsx | 20 +- .../Layout/BugReport/use-bug-report.ts | 8 +- .../Dashboard/Layout/DashboardLayout.tsx | 8 +- .../Screens/Dashboard/Layout/Dock.tsx | 62 ++++-- .../Dashboard/Layout/Header/Header.tsx | 11 +- .../Dashboard/Layout/Header/JobsIndicator.tsx | 6 +- .../Dashboard/Layout/Header/ThemeSwitcher.tsx | 81 ++++--- .../Dashboard/Layout/Header/UserMenu.tsx | 18 +- .../Dashboard/Layout/Rescan/RescanButton.tsx | 71 ++++--- .../Dashboard/Layout/ScreenErrorFallback.tsx | 24 +-- .../Dashboard/Layout/ShortcutsModal.tsx | 6 +- .../Dashboard/Layout/Spotlight/Spotlight.tsx | 6 +- .../Layout/Spotlight/useSpotlightItems.ts | 139 +++++++++--- .../Settings/ProfileSettings/DockSettings.tsx | 4 +- src/apps/officer-web/locales/en-GB.json | 198 +++++++++++++++++- src/apps/officer-web/locales/pt-PT.json | 198 +++++++++++++++++- 17 files changed, 685 insertions(+), 179 deletions(-) diff --git a/src/apps/officer-web/Screens/Dashboard/Layout/BugReport/BugReportButton.tsx b/src/apps/officer-web/Screens/Dashboard/Layout/BugReport/BugReportButton.tsx index d9322426..e42de17b 100644 --- a/src/apps/officer-web/Screens/Dashboard/Layout/BugReport/BugReportButton.tsx +++ b/src/apps/officer-web/Screens/Dashboard/Layout/BugReport/BugReportButton.tsx @@ -1,16 +1,18 @@ import { Bug } from 'lucide-react'; import { useBugReport } from './use-bug-report'; +import { useTranslation } from '@/lib/i18n'; import { BugReportDialog } from './BugReportDialog'; export const BugReportButton = () => { const bugReport = useBugReport(); + const { t } = useTranslation(); return ( <> diff --git a/src/apps/officer-web/Screens/Dashboard/Layout/BugReport/BugReportDialog.tsx b/src/apps/officer-web/Screens/Dashboard/Layout/BugReport/BugReportDialog.tsx index 05ae5b5e..7ed1a166 100644 --- a/src/apps/officer-web/Screens/Dashboard/Layout/BugReport/BugReportDialog.tsx +++ b/src/apps/officer-web/Screens/Dashboard/Layout/BugReport/BugReportDialog.tsx @@ -3,6 +3,7 @@ import { Dialog, DialogContent, DialogHeader, DialogTitle, DialogFooter } from ' import { Button } from '@/components/ui/button'; import { Textarea } from '@/components/ui/textarea'; import { Loader2 } from 'lucide-react'; +import { useTranslation } from '@/lib/i18n'; type BugReportDialogProps = { open: boolean; @@ -21,6 +22,7 @@ export const BugReportDialog = ({ onClose, onSubmit, }: BugReportDialogProps) => { + const { t, tUi } = useTranslation(); const [description, setDescription] = useState(''); const previewUrl = useMemo(() => (screenshot ? URL.createObjectURL(screenshot) : null), [screenshot]); @@ -36,7 +38,7 @@ export const BugReportDialog = ({ - Report a Bug + {t('bugReport.title')}
@@ -46,34 +48,32 @@ export const BugReportDialog = ({
) : previewUrl ? ( - Screenshot + {t('bugReport.screenshot')} ) : (
- No screenshot captured + {t('bugReport.noScreenshot')}
)}