Skip Navigation

This thread is resolved. Here is a description of the problem and solution.

Problem: How to translate custom text from my theme

Solution: Wrap them around gettext functions as per WordPress standards. you can use the link below as an example of how it should look.

Relevant Documentation:
- https://wpml.org/forums/topic/translate-footer-of-my-site/#post-9861701
- https://developer.wordpress.org/themes/functionality/internationalization/

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

Last updated by herng-yueL 6 months, 3 weeks ago.

Assigned support staff: Alejandro.

Author Posts
October 27, 2021 at 9:38 am #9872323

Alejandro
Supporter

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

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

Ok, so at least we know the problem is a site specific issue.

try deleting the strings that come from the theme and run the entire procedure again with the cache turned off and previously flushed.

this will only take a minute, so your live users won't have any problem. also make sure that the server cache is flushed.

October 27, 2021 at 9:42 am #9872401

herng-yueL

Yes, I have done that before, even tried to change strings such as changing Privacy Policy to become Priivacy Policy, it is updated instantly means the cache is not the problem. Am I doing any settings wrong for my main site? Because settings are not copied.

October 27, 2021 at 10:56 am #9873033

Alejandro
Supporter

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

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

1) Can i have permission from you to add a small string to the footer and try to test it there? because i'm out of ideas of what you can try.

2) Could it be the live site is in another server or hosting from the staging site? and maybe uses a load balancer or similar?

October 27, 2021 at 12:10 pm #9873519

herng-yueL

1. Yes you may edit a small string of the footer, appearance is fine, as long as the functionality is not touched.
2. Staging and Live is hosted on a different server, with no load balancer or anything for both of the servers.

October 27, 2021 at 1:52 pm #9874637

Alejandro
Supporter

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

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

The only thing that was missing was translating the content. because of your cache, the content that you added in string translation was not really saved (even though the value is still there and was indeed saved). Add a character to the strings, save them and that's it.

You can see it in hindi and spanish where the translation for "privacy policy) is now showing correctly.

Regards.

October 27, 2021 at 1:54 pm #9874641

herng-yueL

thanks, in the future what can I do to solve this problem?

What do you mean by add a character to the strings and save them?

October 27, 2021 at 2:37 pm #9875239

Alejandro
Supporter

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

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

- Go to WPML > String translation
- Find the strings that you're looking for
- You'll notice a "+" icon on those strings. that means they have NOT been translated yet
- Open the string and add a character if it's already translated (the translation memory will kick in if you have other strings but pressing "enter" will not save it due to your cache system)
- Save the page by pressing enter
- Wait until a small notification appears saying the translation was saved.

I created a video for you as well where i did everything: hidden link

Regards.

October 27, 2021 at 3:05 pm #9875587

herng-yueL

Thank you very much for your help, I was using "Tab" to switch through so it is faster, guess it does not work.

Will let you know if I still have any issues.

Also, regarding the variation, guess I will need help on that too..

October 27, 2021 at 3:06 pm #9875595

herng-yueL

My issue is resolved now. Thank you!