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.

Tagged: 

This topic contains 14 replies, has 2 voices.

Last updated by Nigel 1 year, 2 months ago.

Assisted by: Nigel.

Author Posts
October 10, 2023 at 9:20 am #14547953

lasseC-2

Tell us what you are trying to do?
A few weeks ago the original string language was English now it changed to German?

Our customer said they worked on the website a few weeks ago. At that time it was, as an example, "English to Danish" but now it has changed to "German to English".

-->We want to change it all back to strings from English to the other languages without having to open every single translation manually.

Is there any documentation that you are following?
No

Is there a similar example that we can see?
Image

What is the link to your site?
hidden link

Thank you in advance

German language.png
October 10, 2023 at 11:52 am #14549629

Nigel
Supporter

Timezone: Europe/Madrid (GMT+01:00)

Hi there

Thanks for sharing your debug info along with your question.

That allows me to see that your site default language is still English. (You can verify that in the back end by going to WPML > Languages.)

So the screenshot you shared of the translation editor which shows the source language as German simply indicates that this particular post was first published in German, and so when any translations are added they will be from German. (Even if you published the post in German, then translated it to the default language English, and subsequent translations to other languages will be from German, not from English.)

I suggest in the back end you check from the language switcher in the admin toolbar that you are set to English. Then add a new test post (which will be in English). Then try add a translation to German. Now translate to a third language like French: the translation editor should show it being translated from English.

October 13, 2023 at 6:47 am #14569941

lasseC-2

"That allows me to see that your site default language is still English. (You can verify that in the back end by going to WPML > Languages.)"

That’s correct – from the very beginning the language on the website was Danish but shortly after it was changed to english.

"So the screenshot you shared of the translation editor which shows the source language as German simply indicates that this particular post was first published in German, and so when any translations are added they will be from German. (Even if you published the post in German, then translated it to the default language English, and subsequent translations to other languages will be from German, not from English.)"

Well – this isn’t the case. After the different languages were translated from the source language english to e.g. italian or spanish, the german content was changed manually afterwards (translation and layout needed to be different from the rest of the languages).
This makes it very important not to be from german, since the strings won’t fit the other translations.

"I suggest in the back end you check from the language switcher in the admin toolbar that you are set to English. Then add a new test post (which will be in English). Then try add a translation to German. Now translate to a third language like French: the translation editor should show it being translated from English."

The pages were already added being English at first and then translations were added subsequently.

I already know that it’s possible to manually change every single translation back by editing each page and changing “This is a translation of” to none and then switching it the correct language. The question is why it suddenly changed to German? And is it possible to switch all pages back to the English source language at once?

Do you need login credentials to inspect?

October 13, 2023 at 7:54 am #14570531

Nigel
Supporter

Timezone: Europe/Madrid (GMT+01:00)

Let me get credentials from you, then, and I can try to make sense of the content in different languages and how they are connected.

Can you give me some examples of specific posts that have translations to check? How many posts are we talking about where the source language appears to be German rather than the expected English?

And to confirm the steps. Content was posted in English. It was translated to other languages, including German? And then the German translation was edited with the WordPress editor, overwriting the translation that had been made in the translation editor?

I've set a private reply. Please make sure you have a current backup.

October 13, 2023 at 12:38 pm #14573155

Nigel
Supporter

Timezone: Europe/Madrid (GMT+01:00)

Thanks. I've been looking into the details of the site.

It's certainly the case that according to the database the original version of the Innovations page was German and that the other languages were translated from German. But I can tell from opening another translation (e.g. French) in the translation editor that there is no translation memory of translating from German, whereas if I make some changes to the database so that it appears as if the original post was English and re-open the French translation in ATE, it does have translation memory of those texts.

I'm still looking into this and seeking some feedback from colleagues, but be aware I may be making changes to the language settings relating to that Inspiration page in particular.

October 13, 2023 at 1:28 pm #14573741

Nigel
Supporter

Timezone: Europe/Madrid (GMT+01:00)

So, where we are at:

I can't account for why German is recorded as the source language for much of the content if it wasn't originally, I don't have a detailed log of everything that has happened on the site in the past to be able to say why.

With the current situation as the starting point, all I can do is to try and make it possible to bulk change the language information for the content (so that English is marked as the source language and German is just one of the other translations).

Probably the best way to do that is writing a PHP script that utilises the WPML API.

Before I start with that, what content types does this need to handle? Pages, yes. Posts, no (there are none on the site).

I don't see any other content types on your site where this might apply, so, just Pages, I think.

I'll work on a script, but I won't run it without contacting you again.

October 16, 2023 at 1:12 pm #14585257

Nigel
Supporter

Timezone: Europe/Madrid (GMT+01:00)

I've tested a script on my own site which I prepared for this task, and am ready to try it on yours.

You will certainly need a backup in case it doesn't work as intended on a real site.

When you are ready for me to apply the script, let me know.

October 20, 2023 at 12:02 pm #14623119

lasseC-2

Hi Nigel,

I just took a backup just now. It should be ready for your script now.

October 23, 2023 at 7:14 am #14633397

Nigel
Supporter

Timezone: Europe/Madrid (GMT+01:00)

OK, I've run the script, and checking the results it appears to me that it has worked as intended, and the source language of pages is reset to English.

If you could you please check yourself and confirm everything is as expected.

Thanks.

October 23, 2023 at 9:26 am #14635079

lasseC-2

Hi Nigel,

I just checked the results and for the most pages the original language is set to english but the strings below are german (or danish) and some are also correct.

I tested 3 different pages below as examples.

/inspiration:
translation to danish: still german original language and german strings
translation to french: Correct
translation to german: Correct
translation to italian: Original english - strings in danish
translation to polish: Original english - strings in danish
translation to spanish: Original english - strings in danish

/design-panels:
translation to danish: English original language and german strings
translation to french: Correct
translation to german: Correct
translation to italian: Original english - strings in danish
translation to polish: Original english - strings in danish
translation to spanish: Original english - strings in danish

/professional:
translation to danish: English original language and german strings
translation to french: Correct
translation to german: Correct
translation to italian: Original english - strings in danish
translation to polish: Original english - strings in danish
translation to spanish: Original english - strings in danish

It seems english to french and english to german is working as it should but still trouble with
Danish, Italian, Polish and Spanish

Design Panels german title and strings.png
Inspiration - german as original.png
October 23, 2023 at 1:37 pm #14638479

Nigel
Supporter

Timezone: Europe/Madrid (GMT+01:00)

It looks like the problem is that there are existing incomplete translation jobs for some of the pages being translated to some languages.

To take just the first example from you last reply, translating the Inspiration page to Danish.

When I opened the Danish translation in the ATE translating editor, it still showed the source text as being German, not English.

But that's because the translation job was created when German was marked as the source language for pages, and it had not been completed.

You can see in my screenshot the existing translation job (from WPML > Translation Management > Jobs).

I deleted it, but that wasn't enough on its own. I also needed to make a minor edit to the original English page, save it, and then re-open the translation. You can see English is now considered the source language in my second screenshot.

(Note, a "minor edit" would normally mean just adding a space somewhere in the text and updating, but in your case as you are using a page builder I found it easiest just to save the translation priority to something different and then save it back again.)

Screenshot 2023-10-23 at 14.30.49.png
Screenshot 2023-10-23 at 14.27.14.png
October 24, 2023 at 6:51 am #14642573

lasseC-2

Thank you, that works perfectly on the inspiration page.

In translations for e.g. panels/design-panels/ (image attached) and many of the other pages, the original language is English but the title and the strings on both sides are German. The title should be English and the strings in the image example English-->Danish?

Design panels showing as english but title and strings in german.png
October 24, 2023 at 3:04 pm #14649145

Nigel
Supporter

Timezone: Europe/Madrid (GMT+01:00)

That seems to be a similar problem: the translation job was created when there was something wrong with your site, and what is shown in the translation editor is the state of the texts at the time the translation job was created.

I solved the problem the same way as before. I went to WPML > Translation Management > Jobs and found the corresponding job (screenshot) and cancelled it.

I then made a minor change to the English original and updated, and then clicked the link to create a Danish translation (it seems there was no existing translation yet). That shows texts in their expected languages in the translation editor.

I'm sorry, I don't know how the problems came about on your site, I can just see what needs to be done to fix them.

Screenshot 2023-10-24 at 15.59.25.png
Screenshot 2023-10-24 at 15.57.33.png
October 26, 2023 at 8:42 am #14668163

lasseC-2

Hi again,
I tried your solution:

“…WPML > Translation Management > Jobs and found the corresponding job (screenshot) and cancelled it.”

It worked for the strings as you wrote - but what I hadn’t noticed before was that the pages (also /inspiration) disappeared from the menu and the translations for the different languages were gone!
I had to restore the backup from before October 23rd to get it back.

Solution:
When it comes to the pages like /design-panels, it seems the way to fix this was by opening the editor for each language and modify “This is a translation of” to “None”.
Subsequently each language is “connected” with the English version and saved.

I tried to do the same for /inspiration and it seems to work. But will take some time since every page needs to be updated ;(

I really hope you guys can work on a way to do the above process in bulk in the future.

October 27, 2023 at 11:03 am #14677937

Nigel
Supporter

Timezone: Europe/Madrid (GMT+01:00)

OK, well I'm glad you have a solution, even if it is a time-consuming one.

This isn't a common situation, as I said before it's not clear how this problem could have arisen in the first place.

I'm about to start a vacation, so I suggest we close here, and if you encounter further problems could you please open a new thread. You can link to this one if necessary to show the history.