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 6 replies, has 3 voices.

Last updated by Itamar 2 months ago.

Assigned support staff: Itamar.

Author Posts
August 1, 2019 at 11:50 am #4321233

robertR-44

Hi,

unfortunately I marked this thread as "resolved" - I ment a former one. Sorry. I need still support in this case. I spoke to marcel.
The Bridge theme comes with a module called specification list. These lists are not visible in the translation editor, except the headline, and are not beeing translated ... what can I do?

Thanx in advance for additional help,

chris

August 1, 2019 at 12:22 pm #4321399

Noman
Supporter

Languages: English (English )

Timezone: Asia/Karachi (GMT+05:00)

Hi,
Thank you for contacting WPML Support. To take a closer look on this issue, please provide temporary access (WP-Admin and FTP Login info) to your site (preferably staging site), so that I can look into your setup and debug the issue.

Your next answer will be private which means only you and I have access to it.

=== Please backup your database and website ===

✙ I would additionally need your permission to de-activate and re-activate Plugins and the Theme, and to change configurations on the site. This is also a reason the backup is really important.

✙ Please add a frontend page link/screenshot where I can see this issue.

Thank you

August 1, 2019 at 3:16 pm #4323375

Noman
Supporter

Languages: English (English )

Timezone: Asia/Karachi (GMT+05:00)

Hi,

I have followed the below steps in order to fix this issue:

1. Updated XML from WPML >> Settings >> Custom XML Configuration section:

<wpml-config>
    <shortcodes>
        <shortcode>
            <tag>qode_specification_list</tag>
            <attributes>
                <attribute encoding="allow_html_tags">title</attribute>
                <attribute type="area" encoding="urlencoded_json">values</attribute>
                <attribute type="area" encoding="urlencoded_json">list_items</attribute>
                <attribute>button_link</attribute>
                <attribute>button_text</attribute>
            </attributes>
        </shortcode>
    </shortcodes>
</wpml-config>

2. Added below code in functions.php file of your theme:

add_filter( 'wpml_pb_shortcode_encode', 'wpml_pb_shortcode_encode_urlencoded_json', 10, 3 );
function wpml_pb_shortcode_encode_urlencoded_json( $string, $encoding, $original_string ) {
    if ( 'urlencoded_json' === $encoding ) {
        $output = array();
        foreach ( $original_string as $combined_key => $value ) {
            $parts = explode( '_', $combined_key );
            $i = array_pop( $parts );
            $key = implode( '_', $parts );
            $output[ $i ][ $key ] = $value;
        }
        $string = urlencode( json_encode( $output ) );
    }
    return $string;
}
 
add_filter( 'wpml_pb_shortcode_decode', 'wpml_pb_shortcode_decode_urlencoded_json', 10, 3 );
function wpml_pb_shortcode_decode_urlencoded_json( $string, $encoding, $original_string ) {
    if ( 'urlencoded_json' === $encoding ) {
        $rows = json_decode( urldecode( $original_string ), true );
        $string = array();
        foreach ( $rows as $i => $row ) {
            foreach ( $row as $key => $value ) {
            if ( in_array( $key, array( 'text', 'title', 'features', 'substring', 'btn_text', 'label', 'value', 'y_values' ) ) ) {
                    $string[ $key . '_' . $i ] = array( 'value' => $value, 'translate' => true );
                } else {
                    $string[ $key . '_' . $i ] = array( 'value' => $value, 'translate' => false );
                }
            }
        }
    }
    return $string;
}

3. Created test page for checking ‘Specification list’ element:
hidden link

Now it showing all fields in translation editor. Could you please check and confirm?

Here is doc for more details:
https://wpml.org/documentation/support/translating-urlencoded-shortcodes/

Thank you

August 2, 2019 at 9:41 am #4328627

robertR-44

Hi ... after I have modified the functions.php, the site no longer works. I restored the original version ... 🙁
I have added the code at the end of the file ... is that ok?

August 4, 2019 at 7:58 am #4335725

Noman
Supporter

Languages: English (English )

Timezone: Asia/Karachi (GMT+05:00)

Hi,

Please make sure you have added code once at the end of functions.php file. If still issue persists, please provide me functions.php file or login details of your site where you are trying to add that code.

Thank you

August 9, 2019 at 9:26 am #4368971

robertR-44

Hi,

I added the code at the end of the Bridge-Theme functions.php again ... with the same result. (s. screenshot) ... I have no idea what to do.
Regards,
chrs

August 12, 2019 at 5:02 pm #4382551

Itamar
Supporter

Languages: English (English ) Hebrew (עברית )

Timezone: Asia/Jerusalem (GMT+03:00)

Hi.

Noman is not available today, so I'll continue to handle this ticket. I hope that it is alright with you.

Placing those functions at the end of the functions.php file is probably the correct place for them. Anyhow, when I check your site now, I can see that the functions are there and your site is up and there is no error message like before. Please see the attached screenshots.
Can you see that it is OK?
Have you fixed this issue already?

Regards,
Itamar.

The topic ‘[Closed] not resolved – Bridge theme specification lists’ is closed to new replies.