Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Translation of same string bug different context are automatically merged, causing wrong translations #4692

Closed
hosiet opened this issue Oct 14, 2020 · 10 comments
Labels
question This is more a question for the support than an issue.

Comments

@hosiet
Copy link
Contributor

hosiet commented Oct 14, 2020

Describe the bug

There are translation items with same source strings and different contexts (not exactly the same context). When I translate the string, the translated string is automatically applied to strings of similar context, which is undesired and made the translation of that string with simiar context wrong.

Even the context information are different, on weblate web interface it still says that the strings "share the same source string and same context".

To make things worse, I cannot cut the connection of those strings as a translator. When I change the translation at string A, the translation of string B always change and follow the change of string A. The result is that either string A's translation is wrong, or string B's translation is wrong, or both translations are all wrong.

To Reproduce

The bug example can be found currently on the hosted weblate instance.

To be more concrete, we consider the translation of "Georgia". We all know that it can be a European country named "Georgia" or the name of state "Georgia" in the United States.

The case is about the translation of ISO-3166-1 (country name) and ISO-3166-2 (province-level name).

Steps to reproduce the behavior:

  1. Go to https://hosted.weblate.org/translate/iso-codes/iso-3166-1/zh_Hans/?checksum=ec037b069edd70a3 and translate it as name A
  2. Click on https://hosted.weblate.org/translate/iso-codes/iso-3166-2/zh_Hans/?checksum=ec037b069edd70a3 and translate it as name B
  3. Go to https://hosted.weblate.org/translate/iso-codes/iso-3166-1/zh_Hans/?checksum=ec037b069edd70a3 and you will find that the translation becomes name A, which is the error.

Expected behavior

The translation at step 1 and step 2 should be different. Or at least, please disable the automatic translation applying by default.

Screenshots

Let me know if you need more screenshot here.

Server configuration and status

This is hosted.weblate.org.

Weblate deploy checks

This is hosted.weblate.org.

Exception traceback

This is hosted.weblate.org.

Additional context

The translation is for hosted iso-codes project.


If possible, may I suggest that we do not merge translation with different source string comment by default? I know that the iso-codes project did not actually add the "context" information at all but use the string comments to differentiate different strings, but this consideration should be reasonable.

(Or at least please provide an option to disable automatic translation applying.)

@nijel
Copy link
Member

nijel commented Oct 14, 2020

You can already disable it in component settings: https://docs.weblate.org/en/latest/admin/projects.html#allow-translation-propagation.

This should be improved in the future, see #3166

@nijel nijel added the question This is more a question for the support than an issue. label Oct 14, 2020
@github-actions
Copy link

This issue looks like a support question. We try to answer these reasonably fast, but in case you are looking for faster resolution, please consider purchasing support subscription and make Weblate stronger.

@hosiet
Copy link
Contributor Author

hosiet commented Oct 14, 2020

Thanks. If I understand correctly, such settings can be turned off by the project (e.g., iso-codes) admin. In this case, I will contact the iso-code admin first (issue reference can be found here) and see if the configuration can be changed.

@nijel
Copy link
Member

nijel commented Oct 14, 2020

It's per component setting meanwhile, the issue was not updated. But still, it's something admins can configure.

@github-actions
Copy link

This issue has been automatically marked as stale because it has not had any recent activity.

It will be closed soon if no further action occurs.

Thank you for your contributions!

@github-actions github-actions bot added the wontfix Nobody will work on this. label Nov 17, 2020
@tomkolp
Copy link
Contributor

tomkolp commented Nov 22, 2020

The ideal solution to this problem is to bind the string to the context in TM.

PO file:
#: 3427285-0-8
msgctxt "3427285-0-8"
msgid "IDLE"
msgstr "IDLE1"

#: 3427285-0-10
msgctxt "3427285-0-10"
msgid "IDLE"
msgstr "IDLE2"

TM Smartcat example:

<prop type = "x-context"> 3427285-0-10 </prop>

<tuv xml: lang = "en">
<Seg> IDLE </ seg>
</ Tuv>
<tuv xml: lang = "pl">
<Seg> IDLE2 </ seg>
</ Tuv>
</ Tu>

Is it possible in "Weblate"?

@nijel
Copy link
Member

nijel commented Nov 22, 2020

In this particular case "context" probably means translation component where the string is used, not actual msgctxt which is not set on these strings.

@tomkolp
Copy link
Contributor

tomkolp commented Nov 22, 2020

Currently my .po files have msgctxt set for each segment. This ensures that Smartcat always writes three things to TM:
ID = msgctxt, source = msgid, target = msgstr. As a result, I can even delete all files, and after reloading the translations always go to the right place, even if source (msgid) is the same and target (msgstr) is different. Would there be such a possibility in Weblate?

@github-actions github-actions bot removed the wontfix Nobody will work on this. label Nov 23, 2020
@nijel
Copy link
Member

nijel commented Nov 23, 2020

@tomkolp Can you please stop hijacking unrelated issue? The original issue had no msgctxt and it was not about translation memory at all...

I'm closing this issue as the original question has been most likely answered more than month ago. Given that the original poster didn't come back it probably helped him.

@nijel nijel closed this as completed Nov 23, 2020
@github-actions
Copy link

The issue you have reported is resolved now. If you don’t feel it’s right, please follow it’s labels to get a clue and take further steps.

  • In case you see a similar problem, please open a separate issue.
  • If you are happy with the outcome, don’t hesitate to support Weblate by making a donation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question This is more a question for the support than an issue.
Projects
None yet
Development

No branches or pull requests

3 participants