No longer possible to overwrite translated strings using wlc?

Hi,

I am translating offline (using Lokalize) and have a script to sync my work
to Weblate. During my latest "translation sprint" before the release of
7.2, I realised to my annoyance that the uploaded files no longer overwrite
existing translations in case of conflicts. Meaning, if I fix a typo or
otherwise change a string that's been translated before, it no longer gets
updated to Weblate, unless I manually upload the file. The script uses wlc
to upload, basically like this:
wlc upload --overwrite --input "$local_file.po"
"$weblate_project/$weblate_component/$language"
Strings that are untranslated or fuzzy on Weblate get updated as expected.

I tried also to specify "--method translate" [1], but this made no
difference (and I've never needed that before).
Just in case, tried with "--method replace" as well, which gave me: "Error:
You do not have permission to perform this action." Looking at [1], I think
that's to be expected.

I'm not sure when was the last time it worked -- definitely before 7.1 was
released. Has something changed in the Weblate config/permissions since
then?
Is anyone else using wlc and can confirm this?

[1] https://docs.weblate.org/en/latest/user/files.html#import-methods

Thanks,
Mihkel
Estonian translator

Hi Mikhel,

I can confirm - I've tested it by changing translation of one string,
but it was refused.

I do not use wlc, I use curl. This is the result message

Result:
{"not_found":0,"skipped":3613,"accepted":0,"total":3613,"result":false,"count":3613}

Here, accepted:0 indicates that the translation was rejected.

A successful  upload of a new translation looks like this:
Result:
{"not_found":0,"skipped":197,"accepted":1,"total":318,"result":true,"count":318}

I think this is a major bug

Milos

Hi Mikhel, Milos,

Hi Mikhel,

I can confirm - I've tested it by changing translation of one string,
but it was refused.

I do not use wlc, I use curl. This is the result message

Result:
{"not_found":0,"skipped":3613,"accepted":0,"total":3613,"result":false,"count":3613}

Here, accepted:0 indicates that the translation was rejected.

A successful  upload of a new translation looks like this:
Result:
{"not_found":0,"skipped":197,"accepted":1,"total":318,"result":true,"count":318}

I think this is a major bug

Christian is currently on vacation until next week. I'll add the bug to
our meeting on the 7th, so he can have a look and let you know what has
happened.
Cheers
Sophie

Hi Milos,

Hi Mikhel,

I can confirm - I've tested it by changing translation of one string,
but it was refused.

I do not use wlc, I use curl. This is the result message

Result:
{"not_found":0,"skipped":3613,"accepted":0,"total":3613,"result":false,"count":3613}

Here, accepted:0 indicates that the translation was rejected.

A successful  upload of a new translation looks like this:
Result:
{"not_found":0,"skipped":197,"accepted":1,"total":318,"result":true,"count":318}

I think this is a major bug

Could you send me the script you are using, Christian is currently
debugging it and that would help a lot. Thanks in advance,

Cheers
Sophie

Hi,
the requested script potrans.py is available on Github:
https://github.com/milossramek/translation-scripts/tree/master/weblate 
(with documentation)

To use it:
1. one needs weblate credentials:
https://github.com/milossramek/translation-scripts/tree/master/weblate#switches

2. then, one has to download translations:

potrans.py -p ui download|

3. Then it is necessary to change at leass one string in the downloaded

files by a common editor|

4. One can check, what has changed:|

modified files:|

potrans.py -p ui modified|

differences:|

potrans.py -p ui diff||

5. upload the changes|

potrans.py -p ui up|||

As stated below, the problem is that the number of accepted

translations is 0|||

Hi Sophie, *,

Was any cause found why the scripted update-upon-upload started failing?
The issue seems to remain, at least when using wlc.

Best,
Mihkel

Hi,

the upgrade helped, it works now using curl.

thanks
Milos