WordPress.org

Make WordPress Core

Opened 14 months ago

Last modified 10 months ago

#23503 closed defect (bug)

Post Formats: i18n issues — at Version 22

Reported by: SergeyBiryukov Owned by:
Milestone: 3.6 Priority: normal
Severity: normal Version: 3.6
Component: I18N Keywords: has-patch
Focuses: Cc:

Description (last modified by SergeyBiryukov)

  1. Most of the time, we refer to the "Standard" post format with the appropriate context:
    http://core.trac.wordpress.org/browser/tags/3.5.1/wp-admin/includes/class-wp-posts-list-table.php#L1013
    http://core.trac.wordpress.org/browser/tags/3.5.1/wp-admin/press-this.php#L480
    http://core.trac.wordpress.org/browser/tags/3.5.1/wp-includes/post.php#L5325

    In a couple of places, however, the context is missing:
    http://core.trac.wordpress.org/browser/tags/3.5.1/wp-admin/includes/meta-boxes.php#L318
    http://core.trac.wordpress.org/browser/tags/3.5.1/wp-admin/options-writing.php#L90
  1. [23449] introduced Edit screen UI for post formats. There's now a "Standard" tab above the post title. In Russian, "post" is feminine and "format" is masculine, so seeing "Standard" adjective without the "format" word next to it is confusing. I guess the tab needs a separate context. Fixed in [23843].
  1. [23843] introduced a couple of issues:
    1. ucfirst( sprintf( __( '%s Post' ), $slug ) ):
      http://core.trac.wordpress.org/browser/trunk/wp-admin/edit-form-advanced.php?rev=23868#L186
      1. '%s Post' is not localizable, see dd32's comment in #17609.
      2. ucfirst() doesn't always work correctly for UTF-8 characters, it depends on PHP locale.
      We should use actual labels instead of just putting post format slugs into a generic string.
    2. i18n is missing in line 397:
      http://core.trac.wordpress.org/browser/trunk/wp-admin/edit-form-advanced.php?rev=23868#L397
      No longer relevant; see #24452.

Change History (30)

SergeyBiryukov14 months ago

comment:1 SergeyBiryukov13 months ago

  • Description modified (diff)
  • Keywords needs-patch added; has-patch removed
  • Summary changed from Standard post format needs more contexts to Post Formats: i18n issues

johnbillion13 months ago

comment:2 johnbillion13 months ago

  • Keywords has-patch added; needs-patch removed

23503.2.patch adds a new set of labels to post types for each post format, uses these labels in the admin UI, and corrects the other issues mentioned above by Sergey.

comment:3 helen13 months ago

#23911 was marked as a duplicate.

comment:4 SergeyBiryukov13 months ago

Pages don't have post formats, looks like there should be null instead of 'Standard Page', etc.

Or, we could introduce a new function (I'd suggest get_post_format_labels()) instead of piggybacking on get_post_type_labels().

comment:5 SergeyBiryukov13 months ago

Or just add an argument to get_post_format_strings() to return 'Standard Post', etc.

comment:6 follow-up: johnbillion13 months ago

The point is though that any post type can be given support for post formats, and the 'Page' format labels are used as fallback for hierarchical post types.

comment:7 SergeyBiryukov13 months ago

Ah, I see. Makes sense then.

kopepasah13 months ago

Remove 'Post' from the post format tip.

comment:8 in reply to: ↑ 6 kopepasah13 months ago

Replying to johnbillion:

The point is though that any post type can be given support for post formats, and the 'Page' format labels are used as fallback for hierarchical post types.

At first I was going to recommend using the current post type (instead of 'Post') for each custom post type (e.g. Standard Post, Aside Book, Gallery Food, et cetera), but reading that this does not fit the context.

Because any post type can be given support for post formats, I recommend taking out the word 'Post' and any other post type altogether. Users should not have to be reminded which post type they are editing.

The only tip that needs to show is the format.

comment:9 c3mdigital13 months ago

#23972 was marked as a duplicate.

comment:10 SergeyBiryukov13 months ago

#23976 was marked as a duplicate.

comment:11 nvartolomei13 months ago

#23979 was marked as a duplicate.

comment:13 follow-up: SergeyBiryukov13 months ago

23503.post-format-tip.patch is not localizable. Dynamic strings like sprintf( __( '%s' ), $slug ) or _e( $post_format ) cannot be extracted by gettext:
http://ottopress.com/2012/internationalization-youre-probably-doing-it-wrong/

23503.2.patch looks good to me. The "Post format" context is probably not necessary for strings like "Standard Post" in get_post_type_labels(). It's only needed for ambiguous strings like "Standard".

comment:14 in reply to: ↑ 13 kopepasah13 months ago

Replying to SergeyBiryukov:

23503.post-format-tip.patch is not localizable. Dynamic strings like sprintf( __( '%s' ), $slug ) or _e( $post_format ) cannot be extracted by gettext:
http://ottopress.com/2012/internationalization-youre-probably-doing-it-wrong/

Thanks for pointing that out. Localization is not my forte. I will read through that article and resubmit my patch.

DrewAPicture13 months ago

Add "Edit {format} Post" labels

DrewAPicture13 months ago

Cast format labels as object, shorten keys

comment:15 DrewAPicture13 months ago

23503.4.patch follows feedback from @nacin and @SergeyBiryukov in IRC last night and adds post format post type labels as a sub-object in the form of '{format} Post', 'Edit {format} Post'.

Still needs a little help in terms of merging default values with undefined format labels in register_post_type() form cpts.

comment:16 DrewAPicture13 months ago

  • Cc xoodrew@… added

comment:17 SergeyBiryukov13 months ago

23503.5.patch fixes the issue with merging CPT labels with the default ones (mentioned by Drew in the IRC chat). While we're at it, also reformats the whole labels array for better readability.

I guess the context for post format labels is superfluous, as they are not ambiguous. We can add it later if needed.

SergeyBiryukov13 months ago

comment:18 johnbillion12 months ago

Related to this, we should get rid of the annoying and unnecessary title attribute on the post format selectors.

comment:19 kovshenin11 months ago

  • Keywords needs-refresh added

DrewAPicture11 months ago

refresh

comment:20 DrewAPicture11 months ago

  • Keywords needs-refresh removed

comment:21 johnbillion10 months ago

  • Description modified (diff)

Point #3 in this ticket is also no longer relevant due to #24452. Patch for the remaining issue coming up.

johnbillion10 months ago

comment:22 SergeyBiryukov10 months ago

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