Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Contributor Thoa Kim

    (@thoakim)

    Hello

    Please send me your wp-admin via [email protected] with subject “Add another Extra Room Packages not working”, I need to login your site to check.

    Regards

    Thread Starter isaacdemorais1

    (@isaacdemorais1)

    Reading the code of wp-hotel-booking.php, I found out that the correct place to put the .MO file is “/wp-content/languages/plugins”.

    I sugest that you improve the code bellow to read the translations also in the “/wp-content/plugins/wp-hotel-booking/languages”.

    /**
    * Load language for the plugin
    */
    public function load_text_domain() {
    // prefix
    $prefix = basename( dirname( plugin_basename( __FILE__ ) ) );
    $locale = get_locale();
    $dir = $this->plugin_path( ‘languages’ );
    $mofile = false;

    $globalFile = WP_LANG_DIR . ‘/plugins/’ . $prefix . ‘-‘ . $locale . ‘.mo’;
    $pluginFile = $dir . ‘/’ . $prefix . ‘-‘ . $locale . ‘.mo’;

    if ( file_exists( $globalFile ) ) {
    $mofile = $globalFile;
    } else if ( file_exists( $pluginFile ) ) {
    $mofile = $pluginFile;
    }

    if ( $mofile ) {
    // In themes/plugins/mu-plugins directory
    load_textdomain( ‘tp-hotel-booking’, $mofile );
    }
    }

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Add another Extra Room Packages not working’ is closed to new replies.