Repository navigation
fix(admin): keep collection and taxonomy names capitalized in the German admin - #3522
Conversation
…man admin The admin lowercased collection and taxonomy labels before placing them in sentences. That reads right in English or French but misspells every German noun, as in "Noch keine kategorien vorhanden.". German now keeps the label as the site defines it. Every other locale lowercases as before, and the message IDs stay the same, so no catalog loses a translation. The term dialog of a taxonomy without a singular label fell back to the English literal "term" inside those sentences; it now uses the translated "Term", like the dialog title.
🦋 Changeset detectedLatest commit: bae30fc The changes in this PR will be included in the next version bump. This PR includes changesets to release 12 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
@emdash-cms/admin
@emdash-cms/auth
@emdash-cms/auth-atproto
@emdash-cms/blocks
@emdash-cms/cloudflare
@emdash-cms/contentful-to-portable-text
emdash
create-emdash
@emdash-cms/gutenberg-to-portable-text
@emdash-cms/plugin-cli
@emdash-cms/plugin-test
@emdash-cms/plugin-types
@emdash-cms/registry-client
@emdash-cms/registry-lexicons
@emdash-cms/registry-loader
@emdash-cms/registry-moderation
@emdash-cms/registry-verification
@emdash-cms/sandbox-workerd
@emdash-cms/x402
@emdash-cms/plugin-ai-moderation
@emdash-cms/plugin-atproto
@emdash-cms/plugin-audit-log
@emdash-cms/plugin-color
@emdash-cms/plugin-embeds
@emdash-cms/plugin-field-kit
@emdash-cms/plugin-forms
@emdash-cms/plugin-webhook-notifier
commit: |
There was a problem hiding this comment.
The approach is sound: a tiny locale-aware helper centralizes the casing rule, keeping German noun capitalization while preserving lowercasing for other locales. It avoids message-ID churn and fits Lingui patterns. The regression tests render with the German admin locale and assert the preserved capitalization.
I read the changed components (BulkTagDialog, ContentList, TaxonomyManager, TaxonomySidebar), the helper, the tests, and the changeset. The code is mostly clean, but I found one untranslated fallback in a sibling delete-confirmation dialog and one place where the sidebar's taxonomy picker still inserts raw labels into sentence-position strings. These are non-blocking; the PR can land once addressed or once the maintainer agrees the current behavior is intentional.
The changeset is well-written: it leads with the user-facing behavior, gives concrete examples, and explains the locale split.
Findings
-
[needs fixing]
packages/admin/src/components/TaxonomyManager.tsx:1529The delete-confirmation title falls back to the hardcoded English string
"Term"instead of the translatedt\Term`. This is the same bug class fixed in the term-form dialog description in this PR: for a taxonomy created in the admin that has nolabelSingular`, a non-English admin sees the English word "Term" in this dialog title. Use the translated fallback so it matches the form dialog title and description.title={t`Delete ${taxonomyDef.labelSingular || t`Term`}?`} -
[suggestion]
packages/admin/src/components/TaxonomySidebar.tsx:584TaxonomyTermPickerstill inserts rawlabel/singularLabelinto sentence-position strings (Choose ${label},Search ${label}…,No ${label} found.,Create a new ${singularLabel}). The PR lists the sidebar as one of the five components being fixed, so these should also useinlineLabelfor consistency with the other components; otherwise English/French admins continue to see capitalized taxonomy names in these sentences while the taxonomy page and dialogs lowercase them.Inside
TaxonomyTermPicker, pulli18nfromuseLingui()and wrap the label in sentence positions, e.g.:{trimmedInput ? t`Create "${trimmedInput}"` : t`Create a new ${inlineLabel(singularLabel, i18n.locale)}`}(Keep the bold section header as plain
label, since that is a title, not a sentence insert.) -
[suggestion]
packages/admin/src/components/BulkTagDialog.tsx:111-113The variable names
singularLowerandpluralLowerare now misleading: in a German admin these values are not lowercased. Rename them to something likeinlineSingular/inlinePluralorsentenceSingular/sentencePluralso the variable name reflects the helper's actual output.const inlineSingular = inlineLabel(singular, i18n.locale); const inlinePlural = inlineLabel(plural, i18n.locale);
A taxonomy created in the admin has no singular label, so the delete
confirmation fell back to the literal English "Term": the German admin
showed "Term entfernen?" where the catalog has "Begriff entfernen?". The
fallback now goes through Lingui like the term dialog's title and
description. The message ID "Delete {0}?" is unchanged.
With an empty German catalog, t`Term` renders its source string, so the German taxonomy test could not tell the translated fallback from a literal "Term". Binding only the Term message by its ID to "Begriff" makes both fallbacks observable: the term dialog's description and the delete confirmation's title. Each test fails when its fallback goes back to a literal. The changeset now says the Term fallback reaches every translated admin, not only German, and names who is affected.
There was a problem hiding this comment.
The approach is sound: a small locale-aware inlineLabel helper centralizes the casing decision so German admin sentences preserve the site-written capitalization of collection and taxonomy names, while other locales continue to lowercase them. It avoids message-ID churn and fits existing Lingui patterns.
This re-review confirms the previous blocking-style finding is fixed: TaxonomyManager now uses t\Term`instead of the hardcoded English"Term"` in the delete-confirmation title, matching the term-form fallback.
I re-read the changed components, the new helper, the tests, and the changeset. All five intended call sites now use inlineLabel correctly, and the German regression tests verify the preserved capitalization plus translated "Term" fallbacks. No remaining toLowerCase() label transformations were found in the admin source, and pnpm locale:extract reportedly produced the same message-ID count, so the nested t fallback does not perturb extraction.
The two earlier suggestions are intentionally not adopted, with reasonable explanations in the PR description: the taxonomy-picker keeps its configured casing by design (per #3233), and the singularLower/pluralLower names are kept to avoid changing 13 extracted message placeholders. Both are acceptable maintainer choices.
No new bugs, regressions, or convention violations found.
What does this PR do?
Keeps collection and taxonomy names capitalized inside sentences of the German admin. The admin lowercases these labels before inserting them into translated text, so a German site's "Schlagwörter" shows as "Noch keine schlagwörter vorhanden." and "Beiträge" as "beiträge durchsuchen...", misspelling German nouns.
The five places that lowercase these labels (content list, taxonomy page, term and bulk tagging dialogs, and the taxonomy sidebar's error toast) now use one helper that keeps the label as written in a German admin. For admin-created taxonomies, which have no singular label, the term dialog's description and the delete confirmation's title now use the admin language's word for "Term" instead of the English one.
Other locales still lowercase, as most of their translations put the name mid-sentence ("Pas encore de {0}."). A German label in a non-German admin stays lowercase. The sidebar's term picker keeps the configured casing, as #3233 chose and tests.
singularLowerandpluralLowerin the bulk tagging dialog are the named placeholders of 13 message IDs, so they keep their names and no message ID changes.Follows up on #3324, which lists these lowercase names among the limits a translation cannot fix.
Type of change
Checklist
pnpm typecheckpassespnpm lintpassespnpm testpasses (or targeted tests for my change)pnpm formathas been runmessages.pochanges except in translation PRs — a workflow extracts catalogs on merge tomain.AI-generated code disclosure
Screenshots / test output
A taxonomy named "Schlagwörter" in
demos/simple, with the admin in German. Before:With this change:
The same page in English, French and Arabic still reads "Manage schlagwörter for posts", "Gérer les schlagwörter pour les posts" and "إدارة schlagwörter لـ posts".
The bulk tagging dialog, content list and taxonomy page tests each render with the German admin locale; all three failed before the fix, when the dialog title read "Add schlagwort to posts", the search field "Search beiträge..." and the taxonomy page "Manage schlagwörter for posts".
The two taxonomy page tests for the "Term" fallback bind only its German translation, "Begriff"; the delete confirmation test failed before the fix, when the title read "Delete Term?". With the full German catalog, that title changes from "Term entfernen?" to "Begriff entfernen?".
packages/admin:vitest run, 204 files, 2778 tests passedpnpm build,pnpm typecheck,pnpm lintpnpm --silent lint:json | jq '.diagnostics | length'→0pnpm locale:extracton this branch: the same 3,080 message IDs as the catalog onmain