Skip to content

fix(admin): keep collection and taxonomy names capitalized in the German admin - #3522

Merged
ascorbic merged 3 commits into
emdash-cms:mainfrom
danielmlr:fix/admin-keep-label-case
Sep 28, 2026
Merged

ascorbic merged 3 commits into
emdash-cms:mainfrom
danielmlr:fix/admin-keep-label-case

Conversation

@danielmlr

@danielmlr danielmlr commented Sep 27, 2026 •

Copy link
Copy Markdown
Member

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. singularLower and pluralLower in 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

  • Bug fix
  • Feature (requires maintainer-approved Discussion)
  • Refactor (no behavior change)
  • Translation
  • Documentation
  • Performance improvement
  • Tests
  • Chore (dependencies, CI, tooling)

Checklist

  • I have read CONTRIBUTING.md
  • pnpm typecheck passes
  • pnpm lint passes
  • pnpm test passes (or targeted tests for my change)
  • pnpm format has been run
  • I have added/updated tests for my changes (if applicable)
  • User-visible strings in the admin UI are wrapped for translation (if applicable). Do not include messages.po changes except in translation PRs — a workflow extracts catalogs on merge to main.
  • I have added and reviewed the user-facing changeset (if this PR changes a published package)
  • New features link to an approved Discussion: https://github.com/emdash-cms/emdash/discussions/... (n/a: bug fix)
  • I have included screenshots below if this PR changes the UI

AI-generated code disclosure

  • This PR includes AI-generated code — model/tool: Claude Opus 5.5

Screenshots / test output

A taxonomy named "Schlagwörter" in demos/simple, with the admin in German. Before:

German admin before this change: a taxonomy page headed Schlagwörter, with the description schlagwörter für posts verwalten and the empty state Noch keine schlagwörter vorhanden, both in lowercase

With this change:

German admin with this change: the same taxonomy page reads Schlagwörter für posts verwalten and Noch keine Schlagwörter vorhanden, capitalized as the site defines the name

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 passed
  • pnpm build, pnpm typecheck, pnpm lint
  • pnpm --silent lint:json | jq '.diagnostics | length' → 0
  • pnpm locale:extract on this branch: the same 3,080 message IDs as the catalog on main

…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-bot

changeset-bot Bot commented Sep 27, 2026 •

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: bae30fc

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 12 packages
Name Type
@emdash-cms/admin Patch
emdash Patch
@emdash-cms/cloudflare Patch
@emdash-cms/plugin-test Patch
@emdash-cms/sandbox-workerd Patch
@emdash-cms/auth Patch
@emdash-cms/blocks Patch
create-emdash Patch
@emdash-cms/gutenberg-to-portable-text Patch
@emdash-cms/x402 Patch
@emdash-cms/auth-atproto Patch
@emdash-cms/plugin-embeds Patch

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

@pkg-pr-new

pkg-pr-new Bot commented Sep 27, 2026 •

Copy link
Copy Markdown

Open in StackBlitz

@emdash-cms/admin

npm i https://pkg.pr.new/@emdash-cms/admin@3522

@emdash-cms/auth

npm i https://pkg.pr.new/@emdash-cms/auth@3522

@emdash-cms/auth-atproto

npm i https://pkg.pr.new/@emdash-cms/auth-atproto@3522

@emdash-cms/blocks

npm i https://pkg.pr.new/@emdash-cms/blocks@3522

@emdash-cms/cloudflare

npm i https://pkg.pr.new/@emdash-cms/cloudflare@3522

@emdash-cms/contentful-to-portable-text

npm i https://pkg.pr.new/@emdash-cms/contentful-to-portable-text@3522

emdash

npm i https://pkg.pr.new/emdash@3522

create-emdash

npm i https://pkg.pr.new/create-emdash@3522

@emdash-cms/gutenberg-to-portable-text

npm i https://pkg.pr.new/@emdash-cms/gutenberg-to-portable-text@3522

@emdash-cms/plugin-cli

npm i https://pkg.pr.new/@emdash-cms/plugin-cli@3522

@emdash-cms/plugin-test

npm i https://pkg.pr.new/@emdash-cms/plugin-test@3522

@emdash-cms/plugin-types

npm i https://pkg.pr.new/@emdash-cms/plugin-types@3522

@emdash-cms/registry-client

npm i https://pkg.pr.new/@emdash-cms/registry-client@3522

@emdash-cms/registry-lexicons

npm i https://pkg.pr.new/@emdash-cms/registry-lexicons@3522

@emdash-cms/registry-loader

npm i https://pkg.pr.new/@emdash-cms/registry-loader@3522

@emdash-cms/registry-moderation

npm i https://pkg.pr.new/@emdash-cms/registry-moderation@3522

@emdash-cms/registry-verification

npm i https://pkg.pr.new/@emdash-cms/registry-verification@3522

@emdash-cms/sandbox-workerd

npm i https://pkg.pr.new/@emdash-cms/sandbox-workerd@3522

@emdash-cms/x402

npm i https://pkg.pr.new/@emdash-cms/x402@3522

@emdash-cms/plugin-ai-moderation

npm i https://pkg.pr.new/@emdash-cms/plugin-ai-moderation@3522

@emdash-cms/plugin-atproto

npm i https://pkg.pr.new/@emdash-cms/plugin-atproto@3522

@emdash-cms/plugin-audit-log

npm i https://pkg.pr.new/@emdash-cms/plugin-audit-log@3522

@emdash-cms/plugin-color

npm i https://pkg.pr.new/@emdash-cms/plugin-color@3522

@emdash-cms/plugin-embeds

npm i https://pkg.pr.new/@emdash-cms/plugin-embeds@3522

@emdash-cms/plugin-field-kit

npm i https://pkg.pr.new/@emdash-cms/plugin-field-kit@3522

@emdash-cms/plugin-forms

npm i https://pkg.pr.new/@emdash-cms/plugin-forms@3522

@emdash-cms/plugin-webhook-notifier

npm i https://pkg.pr.new/@emdash-cms/plugin-webhook-notifier@3522

commit: bae30fc

@danielmlr
danielmlr marked this pull request as ready for review September 27, 2026 20:58

@emdashbot emdashbot Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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:1529

    The delete-confirmation title falls back to the hardcoded English string "Term" instead of the translated t\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 no labelSingular`, 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:584

    TaxonomyTermPicker still inserts raw label / singularLabel into 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 use inlineLabel for 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, pull i18n from useLingui() 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-113

    The variable names singularLower and pluralLower are now misleading: in a German admin these values are not lowercased. Rename them to something like inlineSingular / inlinePlural or sentenceSingular / sentencePlural so the variable name reflects the helper's actual output.

    	const inlineSingular = inlineLabel(singular, i18n.locale);
    	const inlinePlural = inlineLabel(plural, i18n.locale);
    

@emdashbot emdashbot Bot added the review/awaiting-author Reviewed; waiting on the author to respond label Sep 27, 2026
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.
@github-actions github-actions Bot added review/needs-rereview New commits since the last review and removed review/awaiting-author Reviewed; waiting on the author to respond labels Sep 27, 2026
@ascorbic ascorbic added the bot:review Trigger an emdashbot code review on this PR label Sep 28, 2026

@emdashbot emdashbot Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@emdashbot emdashbot Bot added review/approved Approved; no new commits since and removed bot:review Trigger an emdashbot code review on this PR review/needs-rereview New commits since the last review labels Sep 28, 2026
@ascorbic
ascorbic merged commit a3609fb into emdash-cms:main Sep 28, 2026
44 checks passed
This was referenced Sep 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants