Skip to content

Commit

Permalink
Fix loading translations from plugin/theme directory (#6)
Browse files Browse the repository at this point in the history
  • Loading branch information
ocean90 authored Oct 23, 2023
1 parent f837613 commit fc17420
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion translations-cache.php
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,8 @@ function load_textdomain( ?bool $loaded, string $domain, string $mofile, ?string
if ( ! is_readable( $mofile ) ) {
cache_add( $cache_key, false, DEFAULT_EXPIRE );

return true;
// Return false so the default fallback loading can apply.
return false;
}

$mo = new \MO();
Expand Down Expand Up @@ -152,6 +153,9 @@ function load_textdomain( ?bool $loaded, string $domain, string $mofile, ?string
}

$l10n[ $domain ] = &$mo; // phpcs:ignore WordPress.WP.GlobalVariablesOverride.Prohibited
} elseif ( false === $data ) {
// Return false so the default fallback loading can apply.
return false;
}

return true;
Expand Down

0 comments on commit fc17420

Please sign in to comment.