Automattic / wp-calypso

The JavaScript and API powered WordPress.com
https://developer.wordpress.com
GNU General Public License v2.0
12.42k stars 1.99k forks source link

CPT / Editor: Ensure editor uses post type labels when applicable #3695

Closed aduth closed 8 years ago

aduth commented 8 years ago

Post types can define labels to be shown in the interface. In the current editor, many labels are hard-coded to either the post or page context. We should update these labels to pull from the post type API response when possible.

Examples

Return to list view

image

From: postType.labels.menu_name

New post header label

image

From: postType.labels.new_item

Status label loading text

image

https://github.com/Automattic/wp-calypso/blob/6dde06c/client/post-editor/status-label.jsx#L62-L68

This should be updated to either Loading… or Loading %(postType)s…

From: postType.labels.singular_name (lowercase)

mtias commented 8 years ago

How about translation?

aduth commented 8 years ago

How about translation?

Already accounted for in the WordPress.com REST API.

Example: https://public-api.wordpress.com/rest/v1.1/sites/example.wordpress.com/post-types?locale=fr

Some related discussion for WP-API at https://github.com/Automattic/wp-calypso/pull/3130#issuecomment-190380378 , which is relevant for this project given #3690.

mtias commented 8 years ago

@aduth I mean more about the UX flow for submitting and tweaking translations, we'll lose the community-translator benefits, which has been great so far.

aduth commented 8 years ago

I mean more about the UX flow for submitting and tweaking translations, we'll lose the community-translator benefits, which has been great so far.

Many strings we (rightfully) have no control over, particularly labels of custom post types for plugins used on a Jetpack site. We could at least hard-code labels for custom post types known to be translated on WordPress.com, or alternatively decide upon new labels which are post-type agnostic.

aduth commented 8 years ago

Finished items:

Remaining items:

Skipped items:

Reasoning: You can see the labels we have available for a post type here at the following REST API response, which you'll note does not cover these cases:

https://public-api.wordpress.com/rest/v1.1/sites/example.wordpress.com/post-types