[wp-trac] [WordPress Trac] #50740: i18n: Merge similar translation strings in core post api

WordPress Trac noreply at wordpress.org
Thu Jul 23 09:26:29 UTC 2020


#50740: i18n: Merge similar translation strings in core post api
----------------------------+-----------------------------
 Reporter:  ramiy           |      Owner:  whyisjake
     Type:  defect (bug)    |     Status:  assigned
 Priority:  normal          |  Milestone:  Awaiting Review
Component:  I18N            |    Version:
 Severity:  normal          |   Keywords:
  Focuses:  administration  |
----------------------------+-----------------------------
 The `wp-includes/post.php` file has a `create_initial_post_types()`
 function that registers initial post types & statuses.

 When registering **Privacy Statuses** (''Pending, Confirmed, Failed,
 Completed''), translation string use `_x()` context function.

 Below we have the `_wp_privacy_statuses()` function that returns privacy
 statuses. This function uses regular `__()` function without any context.

 The same 4 strings have 8 translation strings in the translate system
 bloating the total number of translation strings.

 We can merge those translation strings by using context functions inside
 `_wp_privacy_statuses()`.

 See the screenshot from the translation system and the attached patch.

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/50740>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list