Skip to content

Commit

Permalink
feat: 綠界多語系
Browse files Browse the repository at this point in the history
  • Loading branch information
j7-dev committed Nov 22, 2024
1 parent 2842a21 commit 8ca25f1
Show file tree
Hide file tree
Showing 12 changed files with 3,734 additions and 23 deletions.
2 changes: 1 addition & 1 deletion includes/class-woomp.php
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ private function load_dependencies() {
private function set_locale() {
$plugin_i18n = new Woomp_i18n();

$this->loader->add_action( 'init', $plugin_i18n, 'load_plugin_textdomain' );
$this->loader->add_action( 'init', $plugin_i18n, 'load_plugin_textdomain', 20 );
}

/**
Expand Down
8 changes: 7 additions & 1 deletion includes/line-pay-for-woo/line-pay-for-woo.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,13 @@
* Plugin updates
* Localization
*/
load_plugin_textdomain( 'woocommerce-gateway-linepay', false, trailingslashit( dirname( plugin_basename( __FILE__ ) ) . '/languages' ) );
add_action(
'init',
function () {
load_plugin_textdomain( 'woocommerce-gateway-linepay', false, trailingslashit( dirname( plugin_basename( __FILE__ ) ) . '/languages' ) );
},
20
);

/**
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1201,7 +1201,7 @@ private function set_locale() {

$plugin_i18n = new Paynow_Einvoice_i18n();

$this->loader->add_action( 'init', $plugin_i18n, 'load_plugin_textdomain' );
$this->loader->add_action( 'init', $plugin_i18n, 'load_plugin_textdomain', 20 );
}

/**
Expand Down
22 changes: 19 additions & 3 deletions includes/ry-woocommerce-tools/class.ry-wt.main.php
Original file line number Diff line number Diff line change
@@ -1,17 +1,33 @@
<?php


// add_action(
// 'init',
// function () {
// load_plugin_textdomain( 'ry-woocommerce-tools', false, \untrailingslashit(\wp_normalize_path(__DIR__)) . '/languages' );
// },
// -10
// );



final class RY_WT {

public static $options = [];
public static $option_prefix = 'RY_WT_';

private static $initiated = false;

public static function init() {
public static function load_plugin_textdomain_ry_woocommerce_tools() {
load_plugin_textdomain( 'ry-woocommerce-tools', false, \untrailingslashit(\wp_normalize_path(__DIR__)) . '/languages' );
}


public static function ry_init() {

if ( ! self::$initiated ) {
self::$initiated = true;

load_plugin_textdomain( 'ry-woocommerce-tools', false, plugin_basename( dirname( RY_WT_PLUGIN_BASENAME ) ) . '/languages' );

if ( ! defined( 'WC_VERSION' ) ) {
add_action( 'admin_notices', [ __CLASS__, 'need_woocommerce' ] );
return;
Expand Down
5 changes: 3 additions & 2 deletions init.php
Original file line number Diff line number Diff line change
Expand Up @@ -127,8 +127,9 @@ function intercept_wc_template( $template, $template_name, $template_path ) {

register_activation_hook( __FILE__, [ 'RY_WT', 'plugin_activation' ] );
register_deactivation_hook( __FILE__, [ 'RY_WT', 'plugin_deactivation' ] );
add_action( 'init', [ 'RY_WT', 'ry_init' ] );
add_action( 'init', [ 'RY_WT', 'load_plugin_textdomain_ry_woocommerce_tools' ] );

add_action( 'init', [ 'RY_WT', 'init' ], 10 );
}

/**
Expand All @@ -153,7 +154,7 @@ function run_paynow_payment() {
Paynow_Payment::init();
}

add_action( 'plugins_loaded', 'run_paynow_payment' );
add_action( 'init', 'run_paynow_payment', 30 );
}

/**
Expand Down
Loading

0 comments on commit 8ca25f1

Please sign in to comment.