How to translate global modules
A Global library item is a module, row or section that appears exactly the same on whatever pages it is added to.https://www.elegantthemes.com/documentation/divi/global-modules/
This article is done with the Divi version 4.27.3
Actually a small change need to be done in the Divi template , in the file
wp-content/themes/Divi/includes/builder/class-et-builder-element.php line 3068 a line with a filter need to be added
$global_atts = apply_filters('et_pb_module_global_atts',$global_atts,$single_attr);
like this
foreach ( $this->props as $single_attr => $value ) {
if ( isset( $global_atts[ $single_attr ] ) && ! in_array( $single_attr, $unsynced_options, true ) ) {
// replace %22 with double quotes in options to make sure it's rendered correctly.
$global_atts = apply_filters('et_pb_module_global_atts',$global_atts,$single_attr);
$this->props[ $single_attr ] = is_string( $global_atts[ $single_attr ] ) && ! array_intersect( array( "et_pb_{$single_attr}", $single_attr ), $this->dbl_quote_exception_options ) ? str_replace( '%22', '"', $global_atts[ $single_attr ] ) : $global_atts[ $single_attr ];
}
}
A global module is green in the page of module
The original image is set normally,just pay attention to the icon which must be green for the original
p>The icon need to be green in the translation too