Viewing 2 replies - 1 through 2 (of 2 total)
  • Nice work. Can you please add translations .po and .mo files to your plugin? Thx

    // in AdminBar.php
    
    $count = count( $notifications );
    // Add top menu
    $wp_admin_bar->add_menu( array(
        'id'     => 'wp-notification-center',
        'parent' => 'top-secondary',
        'title'  => sprintf( _n( 'Notification %s', 'Notifications %s', $count, 'wp-notification-center' ), '<span class="wpnc-count">' . $count . '</span>' ),
        'href'   => false
    ) );
    
    // in plugin.php
    
    add_action( 'init', $this->load_plugin_textdomain() );
    
    public function load_plugin_textdomain() {
    	$domain = 'wp-notification-center';
    	$locale = apply_filters( 'plugin_locale', get_locale(), $domain );
    
        if ( $loaded = load_textdomain( $domain, trailingslashit( WP_LANG_DIR ) . 'plugins/' . $domain . '-' . $locale . '.mo' ) ) {
            return $loaded;
        } else if ( defined( 'WPMU_PLUGIN_DIR' ) && file_exists( WPMU_PLUGIN_DIR . '/core/core.php' ) ) {
            load_muplugin_textdomain( $domain, dirname( plugin_basename( __FILE__ ) ) .  '/lang' );
        } else {
            load_plugin_textdomain( $domain, false, dirname( plugin_basename( __FILE__ ) ) .  '/lang' );
        }
    }
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Future Releases’ is closed to new replies.