This is the technical support forum for WPML - the multilingual WordPress plugin.

Everyone can read, but only WPML clients can post here. WPML team is replying on the forum 6 days per week, 22 hours per day.

This topic contains 5 replies, has 2 voices.

Last updated by Alejandro 6 months ago.

Assigned support staff: Alejandro.

Author Posts
April 8, 2019 at 10:56 am #3556853

maglottf

I am trying to:
Translate a table that has been added with powerpack extension for elementor.
Link to a page where the issue can be seen:
hidden link
I expected to see:
The text that has been added with powerpack table.
Instead, I got:
When i open the translation editor it shows all text except text that has been added with any powerpack widget.

April 9, 2019 at 6:25 am #3563261

maglottf

Hi Alejandro. Any update please? This is quite an urgent matter for me.

April 9, 2019 at 7:01 am #3563325

Alejandro
Supporter

Languages: English (English ) Spanish (Español ) Italian (Italiano )

Timezone: Europe/Rome (GMT+02:00)

Almost there. can you just upload the powerpack plugin and elementor pro in the sandbox environment below so i can test if everything works, please?

hidden link

Thanks and let me know when you do.

April 9, 2019 at 7:20 am #3563451

maglottf

Hello, i have just installed the plugins

April 10, 2019 at 11:56 am #3575749

Alejandro
Supporter

Languages: English (English ) Spanish (Español ) Italian (Italiano )

Timezone: Europe/Rome (GMT+02:00)

Hello,

Unfortunately i didn't succeed with the registration of these widgets, and in facet i see that these 2 that you mention are 2 of the few that are still not registered by the author either (and probably because its complexity) so i want to tell you that i escalated the ticket so one of our devs can take a look at it.

I'll be working with him to make sure we get this working.

Sorry for the delay and thanks in advance for your patience. I'll let you know as soon as we get the widget working so you can also give the result to the plugin author itself.

Regards.

April 16, 2019 at 6:50 am #3618549

Alejandro
Supporter

Languages: English (English ) Spanish (Español ) Italian (Italiano )

Timezone: Europe/Rome (GMT+02:00)

Hello,

Please add this to your functions.php file:

add_action('init', function (){
    add_filter( 'wpml_elementor_widgets_to_translate', 'wpml_translate_widget_wpmlsupp_6506' );
});
/**
 * Translate Animated Heading by BDThemes
 * @param array $widgets
 * @return array
 */
function wpml_translate_widget_wpmlsupp_6506($widgets) {
    $widgets['pp-table'] = array(
    'conditions' => array('widgetType' => 'pp-table'),
    'fields' => array(),
    'integration-class' => array(
        'WPMLPowerPackElementsTableHeaders',
        'WPMLPowerPackElementsTableBody',
        'WPMLPowerPackElementsTableFooter'
        )
    );
    
    $widgets['pp-card-slider'] = array(
    'conditions' => array('widgetType' => 'pp-card-slider'),
    'fields' => array(),
    'integration-class' => 'WPMLPowerPackElementsCardSlider'
    );
    
    return $widgets;
}


class WPMLPowerPackElementsTableHeaders extends WPML_Elementor_Module_With_Items{
        /**
     * @return string
     */
    public function get_items_field() {
        return 'table_headers';
    }

    /**
     * @return array
     */
    public function get_fields() {
        return array( 'table_header_col' );
    }

    /**
     * @param string $field
     *
     * @return string
     */
    protected function get_title( $field ) {
        return esc_html__( 'Header Column', 'sitepress' );
    }

    /**
     * @param string $field
     *
     * @return string
     */
    protected function get_editor_type( $field ) {
        return 'LINE';
    }
}

class WPMLPowerPackElementsTableBody extends WPML_Elementor_Module_With_Items{
        /**
     * @return string
     */
    public function get_items_field() {
        return 'table_body_content';
    }

    /**
     * @return array
     */
    public function get_fields() {
        return array( 'cell_text' );
    }

    /**
     * @param string $field
     *
     * @return string
     */
    protected function get_title( $field ) {
        return esc_html__( 'Body Cell Text', 'sitepress' );
    }

    /**
     * @param string $field
     *
     * @return string
     */
    protected function get_editor_type( $field ) {
        return 'LINE';
    }
}

class WPMLPowerPackElementsTableFooter extends WPML_Elementor_Module_With_Items{
        /**
     * @return string
     */
    public function get_items_field() {
        return 'table_footer_content';
    }

    /**
     * @return array
     */
    public function get_fields() {
        return array( 'cell_text' );
    }

    /**
     * @param string $field
     *
     * @return string
     */
    protected function get_title( $field ) {
        return esc_html__( 'Footer Cell Text', 'sitepress' );
    }

    /**
     * @param string $field
     *
     * @return string
     */
    protected function get_editor_type( $field ) {
        return 'LINE';
    }
}

class WPMLPowerPackElementsCardSlider extends WPML_Elementor_Module_With_Items{
        /**
     * @return string
     */
    public function get_items_field() {
        return 'items';
    }

    /**
     * @return array
     */
    public function get_fields() {
        return array( 'card_date', 'card_title', 'card_content' );
    }

    /**
     * @param string $field
     *
     * @return string
     */
    protected function get_title( $field ) {
        switch( $field ) {
            case 'card_date':
                return esc_html__( 'Card Date', 'sitepress' );

            case 'card_title':
                return esc_html__( 'Card Title', 'sitepress' );
                
            case 'card_content':
                return esc_html__( 'Card Content', 'sitepress' );

            default:
                return '';
        }
    }

    /**
     * @param string $field
     *
     * @return string
     */
    protected function get_editor_type( $field ) {
        switch( $field ) {
            case 'card_date':
                return 'LINE';

            case 'card_title':
                return 'LINE';
                
            case 'card_content':
                return 'VISUAL';

            default:
                return '';
        }
    }
}

Then go to the page that contains these elements and ad a character to the title(or you can also add a widget in the page or edit the body)

update the page and you will see a rotating arrow icon on the languages you can translate. you should see them, then.

Thanks in advance for the patience. we have already contacted the author of the powerpack plugin and we are asking them to please add this compatibility to it.

Regards.