Skip to content
This repository has been archived by the owner on Jan 26, 2022. It is now read-only.

Add a WordPress credit block pattern and load it in the footer #56

Closed
wants to merge 3 commits into from

Conversation

jffng
Copy link
Collaborator

@jffng jffng commented Oct 7, 2021

This PR is an attempt to solve #30. It depends on WordPress/gutenberg#33217

It adds a WordPress credit block pattern — which contains some text that can be translated — and includes it in the footer, instead of using the block markup directly.

To test

  • Check out the above Gutenberg PR
  • Verify the credit in the footer appears as expected in the site editor and front-end
  • Verify you can add the pattern in the editor
  • Verify you can edit it in the site editor
Kapture.2021-10-07.at.14.42.47.mp4

@jffng jffng linked an issue Oct 7, 2021 that may be closed by this pull request
2 tasks
@kjellr
Copy link
Collaborator

kjellr commented Oct 7, 2021

Interesting idea! I'm seeing this issue across both of my test sites though:

Screen Shot 2021-10-07 at 2 49 33 PM

Edit: Whoops, I missed that this requires WordPress/gutenberg#33217

@kjellr
Copy link
Collaborator

kjellr commented Oct 7, 2021

Ok now that I've got it working, this is clever! I have one chief concern though: we shouldn't show these translation patterns in the inserter:

Screen Shot 2021-10-07 at 3 06 07 PM

I believe the two strings we have in the theme currently are for the footer, and for the 404 page. And it'll look really confusing for folks to see "This page can not be found" text in the pattern inserter. They'll 100% think there's a bug.

So if WordPress/gutenberg#33217 lands, I think we'll also need some way to hide this sort of pattern. Given that, I worry a little bit about the "workarounds on top of workarounds" aspect of this approach. 😅

@LittleBigThing
Copy link
Contributor

Just wondering how this solution would work with multilingual websites? Probably it depends on the plugin that is used, but I assume most popular plugins do (can?) not support this.

@jffng
Copy link
Collaborator Author

jffng commented Oct 11, 2021

Just wondering how this solution would work with multilingual websites?

Since patterns are php files, the strings in those files can be marked for translation just like any other string supplied by a theme or plugin. The site may provide a .po/.pot file for each language, or use a plugin that provides a mechanism to translate + save translated strings.

@jffng jffng force-pushed the try/tagline-pattern branch 2 times, most recently from 1ace6cc to 1ffae85 Compare October 12, 2021 15:00
@jffng
Copy link
Collaborator Author

jffng commented Oct 29, 2021

Closing in favor of #182.

@jffng jffng closed this Oct 29, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

String translation in templates
3 participants