Skip to content

fix(ui): properly translate folder view labels and buttons#16282

Open
jhb-dev wants to merge 1 commit intopayloadcms:mainfrom
jhb-dev:fix/folder-view-i18n
Open

fix(ui): properly translate folder view labels and buttons#16282
jhb-dev wants to merge 1 commit intopayloadcms:mainfrom
jhb-dev:fix/folder-view-i18n

Conversation

@jhb-dev
Copy link
Copy Markdown
Contributor

@jhb-dev jhb-dev commented Apr 15, 2026

What?

Fixes several broken translations in the folder view UI:

  • Popup group headers "Sort by" / "Order" rendered in English regardless of locale.
  • Grid section headers "Folders" / "Documents" rendered in English.
  • Folder-row actions menu showed "Folder bearbeiten" (English noun, German verb) instead of "Ordner bearbeiten".
  • Move-to-folder drawer showed "Folder hinzufügen" / "Erstellen folder" instead of proper German.
  • Collection-folder list selection button used the semantically wrong German "Alles leeren" (meaning "empty everything") for a deselect-all action.

Why?

The folder collection config used hardcoded English labels ({ plural: 'Folders', singular: 'Folder' }) that flowed into several UI labels via getTranslation(), which returns the string as-is for non-translatable values.

Multiple call sites also built button labels via string concatenation (\${t('general:create')} \${label.toLowerCase()}), which produces incorrect output in non-English locales where:

  • Word order differs (German: noun then verb — "Ordner erstellen", not "Erstellen ordner").
  • Nouns must remain capitalized (German).

Finally, general:clearAll was only used as a "deselect all" button and was literally translated as "Clear all" / "Alles leeren" in most locales, which is misleading.

How?

  • Folder collection config (createFolderCollection.ts, buildFolderField.ts): switch labels to translation functions (({ t }) => t('folder:folder') / t('folder:folders')).
  • SortByPill: use t('general:sortBy') / t('general:order').
  • ItemCardGrid call sites in BrowseByFolder and getFolderResultsComponentAndData: pass translated titles using existing folder:folders / general:documents keys.
  • Replace all four \${create} \${label.toLowerCase()} patterns with t('general:createNewLabel', { label }) so word order and casing are decided by each locale's translation string.
  • Add new folder:folder and general:sortBy translation keys. Regenerate for all 43 non-English locales.
  • Rename general:clearAllgeneral:deselectAll (semantically correct, not used anywhere else). Regenerate translations.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant