Skip Navigation

Resolved

Overview of the issue

If you are using a page builder in your website, you may notice that if you add some emojis in a block of content, that block won’t be available for translation in the Advanced Translation Editor or Classic Translation Editor.

Workaround

This issue appears because of a table collation conflict. If your server supports the collation utf8mb4_general_ci, you can follow this procedure after making a full backup of your site:

  1. Open your theme’s functions.php file.
  2. Add this code:
    // Notice admin_init - will only run in backend
    add_action('admin_init', function() {
    	require_once(ABSPATH.'/wp-admin/includes/upgrade.php');
    	global $wpdb;
    	$mytables=$wpdb->get_results("SHOW TABLES");
    	foreach ($mytables as $mytable)
    	{
    	    foreach ($mytable as $t) 
    	    {       
    	        maybe_convert_table_to_utf8mb4( $t );
    	    }
    	}
    	
    });
    
  3. Visit any page in your site’s backend.
  4. Remove the code.

Your database tables collation should be utf8mb4_general_ci now, and the content will be available for translation.

In case your site’s database is using latin1 collation, you could apply the following workaround instead:

  1. Make a full backup of your site before proceeding.
  2. Go to: https://github.com/interconnectit/Search-Replace-DB.
  3. Download the ZIP file of the project and unzip it.
  4. Upload the unzip folder to your WordPress installation using a FTP client.
  5. Visit the folder – e.g. http://example.com/Search-Replace-DB-master/
  6. Fill out your database name, server, user and password. You can obtain those values from your wp-config.php file.
  7. Click and test the connection.
  8. Go to the bottom and click on the button “Convert to UTF8MB4“.
  9. Wait for the process to finish.
  10. Once this is done click “Delete me” button

 

6 Responses to “Page builder content is not available for translation when it includes emojis”

  1. Our charset was already utf8mb4, but collation was utf8mb4_unicode_520_ci.
    We did change the collate to utf8mb4_general_ci. It didn’t solve the problem.

    We are still having errors in the backend like

    WordPress database error: Could not perform query because it contains invalid data.
    Array
    (
    [language] => fi
    [context] => gutenberg-48464
    [gettext_context] =>
    [domain_name_context_md5] => 6ba2647d7d6fb14b486fdb4c9077674d
    [name] => 2aa42ca2d68e9af29e111c198ecf98ee
    [value] => 🔗 Kartoitetaan osaamistaso
    [status] => 0
    [translation_priority] => optional
    [allow_empty_value] =>
    )

      • Ha Andrés and thanks for your response.

        I was directed here from your support chat. As you can see, the value contains emoji. And I had the same error for multiple different contents, all of which included also an emoji. For me, these problems seem to be closely related.

        To be specific, the error message started as “We have detected a problem with some tables in the database. Please contact WPML support to get this fixed.” and was visible in all of the pages of the WP backend.

        However, after clicking the close button in the error message, those seem now to been gone.

        • Thank you, however if the issue remains after applying the fix, we need to investigate it as it may not be slightly different. Could you please open a new ticket as we don’t have the right tools to help you here?

  2. Bonjour, j’ai mis à jour vos droits. Ca devrait fonctionner.

    Concernant la procédure je l’avais déjà mis en place, le charset de la ma base est bien modifier mais ca ne change rien.

    Merci.