Issue with string duplication when fixing translations in Moodle

Issue with string duplication when fixing translations in Moodle

Kraus Eduardo發表於
Number of replies: 8

Hi everyone!

Yesterday, I created a script to detect incorrectly formatted string keys, like {$ a} (with unnecessary spaces), and to fix translations of keys such as {$a->fullname} => {$a->nome_completo}. I was working with several translations, including German, which my wife is fluent in.

The issue I'm facing is this: when I upload the strings with errors and use the translation editor in Moodle to fix them, the strings get duplicated in the process.

Has anyone experienced this before? Is there a way to prevent this duplication when editing translations?

Thanks for any help!

In reply to Kraus Eduardo

Re: Issue with string duplication when fixing translations in Moodle

roggemans koen發表於
Language pack maintainers的相片

They get fixed in 2 different versions, not duplicated ...

In reply to roggemans koen

Re: Issue with string duplication when fixing translations in Moodle

Kraus Eduardo發表於
However, this only manifests when uploading.
In reply to Kraus Eduardo

Re: Issue with string duplication when fixing translations in Moodle

roggemans koen發表於
Language pack maintainers的相片
I see.
If I describe what I see:
You upload a file with errors to 4.5
You correct the strings in the stage
The result is that the corrections go to 4.2 and the original file with errors goes to 4.5

Does that summarize the events?
In reply to roggemans koen

Re: Issue with string duplication when fixing translations in Moodle

Kraus Eduardo發表於

I conducted a test and noticed that it only works when importing in the same string version.

In the example below, I uploaded it in version 4.2, and the backpackexporterrorwithinfo error was not duplicated. But if I upload it in version 4.5, the fix will only apply to versions between 4.2 and 4.4, and not to 4.5. Is that correct?

Captura%20de%20Tela%202024-09-17%20a%CC%80s%2008.42.10.png

In reply to Kraus Eduardo

Re: Issue with string duplication when fixing translations in Moodle

Krause Ralf發表於
Language pack maintainers的相片

Thank you, Eduardo!

Because I like your idea so much, I downloaded your corrections from your submission and re-uploaded them for all versions 4.0, 4.1, 4.2, 4.3 and 4.4. I found that I got corrections with each upload. So I am sure that the corrections really apply to all Moodle 4.x. Originally, your corrections were only uploaded for Moodle 4.5. 

I'm not sure if I could have made it easier, because on the page https://lang.moodle.org/local/amos/stage.php I can only select one version at a time. 

Best regards 
Ralf

In reply to Krause Ralf

Re: Issue with string duplication when fixing translations in Moodle

Kraus Eduardo發表於
In AMOS, it is necessary to select the "Components" option. Then, for each string, I need to change the "String identifier," click on "Show Strings," and make the modification.

In the specific case I sent, this would need to be done "only" 33 times.
In reply to Kraus Eduardo

Re: Issue with string duplication when fixing translations in Moodle

Krause Ralf發表於
Language pack maintainers的相片

Hi Eduardo,

I downloaded your translated strings from AMOS … and yes, I got a zip file containing a folder 4.5 and inside a folder de. Inside this folder I found 33 files. I could zip these 33 file to a file Archiv.zip and I could upload this one file. So I must upload the zip four times do get all strings into 4.1, 4.2, 4.3 and 4.4.

No, I could not upload the file I got from AMOS directly because the zip file contains a folder and inside another folder. The AMOS zip upload wants to get a flat zip without any folder inside.

Best regards,
Ralf

In reply to Kraus Eduardo

Re: Issue with string duplication when fixing translations in Moodle

Kraus Eduardo發表於
I uploaded to version 4.5, and Ralf Krause had to download and send the files for versions 4.0, 4.1, 4.2, 4.3, and 4.4.

When using the AMOS Translator, it is sent to all versions. It would be helpful to include the option to select "any version" in the upload, in order to avoid rework.

https://lang.moodle.org/local/amos/contrib.php?id=56072