Skip to content

Commit

Permalink
Merge pull request #58 from upsellpl/hotfix/pb-1531-fix-translations
Browse files Browse the repository at this point in the history
poprawka tłumaczen dla WP 6.7
  • Loading branch information
mtworoz authored Nov 18, 2024
2 parents 61757a9 + 7902291 commit 2a00378
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions wpi-cart.php
Original file line number Diff line number Diff line change
Expand Up @@ -309,8 +309,8 @@ public function load_textdomain() {
add_filter( 'load_textdomain_mofile', array( $this, 'load_old_textdomain' ), 10, 2 );

// Set filter for plugin's languages directory.
$edd_lang_dir = dirname( plugin_basename( EDD_PLUGIN_FILE ) ) . '/languages/';
$edd_lang_dir = apply_filters( 'edd_languages_directory', $edd_lang_dir );
$plugin_path = dirname(__FILE__);
$edd_lang_dir = $plugin_path . '/languages/';

// Traditional WordPress plugin locale filter.
$locale = apply_filters( 'plugin_locale', get_locale(), 'easy-digital-downloads' );
Expand All @@ -325,6 +325,8 @@ public function load_textdomain() {
// Look in wp-content/languages/plugins/easy-digital-downloads
$mofile_global3 = WP_LANG_DIR . '/plugins/easy-digital-downloads/' . $mofile;

$mofile_local = $edd_lang_dir . $mofile;

if ( file_exists( $mofile_global1 ) ) {

load_textdomain( 'easy-digital-downloads', $mofile_global1 );
Expand All @@ -337,8 +339,13 @@ public function load_textdomain() {

load_textdomain( 'easy-digital-downloads', $mofile_global3 );

} else {
}
elseif ( file_exists( $mofile_local ) ) {

load_textdomain( 'easy-digital-downloads', $mofile_local );

}
else {
// Load the default language files.
load_plugin_textdomain( 'easy-digital-downloads', false, $edd_lang_dir );
}
Expand Down

0 comments on commit 2a00378

Please sign in to comment.