Repository navigation
feat(post-type): translate the generated archive view text - #597
Conversation
Hard-coded English left every generated archive untranslated on a non-English site. Take the pagination labels from strings WordPress core already translates and the empty state from the post type's own not_found label, so a theme needs no catalogue of its own.
|
Thanks @bale-dev, this is a good follow-up to #583. I changed the base branch of this pull request from I checked the change against WordPress 7.1.3: "Older posts" and "Newer posts" are strings of core's Two small things, neither blocks the merge:
|
The archive view generated by
pollora:make:post-typehas fixed English text for its pagination links and empty state, so that text stays in English on a translated site. The view now uses strings that WordPress and the post type already translate, so a theme doesn't need its own catalogue for them.Changes
Newer__('Newer posts')Older__('Older posts')Nothing published yet.get_queried_object()->labels->not_foundImpact
Only newly generated views change, because the command doesn't overwrite a view that already exists. Attributes, hooks, configuration and commands are unchanged, so no
api-changelabel is needed.How to test