Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Internalization fixes for site editor template creation #42762

Merged
merged 1 commit into from
Jul 28, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions packages/edit-site/src/components/add-new-template/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -201,9 +201,9 @@ export const usePostTypeMenuItems = ( onClickMenuItem ) => {
if ( _needsUniqueIdentifier ) {
title = sprintf(
// translators: Represents the title of a user's custom template in the Site Editor, where %1$s is the template title and %2$s is the slug of the post type, e.g. "Project: Hello (project_type)"
__( '%1$s %2$s' ),
__( '%1$s (%2$s)' ),
title,
`(${ slug })`
slug
);
}
return {
Expand Down Expand Up @@ -360,9 +360,9 @@ export const useTaxonomiesMenuItems = ( onClickMenuItem ) => {
if ( _needsUniqueIdentifier ) {
title = sprintf(
// translators: Represents the title of a user's custom template in the Site Editor, where %1$s is the template title and %2$s is the slug of the taxonomy, e.g. "Category: shoes (product_tag)"
__( '%1$s %2$s' ),
__( '%1$s (%2$s)' ),
title,
`(${ slug })`
slug
);
}
return {
Expand Down Expand Up @@ -413,9 +413,9 @@ export const useTaxonomiesMenuItems = ( onClickMenuItem ) => {
* object with the entity's slug as key and the template prefix as value.
*
* Example:
* `existingTemplates` is: [ { slug: tag-apple }, { slug: page-about }, { slug: tag } ]
* `existingTemplates` is: [ { slug: 'tag-apple' }, { slug: 'page-about' }, { slug: 'tag' } ]
* `templatePrefixes` is: { post_tag: 'tag' }
* It will return: { post_tag: [apple] }
* It will return: { post_tag: ['apple'] }
*
* Note: We append the `-` to the given template prefix in this function for our checks.
*
Expand Down