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