Skip to content Skip to sidebar

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

Problem:
How to update the root language of a string in WPML after it has been changed in the theme? The changes are visible on the page but not reflected in the WPML String Translation.

Solution:
1. Navigate to WPML -> String Translation.
2. Scroll down to the "Auto register strings for translation" section.
3. Enable the "Look for strings while pages are rendered" option.
4. Visit the page where the strings are visible on the front end.
5. Disable the "Look for strings while pages are rendered" option.
6. Search for the updated strings in the String Translation interface.

If this solution doesn't seem relevant to your situation, please open a new support ticket here.

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

Last updated by Osama Mersal 1 year, 7 months ago.

Assisted by: Osama Mersal.

Author Posts
November 20, 2023 at 10:38 am #14875259

Peter Pro

How to change the root language of a string in the WPML as well after it was changes in the theme already? I changed some strings in the theme and it workded out in the page immidiately - all the changes done in the theme were displayed in the page.

I changed some strings in the test page and it worked out in the page, the things in the page got changed immidiately. But in the WPML string translation thy didn't change. Here are the screenshots from the page what the clients see and the WPML string translation. For example in picture 1 there is now "publish your ad" (which is a new string I just adjusted), but in the WPML string translation there is still written "send the ad away" (the last one you see in the screenshot), which was the old version. And the first thing you see in WPML is the "Back to the classifieds page", which in the homepage is changed to "Back to the homepage" like you can see from the picture 2. So the only issue now: how to change the string in the WPML as well?

WPML string translation.png
page 2.png
page 1.png
November 21, 2023 at 7:58 am #14882703

Peter Pro

Is anyone here?

November 21, 2023 at 8:16 am #14882883

Osama Mersal
WPML Supporter since 02/2020

Languages: English (English ) Arabic (العربية )

Timezone: Africa/Cairo (GMT+03:00)

Hi,

Thanks for contacting WPML forums support. I'll be glad to help you today.

1) Please check the following steps:

1- Go to WPML-> String Translation
2- Scroll down to the "Auto register strings for translation" section
3- Enable the "Look for strings while pages are rendered" option
4- Visit the page where you can see the strings on the front end
5- Disable the option
6- Search for the strings

Kindly let me know if the above steps helped you find the new strings.

2) Could you please share your Debug information with me?
You can read a detailed explanation about it here. (http://wpml.org/faq/provide-debug-information-faster-support)
The debug info will give me much information about how your site is configured.

Best regards,
Osama

November 21, 2023 at 8:04 pm #14890823

Peter Pro

Great, thanks, it works. But the only thing that instead of changing the string text, it creates a new string. In the theme I change the existing string text, I don't create a new string. So I'd expect that in the WPML it does the same: just changes the text of the string. But here it creates a new string and there is no Spanish translation any more.

My page is in EN and ES. The EN is the source language of a string and these strings are translates into Spanish. Now when I change the source, then it would be nice if the text changes in WPML in the same place where it already was and the Spanish translation will stay in tact as well. But at the moment it creates a totally new string where the Spanish translation is not available. Is there a way to avoid that?

Debug is added

November 22, 2023 at 7:57 am #14893301

Osama Mersal
WPML Supporter since 02/2020

Languages: English (English ) Arabic (العربية )

Timezone: Africa/Cairo (GMT+03:00)

Hi,

1) I'm afraid that this is how String Translation works. When you change the string in the theme, it's registered as a new string, and you need to translate it.

2) It's unrelated to the issue, but according to your Debug.info, the WP memory limit needs to be increased. PHP memory is fine, but WordPress uses 40Mb as default. The minimum requirements for WPML are 128 MB. (Kindly check this page https://wpml.org/home/minimum-requirements/)

You can increase it by adding the following code in your wp-config.php file right before the /* That's all, stop editing! Happy publishing. */ line:

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

Best regards,
Osama

November 22, 2023 at 8:16 am #14893489

Peter Pro

Great, thanks. But can you tell me as well, in case of the tehe Sage 10.7.0, the wp-config.php file is located where? In the attached screenshot 3 you see the file structure of the theme file editor.

And then one more question, concerning when the new strings will come into being. In the screenshot 1 you see the WPML string translation section like it normally is in case of my page: the source language (written in the theme) is EN, and the translated language is ES. But in the screenshot 2 you see the pictufe after editing the theme file, the new strings came into being, but the flag of the source language has been changed to the Estonian. Why is it like that? The reason might well be that the source language of the string earlier was Estonian, and later we changed it to English. And maybe smt. stayed unchanged - can you tell me what it is? To stop that the new strings will "born" Estonian.

How to change it at the moment I know, I need to select these strings and then below choose the "change the language of the selected string". But still it's annoying. So a solution would be needed to stop creating automatically the Estonian strings.

Thanks in advance

3.png
2.png
1.png
November 22, 2023 at 8:25 am #14893595

Osama Mersal
WPML Supporter since 02/2020

Languages: English (English ) Arabic (العربية )

Timezone: Africa/Cairo (GMT+03:00)

Hi,

1) The "wp-config.php" file is located in your site's root folder.

2) You can change the source language for the entire text-domain to English. (Kindly check the attached screenshot)

Best regards,
Osama

2023-11-22_10-22-31.jpg
November 22, 2023 at 8:39 am #14893729

Peter Pro

Great, thanks, the 2) is done

But concerning the wp-config.php file - then wehere should the root folder be?

November 22, 2023 at 8:43 am #14893735

Osama Mersal
WPML Supporter since 02/2020

Languages: English (English ) Arabic (العربية )

Timezone: Africa/Cairo (GMT+03:00)

Hi,

If you are using FTP access, it should be inside the Public folder. If you can't find it, please get in touch with your host support team to locate it for you.

Best regards,
Osama

November 22, 2023 at 1:31 pm #14898167

Peter Pro

OK, but one more question concerning the languages which are there but are not used at the moment. Here is the picture from my site at the moment. The EN and ES are active languages and additionally there are more some languages, which are not active at the moment. But soon they will be if I copy the site to other domains. But I would like that only the string translation part of these pages will stay. But there probably are more things, the SEO texts as well I believe - how to delete it? I mean to delete everything, except the string translation texts?

Screenshot 2023-11-22 at 15.27.45.png
November 22, 2023 at 1:36 pm #14898311

Osama Mersal
WPML Supporter since 02/2020

Languages: English (English ) Arabic (العربية )

Timezone: Africa/Cairo (GMT+03:00)

Hi,

If you delete these languages, that will delete everything related to these languages. Kindly check this guide. (https://wpml.org/faq/how-to-completely-remove-a-language-from-your-site/)

In our forum, we try to keep one issue per ticket. As the original issue is resolved, may I kindly ask you to open a new ticket for your additional question?

Continuing with one ticket per issue helps supporters focus on one issue at once and enables other users to find solutions to their questions faster.

Thanks for your understanding

Best regards,
Osama