Skip Navigation

Resolved

Reported for: WPML Multilingual CMS 4.4.12

Resolved in: 4.5.0

Overview of the issue

If you are using WordPress widgets, you will see that some of them may not appear as translated in the front-end. This is occurring for block-type widgets translated in languages with a locale code containing a hyphen, such as es-es, pt-pt, etc.

Workaround

Our developers are already aware of this situation and they are working in a solution. In the meantime, you can:

  1. Make a full backup of your site before proceeding.
  2. Open /wp-content/plugins/sitepress-multilingual-cms/vendor/wpml/page-builders-gutenberg/src/Widgets/Block/Strings.php
  3. And after line 28:
    		$langCode = Languages::localeToCode( $locale );
    
  4. Add this code:
    		if (strpos($locale, '_') !== false && $langCode === false ){
    			$langCode = strtolower(str_replace('_', '-', $locale));
    		}