| @@ -76,14 +76,13 @@ | ||
| 76 | 76 | |
| 77 | 77 | // Don't try to save time for en_US as some users have theme written in another language |
| 78 | 78 | // Now we can load all overridden text domains with the right language |
| 79 | 79 | if ( ! empty( $this->list_textdomains ) ) { |
| 80 | - /* | |
| 81 | - * FIXME: Backward compatibility with WP < 5.6 | |
| 82 | - * From WP 4.7 to 5.5, we need to reset the internal cache of _get_path_to_translation when switching from any locale to en_US. | |
| 83 | - * See WP_Locale_Switcher::change_locale() | |
| 84 | - */ | |
| 85 | - if ( ! class_exists( 'WP_Textdomain_Registry' ) && function_exists( '_get_path_to_translation' ) ) { | |
| 80 | + | |
| 81 | + // Since WP 4.7 we need to reset the internal cache of _get_path_to_translation when switching from any locale to en_US | |
| 82 | + // See WP_Locale_Switcher::change_locale() | |
| 83 | + // FIXME test _get_path_to_translation for backward compatibility with WP < 4.7 | |
| 84 | + if ( function_exists( '_get_path_to_translation' ) ) { | |
| 86 | 85 | _get_path_to_translation( null, true ); |
| 87 | 86 | } |
| 88 | 87 | |
| 89 | 88 | foreach ( $this->list_textdomains as $textdomain ) { |
| @@ -139,16 +138,18 @@ | ||
| 139 | 138 | } |
| 140 | 139 | |
| 141 | 140 | /** |
| 142 | 141 | * FIXME: Backward compatibility with Polylang for WooCommerce < 0.3.4 |
| 143 | - * Was formerly hooked to the filter 'override_load_textdomain' | |
| 142 | + * To remove in Polylang 2.1 | |
| 144 | 143 | * |
| 145 | 144 | * @since 0.1 |
| 146 | 145 | * |
| 147 | - * @param bool $bool Whether to override the .mo file loading. | |
| 146 | + * @param bool $bool not used | |
| 147 | + * @param string $domain text domain name | |
| 148 | + * @param string $mofile translation file name | |
| 148 | 149 | * @return bool |
| 149 | 150 | */ |
| 150 | - public function mofile( $bool ) { | |
| 151 | + public function mofile( $bool, $domain, $mofile ) { | |
| 151 | 152 | return $bool; |
| 152 | 153 | } |
| 153 | 154 | |
| 154 | 155 | /** |