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 5 replies, has 0 voices.

Last updated by Itamar 1 week, 3 days ago.

Assisted by: Itamar.

Author Posts
December 10, 2024 at 7:57 pm #16500165

bennyG

Background of the issue:
We would like to replace a single word sitewide: aluminium to aluminum. It's in the original English but also many translations. Possible also in some slugs. We fear that if we use something like Better Search & Replace it will at least make WPML forget some of the previously translated texts. Or, at worst, forget many texts and potentially break translations and pages.

Symptoms:
We fear that using a search and replace tool might make WPML forget some of the previously translated texts or break translations and pages.

Questions:
Is there a best practice to do a simple search & replace sitewide?

December 10, 2024 at 8:25 pm #16500316

Itamar
Supporter

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

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

Hi,

I don't know any best practices for using search and replace sitewide. I suggest you take a backup of your site and try it. Or better yet, try it on a copy of your site before you try it on the production site. This matter is out of the scope of our support forum. If the word "aluminium" also shows in the translations, then, to the best of my knowledge, it should also be replaced in the translation. Then, in my opinion, if you don't "touch" the wp_icl_ tables (WPML's DB tables), there should be no problem with breaking or losing the translations. I've never tried such a thing. Please do you experiments with that.

**** Important! Please make a full site backup (files and DB) before you proceed with those steps****

However, please know that WPML's Advanced Translation Editor has a great feature called "Glossary". WPML’s glossary lets you create better translations by defining how you want certain words to appear in your site’s translations. You can read about it here.

https://wpml.org/documentation/translating-your-contents/advanced-translation-editor/how-to-create-and-manage-glossary-entries/

The glossary is not a solution for what you are trying to achieve. However, it is a solution for keeping the word "aluminium" the same in the translations.

Good luck,
Itamar.

December 16, 2024 at 11:10 am #16516906

bennyG

I double checked with the team. We only need to update the term aluminium to aluminum in English and NOT update any of the translations like German or French.

My main worry is that a search & replace will make the ATE memory forget about many lines of translations. And that in the future we will need to do a small update and then see big chunks of pages being empty in the ATE, resulting in lost time and frustration. This has happened many times before and we really want to avoid it happening again.

What is the best way to approach this?

December 16, 2024 at 9:39 pm #16518992

Itamar
Supporter

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

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

Hi,

The best approach is to make an experiment to minimize risks. Don't use Search & Replace on the entire DB of your site. Manually edit one of the entries in DB where "aluminium" is present, and change it to "aluminum". Then, check if it has any implications on the translations. I suggest you do that on a copy of your site and take a backup of your site before doing that.

**** Important! Please make a full site backup (files and DB) before you proceed with those steps****

Regards,
Itamar.

December 17, 2024 at 11:01 am #16521118

bennyG

Hi Itamar,

I'm surprised (and a bit annoyed to be honest) that you don't know what to expect when we change a single word in our original text. Of course that will wipe out the translation of that sentence. I've seen it happen dozens of times and it has cost me many many hours of my life already. And will continue to do so 🙁

See the attached screenshot for clarification.
It really is an annoying shortcoming in the ATE. I suppose there is no workaround? Then I'll have to manually input our translations again (looking them up on the live site).

Greetings, Benny

wpml-alu.png
December 17, 2024 at 8:35 pm #16523475

Itamar
Supporter

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

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

Hi, Benny.

I am sorry for any inconvenience you were caused.

Indeed, it is expected that when you make a change to the original post, WPML will detect this change and trigger an update for the translation. In this case, the user will only need to update the sentence where you made the change. This is to avoid the user needing to translate the entire page again. If you don't want the translation to be updated at all, you can select the option "Minor edit" before saving/updating the page or post. Please see the attached screenshot Minor-edit.jpg.

However, you talked about using the plugin Better Search Replace. This plugin operates on the site's DB. (Based on my understanding of your need, you will run it on the wp_posts DB table.) It replaces what the user needs to replace directly in the site's DB. Thus, no update for the translations will be triggered unless you click the Save/Update button on the posts and pages. I've just tried it on my test site and can confirm this behavior. Here is a test site with WPML and Better Search Replace that you can experiment with.

hidden link

With the above link, you will be directly logged in.

Best Regards,
Itamar.

Minor-edit.jpg