From 1ff271bb5e10af1b848c987fc89765c04ed0471d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Padez?= Date: Sun, 23 Aug 2026 17:50:28 +0000 Subject: [PATCH] localization: fix two defects found by actually rendering the shipped locales MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Neither was visible from the source or from any test — both only showed up switching the live UI to es-ES/de-DE/fr-FR in a browser, which is what turned up the catalogue-wiring bug this builds on top of (see prior commit). 1. FileItem.tsx had two `isDir ? 'Folder' : ...` ternaries the scanner cannot see (values computed inside a JSX expression, not JSX text) — the Type column and the grid-view size line both showed the English word "Folder" regardless of locale. New key files.grid.folderType, translated in all five catalogs. 2. files.menu.selected was a single hardcoded string ("selected" / "seleccionados" / "sélectionnés" / ...), not a plural form. English doesn't inflect "selected" for number so this was invisible in the source locale, but Spanish and French do: "1 seleccionados" and "1 sélectionnés" are both wrong, should be singular. Converted to a {one, other} pair in all five locales (pt-PT included — same bug, pre-existing) and updated SelectionActions.tsx to pass count. German was fine either way ("ausgewählt" doesn't inflect here). Verified by minting a token for the owner's own account, driving a headless browser through es-ES/de-DE/fr-FR at /settings/profile, /files, and the file context menu, and reading the screenshots — not just running the test suite. Owner's real settings were read before and restored after. --- .../apps/FileBrowser/FileBrowserApp/components/FileItem.tsx | 5 +++-- .../FileBrowserApp/components/Toolbar/SelectionActions.tsx | 2 +- src/workspaces/officerdev/src/locales/de-DE.json | 6 +++++- src/workspaces/officerdev/src/locales/en-GB.json | 6 +++++- src/workspaces/officerdev/src/locales/es-ES.json | 6 +++++- src/workspaces/officerdev/src/locales/fr-FR.json | 6 +++++- src/workspaces/officerdev/src/locales/pt-PT.json | 6 +++++- 7 files changed, 29 insertions(+), 8 deletions(-) diff --git a/src/workspaces/officerdev/src/apps/FileBrowser/FileBrowserApp/components/FileItem.tsx b/src/workspaces/officerdev/src/apps/FileBrowser/FileBrowserApp/components/FileItem.tsx index 2e486529..6069add8 100644 --- a/src/workspaces/officerdev/src/apps/FileBrowser/FileBrowserApp/components/FileItem.tsx +++ b/src/workspaces/officerdev/src/apps/FileBrowser/FileBrowserApp/components/FileItem.tsx @@ -588,6 +588,7 @@ export const FileItem = ({ isPinned, canPaste, }: FileItemProps) => { + const { t } = useTranslation(); const { date } = useFormat(); const [renaming, setRenaming] = useState(false); const clickTimer = useRef | null>(null); @@ -720,7 +721,7 @@ export const FileItem = ({ )} - {isDir ? 'Folder' : getFileType(entry.name).replace(/^\w/, (c) => c.toUpperCase())} + {isDir ? t('files.grid.folderType') : getFileType(entry.name).replace(/^\w/, (c) => c.toUpperCase())} {isDir ? '--' : formatSize(entry.size)} @@ -774,7 +775,7 @@ export const FileItem = ({ )} - {isDir ? 'Folder' : formatSize(entry.size)} + {isDir ? t('files.grid.folderType') : formatSize(entry.size)} {' · '} {date(entry.modifiedAt, { month: 'short', day: 'numeric', year: 'numeric' })} diff --git a/src/workspaces/officerdev/src/apps/FileBrowser/FileBrowserApp/components/Toolbar/SelectionActions.tsx b/src/workspaces/officerdev/src/apps/FileBrowser/FileBrowserApp/components/Toolbar/SelectionActions.tsx index a42cbe19..598f6c58 100644 --- a/src/workspaces/officerdev/src/apps/FileBrowser/FileBrowserApp/components/Toolbar/SelectionActions.tsx +++ b/src/workspaces/officerdev/src/apps/FileBrowser/FileBrowserApp/components/Toolbar/SelectionActions.tsx @@ -23,7 +23,7 @@ export const SelectionActions = ({ fileBrowserManager }: SelectionActionsProps) <> {selected.size} - {t('files.menu.selected')} + {t('files.menu.selected', { count: selected.size })}