Make WordPress Core

Opened 13 years ago

Closed 13 years ago

#24681 closed enhancement (duplicate)

Translating custom image size names

Reported by: sami.keijonen Owned by:
Priority: normal Milestone:
Component: Media Version: 3.5
Severity: normal Keywords:
Cc: Focuses:

Description

Should there be parameter in ​add_image_size for a translated name? Now we need to use image_size_names_choose hook.

Something like add_image_size( $name, $translated_name, $width, $height, $crop );

Example add_image_size( 'my-thumbnail-portfolio', __( 'My Portfolio thumbnail', 'text-domain' ), 450, 309, true );

I wrote ​article about it the get the idea why and how to translate custom image sizes now.

Change History (4)

#1 @krogsgard
13 years ago

  • Cc krogsgard added

I think you'd want to add $translated_name as the last parameter for backward compatibility. And you'd need to set a default as well.

In core, I think it'd be more like

function add_image_size( $name, $width = 0, $height = 0, $crop = false, $translated_name = __(  $name ) ) {
// stuff
}

#2 @sami.keijonen
13 years ago

Thanks Brian. I wasn't thinking. I was too afraid that my first ticket would blow up WP to a black hole.

#3 @daveshine
13 years ago

  • Cc daveshine added

Definitely an awesome idea/ enhancement which would have benefits for the end user (think media uploader: real names for added image sizes!) and theme/ plugin devs, as the process of adding the i18n stuff would become much easier and faster, and so hopefully gets implemented in the end!

These are "small details" that matter in user experience!

#4 @SergeyBiryukov
13 years ago

  • Component General → Media
  • Milestone Awaiting Review
  • Resolution → duplicate
  • Status new → closed
  • Version trunk → 3.5
Note: See TracTickets for help on using tickets.