Making WordPress.org

Opened 6 years ago

Closed 21 hours ago

#5455 closed defect (bug) (fixed)

HelpHub: Correct post type and taxonomy labels

Reported by: SergeyBiryukov Owned by:
Priority: normal Milestone:
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 (2)

#1 @SergeyBiryukov
5 years ago

  • Description modified (diff)

#2 @obenland
21 hours ago

  • Resolution → fixed
  • Status new → closed

The post type and taxonomy labels are now full strings, with no post type or taxonomy name dropped into a generic one. The update messages work the same way, so all of them can be translated. Fixed in ​https://github.com/WordPress/wporg-documentation-2022/pull/115 and synced in [15566].

Note: See TracTickets for help on using tickets.