Making WordPress.org

Opened 4 years ago

Last modified 3 years ago

#5455 new defect (bug)

HelpHub: Correct post type and taxonomy labels

Reported by: sergeybiryukov's profile SergeyBiryukov Owned by:
Milestone: Priority: normal
Component: HelpHub (wordpress.org/documentation) Keywords:
Cc:

Description (last modified by SergeyBiryukov)

In the HelpHub plugin, post type and taxonomy labels are structured like this:

  • Add New %s
  • Edit %s
  • No %s Found
  • ...

Same for messages hooked to the post_updated_messages filter:

  • %3$s updated. %1$sView %4$s%2$s
  • %s updated.
  • %1$s draft updated. %3$sPreview %2$s%4$s
  • ...

Same for taxonomies:

  • Search %s
  • All %s
  • New %s Name
  • ...

This is simply not translatable and defeats the purpose of having post type and taxonomy labels in the first place.

In languages other than English, just inserting a post type name into a generic string like Edit %s or %s updated does not work as expected, 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 #WP37895 for example.

This should be replaced with an array of proper labels:

  • Add New Article
  • Edit Article
  • No Articles Found
  • ...
  • Add New WordPress Version
  • Edit WordPress Version
  • No WordPress Versions Found
  • ...

Change History (1)

#1 @SergeyBiryukov
3 years ago

  • Description modified (diff)
Note: See TracTickets for help on using tickets.