Open kennypu opened 2 years ago
Let me know if you need an urgent solution to this.
@MKRD-SUPPORT I don't, but thank you. For anyone else having this issue, here is how I have it fixed for the time being:
/** Make sure that blogname is converted properly */
add_filter( 'option_blogname', function( $value ) {
global $pagenow, $q_config;
$ignore_pages = array(
'options-general.php',
'options.php',
);
if( in_array($pagenow, $ignore_pages) ) return $value;
// qtranslate uses only the 2 character code (that can be set in back-end) so we need to convert
// if it isn't available, default to 'en'
$current_language_code = convert_locale_to_langcode( get_locale() ) ?? 'en';
return qtranxf_use_language( $current_language_code, $value, false, false );
});
/**
* Convert PHP/Wordpress Locale to q_config saved language code
*/
function convert_locale_to_langcode( $locale ) {
global $q_config;
if( empty($q_config) ) return false;
return array_search( $locale, $q_config['locale'] );
}
Interestingly, you can find a similar code commented out in qtx_admin_utils.php:355
, so I guess it was noticed but never finished.
Issue Default Wordpress email notifications (new user, password reset, password changed, etc.) that contain the site title does not properly filter the title language.
How to Reproduce
The default email's subject and content will contain (with a fresh activation) [:en]English Site Title[:de] Translated Title in the email.
Expected Behavior Site title in email should be either 1. translated properly to the user's language or 2. Default to the website's default language.
Tested on