Skip to content

Fix author credit translation order - #223

Closed
elphizu wants to merge 2 commits into
WordPress:trunkfrom
elphizu:fix/author-credit-translation
Closed

elphizu wants to merge 2 commits into
WordPress:trunkfrom
elphizu:fix/author-credit-translation

Conversation

@elphizu

@elphizu elphizu commented Nov 11, 2026 •

Copy link
Copy Markdown
Contributor

Fixes the single-post author credit so translators can change the order of Written by and the author name.

Adds an ipsum/author-credit block binding and updates both single-post patterns. Also hides the author card when author information is unavailable, while keeping existing templates compatible.

Includes the rebuilt style.min.css.

Closes #218

Testing Instructions

  1. Check the author credit and link in both single-post templates.
  2. Translate Written by %s to %s 著 and verify the order.
  3. Confirm the author card hides when author information is missing.
  4. Check for block validation warnings and test another color variation.

Use of AI Tools

AI assistance: Yes
Tool: OpenAI Codex
Used for: Investigating the issue, implementing changes, and drafting the PR description. All changes were manually reviewed and tested by me.

Use a complete translatable author credit through a block binding in both single-post patterns. Hide the card when author support or the author name is missing, while preserving support for saved templates.

Fixes WordPress#218
@github-actions github-actions Bot added documentation Improvements or additions to documentation [Area] Global Styles Issues or PRs that touch theme.json or the base stylesheet. [Area] Patterns Issues or PRs that touch the theme's block patterns. [Area] Theme Functions Issues or PRs that touch functions.php. labels Nov 11, 2026
@elphizu
elphizu marked this pull request as ready for review November 11, 2026 06:51
@github-actions

github-actions Bot commented Nov 11, 2026 •

Copy link
Copy Markdown

The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs.

If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.

Co-authored-by: elphizu <suryakantupadhyay@git.wordpress.org>
Co-authored-by: juanfra <juanfra@git.wordpress.org>
Co-authored-by: MaggieCabrera <onemaggie@git.wordpress.org>
Co-authored-by: henriqueiamarino <iamarinoh@git.wordpress.org>
Co-authored-by: t-hamano <wildworks@git.wordpress.org>

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.


Props Bot commands

You can trigger Props Bot actions by commenting on this PR:

  • @propsbot add <username> to give props to a GitHub or WordPress.org user. Requires write access.
  • @propsbot remove <username> to leave a user out of the props. Requires write access.
  • @propsbot refresh to refresh this list. Adding the props-bot label works too.

@juanfra

juanfra commented Nov 11, 2026

Copy link
Copy Markdown
Member

Thanks for working on this!

With the binding the issue will be fixed but the trade-off is that the card gets less editable. "Written by" can't be edited in the site editor and the author name can't be styled on its own anymore.

I'm wondering if relying on the avatar and the author name would be enough (like TT5 templates do) so there's no strings to reorder and everything stays editable. Just a thought.

@henriqueiamarino what do you think?

@MaggieCabrera

Copy link
Copy Markdown
Contributor

Thanks for working on this!

With the binding the issue will be fixed but the trade-off is that the card gets less editable. "Written by" can't be edited in the site editor and the author name can't be styled on its own anymore.

I'm wondering if relying on the avatar and the author name would be enough (like TT5 templates do) so there's no strings to reorder and everything stays editable. Just a thought.

@henriqueiamarino what do you think?

I agree with this too

@henriqueiamarino

Copy link
Copy Markdown
Contributor

@MaggieCabrera and @juanfra If possible I’d like to keep the byline. “Written by” is part of the theme’s voice on single posts, and the card was designed around it, so I’d rather not drop it. Given that, the binding feels like the right shape, and it’s the mechanism we already ship for the comments CTA, so it keeps the theme consistent.

On editability, the trade seems acceptable to me: anyone who doesn’t want the byline can still delete the paragraph in one click, and rewording it just means swapping in a plain paragraph.

@MaggieCabrera

Copy link
Copy Markdown
Contributor

@MaggieCabrera and @juanfra If possible I’d like to keep the byline. “Written by” is part of the theme’s voice on single posts, and the card was designed around it, so I’d rather not drop it. Given that, the binding feels like the right shape, and it’s the mechanism we already ship for the comments CTA, so it keeps the theme consistent.

On editability, the trade seems acceptable to me: anyone who doesn’t want the byline can still delete the paragraph in one click, and rewording it just means swapping in a plain paragraph.

I feel like this is not a good practice for a default theme. It creates an inconsistency between the editor and the frontend and is confusing for first time users. We should be careful with this kind of changes. What if we move the Written by above the author name in a different line? I made an alternative PR in #246 can you have a look?

@henriqueiamarino

Copy link
Copy Markdown
Contributor

Thanks, @MaggieCabrera. How did we sorted it out in TT4 with 'by' instead of 'Written by'? I don't know about having it in two lines, it looks too heavy...

Screenshot 2026-11-16 at 16 54 26

@MaggieCabrera

Copy link
Copy Markdown
Contributor

Thanks, @MaggieCabrera. How did we sorted it out in TT4 with 'by' instead of 'Written by'? I don't know about having it in two lines, it looks too heavy...
Screenshot 2026-11-16 at 16 54 26

We didn’t really sort it out in TT4. It works the same way we do now: “by” is its own paragraph next to a separate Post Author Name block, and “in “ is a prefix on Post Terms. It only adds a translator context, so translators still can’t move the name.

You can see it in the translations. The Japanese TT4 leaves “by” and “in” in English. TT5 has the same setup with “Written by”, and there Japanese translators turned it into a label: "執筆者: Rhye Moore" (“Writer: Rhye Moore”).

That label idea is what #246 is going for, and it doesn’t need two lines. We could keep the current one-line pill and only change the string. We’d drop the  , add a small gap between the two blocks instead, and give translators a context saying it’s a label before the author name. Then languages that put the name first can use something like “Author:”. It keeps “Written by”, keeps both blocks editable, and the editor matches the front end. I will update the PR

@henriqueiamarino

Copy link
Copy Markdown
Contributor

Thanks, @MaggieCabrera, this is it for me. “Written by” stays and the editor matches the front end. I’m good with #246 going in before the string freeze. Thanks as well to @elphizu for #223, which got this conversation started.

MaggieCabrera added a commit that referenced this pull request Nov 17, 2026
* Stack the "Written by" label above the author name

"Written by" sits on its own line above the post author name in the single post patterns, so translators translate a standalone label instead of the start of a sentence, and the word order no longer matters. The label drops the trailing &nbsp; and gets a translator context.

The label and the Author Name block stay separate blocks, so the editor still shows the real author name, and the label stays editable.

See #218. Alternative to #223.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* Keep the "Written by" label on one line with the author name

Stacking the label above the name made the author card look too heavy. The label and the Author Name block sit side by side again, spaced by the group's block gap (spacing|20) instead of a trailing &nbsp; in the string.

The label keeps working as a standalone label for translators: its context is now "Label before the post author name", and a translators comment says the name is a separate block, so languages that put the name first can translate it as a label, such as "Author:".

See #218.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: elphizu <suryakantupadhyay@git.wordpress.org>
Co-authored-by: juanfra <juanfra@git.wordpress.org>
Co-authored-by: MaggieCabrera <onemaggie@git.wordpress.org>
Co-authored-by: henriqueiamarino <iamarinoh@git.wordpress.org>
Co-authored-by: t-hamano <wildworks@git.wordpress.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

[Area] Global Styles Issues or PRs that touch theme.json or the base stylesheet. [Area] Patterns Issues or PRs that touch the theme's block patterns. [Area] Theme Functions Issues or PRs that touch functions.php. documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

i18n: The "Written by" byline can't be reordered for other languages

4 participants