[wp-trac] [WordPress Trac] #52800: Make most default post type labels use "name" and "singular_name" variables instead of defaulting to Post/Page

WordPress Trac noreply at wordpress.org
Sat Mar 13 09:08:20 UTC 2021


#52800: Make most default post type labels use "name" and "singular_name" variables
instead of defaulting to Post/Page
-------------------------------+----------------------
 Reporter:  jaspercreel        |       Owner:  (none)
     Type:  enhancement        |      Status:  closed
 Priority:  normal             |   Milestone:
Component:  Posts, Post Types  |     Version:  5.7
 Severity:  minor              |  Resolution:  wontfix
 Keywords:                     |     Focuses:
-------------------------------+----------------------
Changes (by SergeyBiryukov):

 * keywords:  dev-feedback needs-unit-tests =>
 * status:  new => closed
 * resolution:   => wontfix
 * milestone:  Awaiting Review =>


Comment:

 Hi there, welcome to WordPress Trac! Thanks for the ticket.

 Unfortunately, as noted above, just inserting a post type name into a
 generic string like `%s updated` is not translatable, hence the need for a
 full array of various labels.

 A general best practice in WordPress is to avoid post type and taxonomy
 names in generic strings due to i18n concerns and structural differences
 in languages. See the previous discussions for reference:
  * comment:3:ticket:17609
  * comment:1:ticket:19099
  * #37895

 To clarify a bit more, while both the post type name and the `%s updated`
 string itself are translatable, this or any other generic string like that
 is not ''correctly'' translatable. It does not account for different word
 order or declensions in other languages, so no matter how you translate
 it, the result is still incorrect.

 For example, in Russian, "Post" is feminine and "Product" is masculine, so
 "New post" and "New product" would require a different translation and
 there is simply no way to translate `New %s` to account for both. We also
 don't use capital letters for multiple words in a row, so "New Post" or
 "New Product" is not quite correct, it should be "New post" or "New
 product".

 That is the case for many other languages too, and is the reason why
 WordPress core does not use generic strings for post type or taxonomy
 names, and offers an array of labels to be used instead.

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/52800#comment:2>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list