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

Why Variant relate on source string instead of key (id)? #7664

Closed
2 tasks done
antonkomarev opened this issue May 18, 2022 · 6 comments
Closed
2 tasks done

Why Variant relate on source string instead of key (id)? #7664

antonkomarev opened this issue May 18, 2022 · 6 comments
Labels
question This is more a question for the support than an issue. wontfix Nobody will work on this.

Comments

@antonkomarev
Copy link

antonkomarev commented May 18, 2022

Describe the issue

Why variants uses mutable source string value as relation identifier instead of immutable Translation key (XLIFF id attribute)? Is it bug or made intentionally?

I already tried

  • I've read and searched the documentation.
  • I've searched for similar issues in this repository.

Steps to reproduce the behavior

  1. Create translation string with key = example and translation This is example
  2. Create variant of the string example with key = example_one and translation This is example One
  3. Create variant of the string example with key = example_two and translation This is example Two
  4. Export XLIFF file
  5. Look on weblate-flags attribute
<trans-unit xml:space="preserve" approved="yes" id="example">
  <source>This is example</source>
  <target state="translated">This is example</target>
</trans-unit>

<trans-unit xml:space="preserve" approved="yes" id="example_one" weblate-flags="variant:&quot;This is example&quot;">
  <source>This is example One</source>
  <target state="translated">This is example One</target>
</trans-unit>

<trans-unit xml:space="preserve" approved="yes" id="example_two" weblate-flags="variant:&quot;This is example&quot;">
  <source>This is example Two</source>
  <target state="translated">This is example Two</target>
</trans-unit>

Expected behavior

<trans-unit xml:space="preserve" approved="yes" id="example">
  <source>This is example</source>
  <target state="translated">This is example</target>
</trans-unit>

<trans-unit xml:space="preserve" approved="yes" id="example_one" weblate-flags="variant:example">
  <source>This is example One</source>
  <target state="translated">This is example One</target>
</trans-unit>

<trans-unit xml:space="preserve" approved="yes" id="example_two" weblate-flags="variant:example">
  <source>This is example Two</source>
  <target state="translated">This is example Two</target>
</trans-unit>

How do you run Weblate?

Docker container

Weblate versions

Weblate 4.12.2

@antonkomarev antonkomarev added the question This is more a question for the support than an issue. label May 18, 2022
@github-actions
Copy link

This issue looks more like a support question than an issue. We strive to answer these reasonably fast, but purchasing the support subscription is not only more responsible and faster for your business but also makes Weblate stronger.

In case your question is already answered, making a donation is the right way to say thank you!

@burner1024
Copy link
Contributor

There's no ids in PO format, for example.
Although I did expect variants to be linked by unit ids or something. Right now, with every source string update, I guess variants have to be re-linked, and given that it scales pretty badly, this could be a major issue in setups that use lots of variants.

@nijel
Copy link
Member

nijel commented May 18, 2022

When using keys, it might be better to use automated variants.

@antonkomarev
Copy link
Author

When using keys, it might be better to use automated variants.

Then variants flagged as variant in UI but not does not flagged in exported XLIFF file in any way. Is that correct behavior?

<trans-unit xml:space="preserve" approved="yes" id="example">
  <source>This is example</source>
  <target state="translated">This is example</target>
</trans-unit>

<trans-unit xml:space="preserve" approved="yes" id="example_one">
  <source>This is example One</source>
  <target state="translated">This is example One</target>
</trans-unit>

<trans-unit xml:space="preserve" approved="yes" id="example_two">
  <source>This is example Two</source>
  <target state="translated">This is example Two</target>
</trans-unit>

@nijel
Copy link
Member

nijel commented May 19, 2022

Yes, that's correct.

@github-actions
Copy link

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!

@github-actions github-actions bot added the wontfix Nobody will work on this. label May 30, 2022
@github-actions github-actions bot closed this as completed Jun 4, 2022
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. wontfix Nobody will work on this.
Projects
None yet
Development

No branches or pull requests

3 participants