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

Add support for secondary placeholders for singular and plural specification in label autofill #921

Open
tw2113 opened this issue Mar 10, 2023 · 3 comments
Milestone

Comments

@tw2113
Copy link
Member

tw2113 commented Mar 10, 2023

Originally from: #920

When translating auto-populated string values, we want to add support for returning either {{singular}} or {{plural}} instead of %s for placeholders. PHP won't throw a fit if no %s placeholder is returned, with the replacement value still provided. It would if the replacement value wasn't provided.

So in our javascript, we need to amend the section linked below, to first check for {{singular}} or {{plural}} first and if either of those exist, replace appropriately OTHERWISE just use what we have now with checking the if ( 'plural' === plurality ) { etc.

Make sure the description/helper text reflects the availability for these placeholders.

https://github.com/WebDevStudios/custom-post-type-ui/blob/1.13.4/src/js/cptui-scripts.js#L259-L274

@tw2113
Copy link
Member Author

tw2113 commented Mar 10, 2023

@wiliamjk just to confirm, this is also going to be needed for taxonomies, correct?

@tw2113
Copy link
Member Author

tw2113 commented Mar 10, 2023

First pass at this and I think it will probably handle all the needed parts.

custom-post-type-ui-singular-plural.zip

@wiliamjk would love to have you help confirm that this handles everything in a way that satisfies the original issue.

@wiliamjk
Copy link

@wiliamjk just to confirm, this is also going to be needed for taxonomies, correct?

Yes definitely!

@tw2113 tw2113 added this to the 1.14.0 milestone Jul 17, 2023
@tw2113 tw2113 modified the milestones: 1.14.0, Next Release Aug 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants