WeblateOrg / weblate

Web based localization tool with tight version control integration.
https://weblate.org/
GNU General Public License v3.0
4.48k stars 994 forks source link

problem when uploading CSV file #12034

Closed chenpindong closed 3 weeks ago

chenpindong commented 2 months ago

Describe the issue

企业微信截图_17205199594019

Remove template if the file contains source:

if "source" in self.store.fieldnames and not isinstance( template_store, CSVFormat ): self.template_store = None

My problem: When translation base file is xlsx,uploading the CSV file translation, the original text was modified, but it was still found and updated.

Why is it not like this: if "source" in self.store.fieldnames: self.template_store = None When I make this modification, the problem is solved.

May I ask if it is possible to modify it this way?

I already tried

Steps to reproduce the behavior

1.Project Settings image

2.Warehouse files 企业微信截图_17205212857228

3.Translation to be uploaded 企业微信截图_17205212206149

Expected behavior

No response

Screenshots

No response

Exception traceback

No response

How do you run Weblate?

Docker container

Weblate versions

No response

Weblate deploy checks

No response

Additional context

No response

nijel commented 2 months ago

For monolingual files, matching is expected to happen based on key/context, source is ignored. See 4cdf14489dd66ae4f5c3d6cd3f8babbe2a72e4d2 and https://github.com/WeblateOrg/weblate/issues/1547

chenpindong commented 2 months ago

Why is CSV format different from other format processing methods?

if "source" in self.store.fieldnames: self.template_store = None Will this modification create new problems?

nijel commented 1 month ago

Why is CSV format different from other format processing methods?

Because it can have varying fields, all other formats have fixed structure.

if "source" in self.store.fieldnames: self.template_store = None Will this modification create new problems?

Do you mean removing it? Yes, it will bring back issues described in https://github.com/WeblateOrg/weblate/issues/1547

chenpindong commented 1 month ago

We may understand it differently, it's not that we want to delete that code.

Let me rephrase the problem: under these circumstances, if "source" in self.store.fieldnames and not isinstance( template_store, CSVFormat ): self.template_store = None I made changes to the original text when uploading, but I still managed to update the translation. However, I hope the translation cannot be found and will not be updated. In other formats, the translation cannot be found and will not be updated. May I ask why the CSV format is not consistent with other formats

github-actions[bot] commented 1 month ago

This issue has been automatically marked as stale because there wasn’t any recent activity.

It will be closed soon if no further action occurs.

Thank you for your contributions!

nijel commented 1 month ago

Other formats have fixed set of fields available. With CSV the fields can change, thats why there is a lot of special casing for CSV. I'm always worried changing the logic here as it can easily break other workflow and we definitely lack a test coverage here (there are too many cases to cover everything).

github-actions[bot] commented 4 weeks ago

This issue has been automatically marked as stale because there wasn’t any recent activity.

It will be closed soon if no further action occurs.

Thank you for your contributions!