• Resolved Arakawa

    (@arakawa1227)


    I noticed that Shortcodes Pro had a issue with localization when I have tlanslated this awesome plugin into my mother tongue.

    The following is a part of the .po file that I have made.

    #: inc/class-shortcodespro-type.php:897
    msgid "Wrap content with"
    msgstr "内容を囲む"
    
    #: inc/class-shortcodespro-type.php:898
    msgid "Insert custom code"
    msgstr "カスタムコードを挿入"

    After the translation, options with <select> element haven’t worked correctly in “Add New Shortcode” page.
    Because ShortCodes Pro outputs strange HTML like below.

    <select name="type" id="type">
    <option value="%e5%86%85%e5%ae%b9%e3%82%92%e5%9b%b2%e3%82%80">内容を囲む</option>
    <option value="%e3%82%ab%e3%82%b9%e3%82%bf%e3%83%a0%e3%82%b3%e3%83%bc%e3%83%89%e3%82%92%e6%8c%bf%e5%85%a5">カスタムコードを挿入</option>
    </select>

    ‘Type’ option in ‘New Attribute Details’ popup window also doesn’t work.

    This issue seems to come from inc/class-shortcodespro-type.php.
    For example,

    function _custom_define_metaboxes()
    {
        // ...
        'options' => array(
    	'wrap-content-with' =>  __( 'Wrap content with', 'shortcodes-pro' ),
    	'insert-custom-code' => __( 'Insert custom code', 'shortcodes-pro' )
        )),

    This should be the following.

    function _custom_define_metaboxes()
    {
        // ...
        'options' => array(
    	'wrap-content-with' =>  array(
    		'id' => 'wrap-content-with',
    		'title' => __( 'Wrap content with', 'shortcodes-pro' )
    	),
    	'insert-custom-code' => array(
    		'id' => 'insert-custom-code',
    		'title' => __( 'Insert custom code', 'shortcodes-pro' )
    	)
        )),

    It would be nice if this issue were fixed.

    http://wordpress.org/extend/plugins/shortcodes-pro/

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author Matt

    (@sksmatt)

    Hi Arakawa,

    Thanks for the heads up, will look into it.

    Kind Regards!

    Plugin Author Matt

    (@sksmatt)

    Hi Arakawa,

    Please update to version 1.1.0.1. It should solve this issue.

    Kind Regards!

    Thread Starter Arakawa

    (@arakawa1227)

    Hi sksmatt.
    Thanks for your review and updating!

    I have updated the plugin and I have tried new version.
    Unfortunately, I noticed I need more additional changes and I have done.

    I attached a patch for 1.1.0.1, which is the one for the localization and mutibyte language.

    And here is new POT file.

    http://dl.dropbox.com/u/80079048/shortcodes-pro.pot

    ‘Action’ feature doesn’t yet work correctly with multibyte, but most of the features work well.

    I wonder if you could review it.
    And I wish I would fix the ‘Action’ issue and I would send you translated language file.

    Regards.

    A patch for 1.1.0.1

    diff -ur original/inc/class-shortcodespro-type.php shortcodes-pro/inc/class-shortcodespro-type.php
    --- original/inc/class-shortcodespro-type.php   2012-05-18 05:41:07.543251785 +0900
    +++ shortcodes-pro/inc/class-shortcodespro-type.php     2012-05-18 05:33:32.192993819 +0900
    @@ -75,7 +75,7 @@
                            register_post_type( $this->post_type_id,
                            array(
                                    'labels' => array(
    -                                                               'name' =>  'Shortcodes',
    +                                                               'name' =>  __( 'Shortcodes', 'shortcodes-pro' ),
                                                            'singular_name' => __( 'Shortcode', 'shortcodes-pro' ),
                                                                    'add_new' => __( 'Add New Shortcode', 'shortcodes-pro' ),
                                                                    'add_new_item' => __( 'Add New Shortcode', 'shortcodes-pro' ),
    @@ -544,7 +544,8 @@
                                    // Type of Shortcode
                                    case 'behavior':
                                            $behavior = $this->humanize_string( get_post_meta( $post->ID, 'type', true ) );
    -                                       echo str_replace( array( 'Custom', 'With' ), '', $behavior );
    +                                       $behavior = str_replace( array( ' Custom', ' With' ), '', $behavior );
    +                                       _e( $behavior, 'shortcodes-pro' );
                                    break;
    
                                    // Row of Shortcode
    @@ -554,7 +555,7 @@
                                            if ( $row == "" )
                                            echo '-';
                                            else
    -                                       echo $row;
    +                                       _e( $row, 'shortcodes-pro' );
    
                                    break;
    
    @@ -1037,10 +1038,10 @@
                                            'class' => 'rowbutton',
                                            'type'=>'select',
                                            'options' => array(
    -                                               'row-1' =>  __( 'Row 1', 'shortcodes-pro' ),
    -                                               'row-2' =>  __( 'Row 2', 'shortcodes-pro' ),
    -                                               'row-3' =>  __( 'Row 3', 'shortcodes-pro' ),
    -                                               'row-4' =>  __( 'Row 4', 'shortcodes-pro' ),
    +                                               'row-1' =>  array( 'id' => 'row-1', 'title' => __( 'Row 1', 'shortcodes-pro' ) ),
    +                                               'row-2' =>  array( 'id' => 'row-2', 'title' => __( 'Row 2', 'shortcodes-pro' ) ),
    +                                               'row-3' =>  array( 'id' => 'row-3', 'title' => __( 'Row 3', 'shortcodes-pro' ) ),
    +                                               'row-4' =>  array( 'id' => 'row-4', 'title' => __( 'Row 4', 'shortcodes-pro' ) ),
                                             ),
                                            'std' => 'row-1' ),
    
    @@ -1128,9 +1129,9 @@
                                    'req' => 'true',
                                    'std' => '',
                                    'options' => array(
    -                                       'text' =>  __( 'Text', 'shortcodes-pro' ),
    -                                       'textarea' =>  __( 'Textarea', 'shortcodes-pro' ),
    -                                       'select' =>  __( 'Select', 'shortcodes-pro' ),
    +                                       'text' =>  array( 'id' => 'text', 'title' => __( 'Text', 'shortcodes-pro' ) ),
    +                                       'textarea' =>  array( 'id' => 'textarea', 'title' => __( 'Textarea', 'shortcodes-pro' ) ),
    +                                       'select' =>  array( 'id' => 'select', 'title' => __( 'Select', 'shortcodes-pro' ) ),
                                     ) ),
    
                                    array(

    Plugin Author Matt

    (@sksmatt)

    Arakawa,

    You are my hero. Please update to 1.1.1, many new changes on the code, included yours.

    Kind Regards!

    Thread Starter Arakawa

    (@arakawa1227)

    Wow, 1.1.1.1 has already been released!

    I should update to new version. Thanks 🙂

Viewing 5 replies - 1 through 5 (of 5 total)

The topic ‘[Plugin: Shortcodes Pro] some options don't work with localization’ is closed to new replies.