Plugin Directory

Changeset 2850921


Ignore:
Timestamp:
01/19/2023 08:49:18 AM (3 years ago)
Author:
trakadev
Message:

init v2.1.0

Add Translation Files
Fix load text domain

Location:
sargapay/trunk
Files:
23 added
1 deleted
2 edited

Legend:

Unmodified
Added
Removed
  • sargapay/trunk/includes/class-sargapay.php

    r2850871 r2850921  
    7474
    7575        $this->load_dependencies();
    76         $this->set_locale();
    7776        $this->define_include_hooks();
    7877        $this->define_admin_hooks();
     
    8685     *
    8786     * - Sargapay_Loader. Orchestrates the hooks of the plugin.
    88      * - Sargapay_i18n. Defines internationalization functionality.
    8987     * - Sargapay_Admin. Defines all hooks for the admin area.
    9088     * - Sargapay_Public. Defines all hooks for the public side of the site.
     
    109107         */
    110108        require_once SARGAPAY_PATH . 'includes/class-sargapay-loader.php';
    111 
    112         /**
    113          * The class responsible for defining internationalization functionality
    114          * of the plugin.
    115          */
    116         require_once SARGAPAY_PATH . 'includes/class-sargapay-i18n.php';
    117109
    118110        /**
     
    182174            return $gateways;
    183175        }
    184     }
    185 
    186     /**
    187      * Define the locale for this plugin for internationalization.
    188      *
    189      * Uses the Wp_React_Plugin_Boilerplate_i18n class in order to set the domain and to register the hook
    190      * with WordPress.
    191      *
    192      * @since    1.0.0
    193      * @access   private
    194      */
    195     private function set_locale()
    196     {
    197 
    198         $plugin_i18n = new Sargapay_i18n();
    199 
    200         $this->loader->add_action('init', $plugin_i18n, 'load_plugin_textdomain', 100);
    201176    }
    202177
  • sargapay/trunk/sargapay.php

    r2850871 r2850921  
    2323 * License URI: https://www.gnu.org/licenses/gpl-2.0.html
    2424 * Text Domain:       sargapay
    25  * Domain Path:       /languages
     25 * Domain Path:       /languages/
    2626 * Requires PHP:      7.4
    2727 */
     
    6363add_filter('cron_schedules', 'sargapay_cron_hook');
    6464add_action('sargapay_cron_hook', 'sargapay_check_confirmations_cardano');
     65add_action('plugins_loaded', 'sargapay_load_plugin_textdomain');
    6566
    6667/**
     
    8889        wp_schedule_event(time(), 'every_ten_minutes', 'sargapay_cron_hook');
    8990    }
     91}
     92
     93function sargapay_load_plugin_textdomain()
     94{
     95    load_plugin_textdomain(
     96        'sargapay',
     97        false,
     98        dirname(plugin_basename(__FILE__)) . '/languages/'
     99    );
    90100}
    91101
Note: See TracChangeset for help on using the changeset viewer.