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 4 replies, has 2 voices.

Last updated by Rohan Sadanandan 1 month ago.

Assigned support staff: Rohan Sadanandan.

Author Posts
September 20, 2019 at 5:40 am #4609907

Makarand Mane

Hi,

I want to translate hidden link links which is I added to element. I have created php with jquery code for this. I have declared the wp_footer hook for this. In that I have added below code in same function

1st one is php code:
$url = '';
if(ICL_LANGUAGE_CODE=='en') {
$url = 'the-amenities';
} else if(ICL_LANGUAGE_CODE=='ja') {
$url = 'アメニティ';
$id = '日本食';
}

& above variables I have echo in jquery like this
<script>
jQuery('#hp-japanese-food').click(function()
{ window.location="hidden link;?php echo $url; ?>/<?php if($id) {echo "#".$id."/?lang=ja"; } else { echo "#japanese-food"; } ?>" });
</script>

But when I translate homepage in Japanese language, & then I clicked on element which I set this link it redirect to default language not translated language.

September 20, 2019 at 5:58 am #4609915

Makarand Mane

I still need assistance for my issue

September 20, 2019 at 6:10 am #4609939

Rohan Sadanandan
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Hi Makarand,

The chat got disconnected.
Sorry for the inconvenience.
We can continue the discussion here.

I don't get the issue regarding this page: hidden link
Are you able to translate this page?

Also, I request you to update the WP Memory Limit to at least 128MB which is the minimum requirement for WPML: https://wpml.org/home/minimum-requirements/
Add this code to your wp-config.php to increase WP memory:

/** Memory Limit */
define('WP_MEMORY_LIMIT', '256M');
define( 'WP_MAX_MEMORY_LIMIT', '256M' );

Paste it just before:

/* That's all, stop editing! Happy publishing. */

Also, please update all the WPML plugins to the latest version.

Thanks,
Rohan

September 20, 2019 at 6:22 am #4609955

Makarand Mane

I don't get issue related English language. I want to just check from you go to this

hidden link

1) Translate this language in Japanese
2) On homepage There is "The Amenities" section
3) Click on first Japanese Food section

& then check It not redirecting in Japanese language it set to default language. When you translate English to Japanese language other's links are working properly, but when you click on #tag links it not working it set to default language.

September 20, 2019 at 7:13 am #4610123

Rohan Sadanandan
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Hello,

The issue is that you are not adding the language code to the URL.

You need to change the URL from

<em><u>hidden link</u></em>

to

<em><u>hidden link</u></em>

Thanks,
Rohan