From be05591bc91d6ef1b7c099d1b17d9ef1f074949d Mon Sep 17 00:00:00 2001 From: Chris Scott Date: Wed, 13 Feb 2013 15:31:49 -0500 Subject: [PATCH] reformat translated strings and add text domain. TODO: de_DE missing translation for removing thumbnail. --- multi-post-thumbnails.php | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/multi-post-thumbnails.php b/multi-post-thumbnails.php index 73e6697..012f560 100644 --- a/multi-post-thumbnails.php +++ b/multi-post-thumbnails.php @@ -107,7 +107,7 @@ public function get_meta_key() { * @return void */ public function add_metabox() { - add_meta_box("{$this->post_type}-{$this->id}", __($this->label), array($this, 'thumbnail_meta_box'), $this->post_type, $this->context, $this->priority); + add_meta_box("{$this->post_type}-{$this->id}", __($this->label, 'multiple-post-thumbnails'), array($this, 'thumbnail_meta_box'), $this->post_type, $this->context, $this->priority); } /** @@ -346,8 +346,9 @@ private function post_thumbnail_html($thumbnail_id = null) { $image_library_url = get_upload_iframe_src('image'); // if TB_iframe is not moved to end of query string, thickbox will remove all query args after it. $image_library_url = add_query_arg( array( 'context' => $this->id, 'TB_iframe' => 1 ), remove_query_arg( 'TB_iframe', $image_library_url ) ); - $set_thumbnail_link = sprintf('

%%s

', esc_attr__( "Set {$this->label}" ), $image_library_url, $this->post_type, $this->id); - $content = sprintf($set_thumbnail_link, esc_html__( "Set {$this->label}" )); + $format_string = '

%%s

'; + $set_thumbnail_link = sprintf( $format_string, sprintf( esc_attr__( "Set %s" , 'multiple-post-thumbnails' ), $this->label ), $image_library_url, $this->post_type, $this->id ); + $content = sprintf( $set_thumbnail_link, sprintf( esc_html__( "Set %s", 'multiple-post-thumbnails' ), $this->label ) ); if ($thumbnail_id && get_post($thumbnail_id)) { @@ -360,7 +361,8 @@ private function post_thumbnail_html($thumbnail_id = null) { if (!empty($thumbnail_html)) { $ajax_nonce = wp_create_nonce("set_post_thumbnail-{$this->post_type}-{$this->id}-{$post_ID}"); $content = sprintf($set_thumbnail_link, $thumbnail_html); - $content .= sprintf('

%3$s

', $this->post_type, $this->id, esc_html__( "Remove {$this->label}" ), $ajax_nonce); + $format_string = '

%3$s

'; + $content .= sprintf( $format_string, $this->post_type, $this->id, sprintf( esc_html__( "Remove %s", 'multiple-post-thumbnails' ), $this->label ), $ajax_nonce ); } $content_width = $old_content_width; } @@ -414,5 +416,5 @@ public static function set_meta($post_ID, $post_type, $thumbnail_id, $thumbnail_ } if ( is_admin() ) - load_plugin_textdomain( 'multiple-post-thumbnails', FALSE, 'multiple-post-thumbnails/languages/' ); + load_plugin_textdomain( 'multiple-post-thumbnails', FALSE, 'multi-post-thumbnails/languages/' ); }