Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
rvdsteege committed Jun 6, 2023
2 parents 30a59e9 + e9a758b commit 0c973a0
Show file tree
Hide file tree
Showing 4 changed files with 0 additions and 41 deletions.
3 changes: 0 additions & 3 deletions src/Core/Gateway.php
Original file line number Diff line number Diff line change
Expand Up @@ -256,9 +256,6 @@ public function create_refund( Refund $refund ) {
* @throws \Exception Throws exception when action URL for HTTP redirect is empty.
*/
public function redirect( Payment $payment ) {
// Switch to user locale.
Util::switch_to_user_locale();

switch ( $this->method ) {
case self::METHOD_HTTP_REDIRECT:
$this->redirect_via_http( $payment );
Expand Down
15 changes: 0 additions & 15 deletions src/Core/Util.php
Original file line number Diff line number Diff line change
Expand Up @@ -182,19 +182,4 @@ public static function get_remote_address() {
public static function class_method_exists( $class, $method ) {
return class_exists( $class ) && method_exists( $class, $method );
}

/**
* Switch to user locale.
*
* @return void
*/
public static function switch_to_user_locale() {
\switch_to_locale( \get_user_locale() );

\add_filter( 'determine_locale', 'get_user_locale' );

Plugin::load_plugin_textdomain();

\remove_filter( 'determine_locale', 'get_user_locale' );
}
}
20 changes: 0 additions & 20 deletions src/Plugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -596,9 +596,6 @@ public function maybe_redirect() {
// Don't cache.
Core_Util::no_cache();

// Switch to user locale.
Core_Util::switch_to_user_locale();

// Handle redirect message from payment meta.
$redirect_message = $payment->get_meta( 'payment_redirect_message' );

Expand Down Expand Up @@ -653,13 +650,9 @@ public static function get_number_payments() {
* Plugins loaded.
*
* @link https://developer.wordpress.org/reference/hooks/plugins_loaded/
* @link https://developer.wordpress.org/reference/functions/load_plugin_textdomain/
* @return void
*/
public function plugins_loaded() {
// Load plugin textdomain.
self::load_plugin_textdomain();

// Settings.
$this->settings = new Settings( $this );

Expand Down Expand Up @@ -752,19 +745,6 @@ public function plugins_loaded() {
\add_action( 'pronamic_pay_pre_create_payment', [ __CLASS__, 'complement_payment' ], 10, 1 );
}

/**
* Load plugin text domain.
*
* @return void
*/
public static function load_plugin_textdomain() {
$rel_path = \dirname( \plugin_basename( self::$file ) );

\load_plugin_textdomain( 'pronamic_ideal', false, $rel_path . '/languages' );

\load_plugin_textdomain( 'pronamic-money', false, $rel_path . '/packages/pronamic/wp-money/languages' );
}

/**
* Default date time format.
*
Expand Down
3 changes: 0 additions & 3 deletions src/Subscriptions/SubscriptionsModule.php
Original file line number Diff line number Diff line change
Expand Up @@ -266,9 +266,6 @@ public function maybe_handle_subscription_action() {
exit;
}

// Switch to user locale.
Util::switch_to_user_locale();

// Handle action.
switch ( $_GET['action'] ) {
// phpcs:enable WordPress.Security.NonceVerification.Recommended
Expand Down

0 comments on commit 0c973a0

Please sign in to comment.