• Resolved the.mnbvcx

    (@themnbvcx-1)


    There are still a couple of untranslateable strings in admin/post.php in function wpmem_block_meta().

    And once you’re at it you might want to remove the strtolower in line 225 – not all languages reserve capital letters for sentence beginnings and names only.

    The funtion should look like this to enable full translation:

    function wpmem_block_meta() {
    
    	global $post, $wpmem;
    
    	wp_nonce_field( 'wpmem_block_meta_nonce', 'wpmem_block_meta_nonce' );
    
    	$post_type = get_post_type_object( $post->post_type );
    
    	if ( isset( $wpmem->block[ $post->post_type ] ) && $wpmem->block[ $post->post_type ] == 1 ) {
    		$block = 0;
    		$notice_text = __('blocked');
    		$text = __('Unblock');
    	} else { //} elseif ( $wpmem->block[ $post->post_type ] == 0 ) {
    		$block = 1;
    		$notice_text = __('not blocked');
    		$text = __('Block');
    	}
    	$meta = '_wpmem_block';
    	$admin_url = get_admin_url(); ?>
    
    	<p>
    		<?php
    		printf( __('%s are %s by default.'), $post_type->labels->name, $notice_text );
    		echo '&nbsp;&nbsp;';
    		printf( '<a href="%s/options-general.php?page=wpmem-settings">'. __('Edit') . '</a>', $admin_url );
    		?>
    	</p>
    	<p>
    	<?php if( $block == 1 ) { ?>
    		<input type="checkbox" id="wpmem_block" name="wpmem_block" value="1" <?php checked( get_post_meta( $post->ID, $meta, true ), '1' ); ?> />
    	<?php } else { ?>
    		<input type="checkbox" id="wpmem_block" name="wpmem_block" value="0" <?php checked( get_post_meta( $post->ID, $meta, true ), '0' ); ?> />
    	<?php } ?>
    		<label for="wpmem_block"><?php printf( __('%s this %s'), $text, $post_type->labels->singular_name ); ?></label>
    	</p>
    	<?php
    	/**
    	 * Fires after the post block meta box.
    	 *
    	 * Allows actions at the end of the block meta box on pages and posts.
    	 *
    	 * @since 2.8.8
    	 *
    	 * @param $post  object  The WP Post Object.
    	 * @param $block boolean The WP-Members block value.
    	 */
    	do_action( 'wpmem_admin_after_block_meta', $post, $block );
    }

    https://wordpress.org/plugins/wp-members/

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Chad Butler

    (@cbutlerjr)

    Thanks for reminding me.

    This section wasn’t set up for localization initially because it relied on the terms “block” and “unblock” to determine which state the meta box was in. That’s also the reason the strtolower() was used – it was using these terms as the comparison operator. So if they had been translated and/or the wrong case, the logic would not work.

    This underwent some changes for 3.0 as I intended to introduce native support in the plugin for custom post types.

    But that was rolled back during the initial 3.0.0 rollout due to some other problems.

    I’ve been working to add CPT support back in with 3.0.9, due out in the next few days, so this file (and actually this section) are getting some changes implemented that will improve the way the meta boxes are handled, so I can probably begin to bring in localization into that process.

    Thread Starter the.mnbvcx

    (@themnbvcx-1)

    OK, thx for the feedback.

    As you have it on your agenda I will mark this topic resolved for now.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Untranslated strings in plugin v 3.0.8’ is closed to new replies.