Skip Navigation

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 2 voices.

Last updated by Mateus Getulio 1 year, 7 months ago.

Assisted by: Mateus Getulio.

Author Posts
July 10, 2023 at 3:21 pm #14007707

jamesG-38

I am trying to:
Via the services page in a non-english languages. The original page is hidden link

Link to a page where the issue can be seen:
hidden link

I expected to see:
Images as per the original page. I do not want to translate the images, but instead see them as originals (as no text is contained within them).

Instead, I got:
Broken image links.

Screenshot 2023-07-10 at 17.05.20.png
July 10, 2023 at 8:22 pm #14009275

Mateus Getulio
Supporter

Languages: English (English ) Portuguese (Brazil) (Português )

Timezone: America/Sao_Paulo (GMT-03:00)

Hey there,

Thank you for contacting our support.

Did those images get added to the product categories before activating the WPML plugins? If so, please try to follow the below steps to see if it helps:

- Navigate to WPML > Settings > Custom Term Meta Translation > Set the “thumbnail_id” to “Copy” and save the changes.
- Re-save the permalink settings in the admin area > Settings > Permalinks.
- Edit one of the categories, for example “Body Therapies” > Make any small change to it and click on “Save” > then update the translations.

If the issue persists after that, I would like to request temporary access (wp-admin and FTP) to your site to take better look at the issue. You will find the needed fields for this below the comment area when you log in to leave your next reply. The information you will enter is private which means only you and I can see and have access to it.

Our Debugging Procedures

I will be checking various settings in the backend to see if the issue can be resolved. Although I won't be making changes that affect the live site, it is still good practice to backup the site before providing us access. In the event that we do need to debug the site further, I will duplicate the site and work in a separate, local development environment to avoid affecting the live site.

Privacy and Security Policy

We have strict policies regarding privacy and access to your information. Please see:
https://wpml.org/purchase/support-policy/privacy-and-security-when-providing-debug-information-for-support/

**IMPORTANT**

- Please make a backup of site files and database before providing us access.
- If you do not see the wp-admin/FTP fields this means your post & website login details will be made PUBLIC. DO NOT post your website details unless you see the required wp-admin/FTP fields. If you do not, please ask me to enable the private box. The private box looks like this: hidden link

Please, let me know if you need any additional details. Have a nice day.

July 11, 2023 at 8:37 pm #14018047

Mateus Getulio
Supporter

Languages: English (English ) Portuguese (Brazil) (Português )

Timezone: America/Sao_Paulo (GMT-03:00)

Hey there,

I was able to get the images to show by following this procedure:

- Go to WPML -> Settings -> Custom Term Meta Translation
- Set thumbnail_id to 'Copy'
- Edit one of the categories in English(ie: add a space to the description)
- Edit the translation(just enter it and save as it is)

I did that for two services in French and I'm able to see their images: hidden link

The same needs to be done for the other services and languages.

There's still one issue, I'm unable to locate that icon that goes with each category, are those set in the categories or directly in the archive template?

Also, did you perform any changes on the language switcher? It is not working for me currently.

Thank you, please let us know.

July 12, 2023 at 4:54 am #14018661

jamesG-38

Hi Mateus, thanks for showing how this works for two services, but why is this necessary? It is really quite some effort to do this for the remaining services and languages (i.e. 5 languages x 7 services each) and my expectation is that this just would have worked with WPML vs. considerable unplanned effort.

Re the icon I am not sure where they are - will check.

Re language switcher - yes we have an open caching as WPML confirmed it is not an issue on their side, I have raised it with Cloudways and WPRocket.

BR, James

July 12, 2023 at 12:16 pm #14023917

Mateus Getulio
Supporter

Languages: English (English ) Portuguese (Brazil) (Português )

Timezone: America/Sao_Paulo (GMT-03:00)

Hey there,

The issue was that when those translation were created the setting was incorrect, so it's necessary to fix it.

For new translations this should not be an issue.

I was able to apply that fix in bulk, please check: hidden link

You can translate those labels now by going to WPML -> String Translation and searching for them. eg.: Find a Session, Learn more.

If you need anything else don't hesitate to contact us.

Best,

Mateus

July 12, 2023 at 3:19 pm #14026511

jamesG-38

Hi Mateus,

Thanks. Good news. Did you change a setting then so new translation are not an issue?

Re icons. Refer attached 2 images. The reason they are not loaded is because we have some code that relies on the category slug to retrieve them from the WP media library. Is there an easy to:

1) Change the category slugs to use the English slug (not a translated form)?

This would immediately allow our code to work AND not require the images to be duplicated for no reason.

2) Assure if (1) is achieved that category slugs in another language only ever use the English slug? (and therefore avoid duplicating images where there is no need as no language variation exists).

BR, James

Screenshot 2023-07-12 at 17.18.20.png
Screenshot 2023-07-12 at 17.18.52.png
July 13, 2023 at 5:49 pm #14035515

Mateus Getulio
Supporter

Languages: English (English ) Portuguese (Brazil) (Português )

Timezone: America/Sao_Paulo (GMT-03:00)

Hey there,

That's correct, I set the image field as 'Copy', meaning it will be passed from the original language to the secondary language whenever you translate a new record. I also corrected it for the old posts.

With regard to the icons, I'm afraid that would require some custom code. What you could do in this situation, is to retrieve the ID of the original post and then get the English slug and load the right icon even when you're looping in the secondary language.

Please check our hooks page:
https://wpml.org/documentation/support/wpml-coding-api/wpml-hooks-reference/#hook-605645

This one might be what you're looking for: https://wpml.org/wpml-hook/wpml_object_id/

The 'get_the_id()' can get the ID of a post in the original or secondary language. With the info from the original language post, you can adapt that function to load the icon using the English slug without having to duplicate the media.

Please have in mind that giving support to custom code is out of the scope of this forum. The hints I shared could point you in the right direction, but we can't create, debug or modify custom code for you and it's your responsibility to maintain it.

If you are not able to accomplish this, you could also try to hire a WPML contractor (https://wpml.org/contractors/)

Kind regards,
Mateus