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.

Our next available supporter will start replying to tickets in about 6.43 hours from now. Thank you for your understanding.

This topic contains 10 replies, has 2 voices.

Last updated by Yvette 1 month, 1 week ago.

Assigned support staff: Yvette.

Author Posts
January 31, 2020 at 10:26 am #5398145

ahmedN-13

Tell us what you are trying to do?hello,

the advanced transelation is ok now, however I can't find the words on the page and getting error

Warning: mysqli_real_escape_string(): Couldn't fetch mysqli in /home/customer/www/a7snse3r.com/public_html/wp-includes/wp-db.php on line 1165

Warning: mysqli_free_result(): Couldn't fetch mysqli_result in /home/customer/www/a7snse3r.com/public_html/wp-includes/wp-db.php on line 1570

Warning: mysqli_more_results(): Couldn't fetch mysqli in /home/customer/www/a7snse3r.com/public_html/wp-includes/wp-db.php on line 1579

Warning: mysqli_query(): Couldn't fetch mysqli in /home/customer/www/a7snse3r.com/public_html/wp-includes/wp-db.php on line 2030

Warning: mysqli_errno(): Couldn't fetch mysqli in /home/customer/www/a7snse3r.com/public_html/wp-includes/wp-db.php on line 1925

Warning: mysqli_error(): Couldn't fetch mysqli in /home/customer/www/a7snse3r.com/public_html/wp-includes/wp-db.php on line 1952

Warning: mysqli_real_escape_string(): Couldn't fetch mysqli in /home/customer/www/a7snse3r.com/public_html/wp-includes/wp-db.php on line 1165

Warning: mysqli_query(): Couldn't fetch mysqli in /home/customer/www/a7snse3r.com/public_html/wp-includes/wp-db.php on line 2030

Warning: mysqli_errno(): Couldn't fetch mysqli in /home/customer/www/a7snse3r.com/public_html/wp-includes/wp-db.php on line 1925

Warning: mysqli_error(): Couldn't fetch mysqli in /home/customer/www/a7snse3r.com/public_html/wp-includes/wp-db.php on line 1952

Is there any documentation that you are following?

Is there a similar example that we can see?

What is the link to your site?

January 31, 2020 at 2:02 pm #5399769

Yvette
Supporter

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

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

Hello

1. Is this happening with this one page or is this a general problem with all existing pages?

2. Does the error happen only inside the ATE?

2. Temporary Access to your system
Please provide access to your system (wp-admin and ftp) so that I can further investigate this particular problem. The fields to provide this data are included in a private section that I will open for your next response. You can find it above the comments area. The information in this private section is only visible between WPML Support and you.

February 7, 2020 at 1:32 pm #5447721

Yvette
Supporter

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

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

Hello
You wrote: "..the issue is happening to different pages"

Please send me the names or page ids of at least 2 exxamples.

Thanks

February 7, 2020 at 3:59 pm #5449011

ahmedN-13

Home Page
About Us

only the page name appear in translation , however contents not

February 10, 2020 at 11:13 am #5460831

Yvette
Supporter

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

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

Hello

Well, you need to translate the content using the WPML Translation Editor. Currently you are have configured you site to use the Advanced Translation Editor which has the ability to offer you machine translation option.

But, you still have to generate the translated content. If you want machine translation, you need to buy words.

To show you that the system is working ok, I comleted the "About Us" page translation and you can see that it appears as expected.

I hope this answers your concern about why translated content is blank.

February 10, 2020 at 12:02 pm #5461521

ahmedN-13

Could you please check the Home page

As no content there

Thanks

February 10, 2020 at 2:18 pm #5462489

Yvette
Supporter

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

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

OK.

You are using custom pagebuilder shortcodes that are not included in the standard support for Visual Composer.

For the Translation Editor to recognise the various values, I added the following XML in the WPML > Settings > Custom XML Configuration tab as per this article:
https://wpml.org/documentation/support/language-configuration-files/#page-builder-content

Please review the article carefully as you may have to add or modify more shortcodes later.

<wpml-config>
    <shortcodes>
        <shortcode>
            <tag>search_hero2_short_base</tag>
            <attributes>
                <attribute encoding="urlencoded_json">cats</attribute>
                <attribute>section_title</attribute>
                <attribute>sub_title</attribute>
                <attribute>sbtn_text</attribute>
                <attribute>block_text</attribute>
                <attribute>section_description</attribute>
            </attributes>
        </shortcode>
        <shortcode>
            <tag>grid_modern_type_short_base</tag>
            <attributes>
                <attribute>cat_section_title</attribute>
                <attribute>ads_section_title</attribute>
                <attribute encoding="urlencoded_json">cats</attribute>
                <attribute>no_of_ads</attribute>
            </attributes>
        </shortcode>
        <shortcode>
            <tag>location_short_base</tag>
            <attributes>
                <attribute>section_description</attribute>
                <attribute>section_title</attribute>
            </attributes>
        </shortcode>
    </shortcodes>
</wpml-config>

You will now see that the texts are available for translation but the categories that need to be translated arestill in URL encoded format. To see this information in a readable format that you can transalte, you can do one of the following things:

Option 1.
Try adding this code to the functions.php 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 ) {
		$original_string = str_replace( array( '%22', '%92', '%91', '%93' ), array( '"', '\\', '[', ']' ), $original_string );
		$rows = json_decode( html_entity_decode(urldecode( $original_string )), true );
		$string = array();
		foreach ( $rows as $i => $row ) {
			foreach ( $row as $key => $value ) {
				if ( in_array( $key, array( 'value' ) ) ) {
					$string[ $key . '_' . $i ] = array( 'value' => $value, 'translate' => true );
				} else {
					$string[ $key . '_' . $i ] = array( 'value' => $value, 'translate' => false );
				}
			}
		}
	}
	return $string;
}

-- OR --

If you don´t want to create a child theme or if it does not work for any reason, you can also do the following steps to translate the values:

a) copy the URLencoded values in English
b) past them into this online decoding/encoding tool
hidden link
c) modify the category ids for the translated AR categories
d) use the same online tool to encode the string with new categories
e) paste these into the WPML Translation Editor and save

I hope this gets you on your way to translating your HomePage.

February 10, 2020 at 5:01 pm #5463619

ahmedN-13

Sorry Dear,

I checked the home Page but still a lot of paragraphs are not shown, also for Login , register and FAQ's Pages

please I need permanent solution

also for the category point I didn't understand as I am not a developer

thanks for your support

February 11, 2020 at 8:11 am #5466951

Yvette
Supporter

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

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

Hello

1. "Permanent solution"
The shortcodes you are attempting to use are not officially supported by WPML "out of the box"

You are using "custom" visual composer shortcodes that you or your theme/plugin support can add as per this documentation:
https://wpml.org/documentation/support/maintaining-wpbakery-page-builder-compatibility-with-wpml/

The standard list of supported shortcodes can be found here:
https://wpml.org/documentation/plugins-compatibility/how-to-build-multilingual-sites-with-wpbakery-page-builder-and-wpml/#supported-modules

I can help you do this, but I cannot do ALL of the work as I have to distribute my time between many clients. As this theme is not completely compatible with WPML, then the normal channel of support would be for me to send your issue to our compatibility team for them to do the work with the collaboration of the theme support team...and this can take even longer.

So, to help you, I ask you to do the following steps:

1.1- Read the reference on how to add support for your shortcodes carefully
https://wpml.org/documentation/support/maintaining-wpbakery-page-builder-compatibility-with-wpml/

1.2 - Make a list of shortcodes that you need to add WPML support for

1.3 - Create a sample post/page that has these shortcodes so that we have a model to look at

1.4 - Write back with the list of shortcodes and the name of the page you have created with them.

2. Category Encoding
I gave you 2 options. The 2nd option does not require any coding skills but you do have to understand how to cut&paste what you see into an online decoder/encoder tool for the URL format

Have you tried this?

ALTERNATIVELY, you can also just not use the WPML Tranlsation Editor and use the normal Visual Composer interface to change the required texts in your translated page.

Kind regards.

February 24, 2020 at 7:40 am #5551823

ahmedN-13

hello again,

I have received this announcement today hidden link

should this fix my problem

thanks

February 24, 2020 at 2:29 pm #5555305

Yvette
Supporter

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

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

My understanding is that you have shortcodes that are not being recognised by the Translation Editor.

This announcement is specifically about links that link to external sources. This is not your case. we were able to register your category URLs, but you need to decode/encode them manually during translation.

The topic ‘[Closed] Advanced translation editor’ is closed to new replies.