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

Variables stripped with XLIFF format #8891

Closed
2 tasks done
isametal88 opened this issue Mar 6, 2023 · 4 comments
Closed
2 tasks done

Variables stripped with XLIFF format #8891

isametal88 opened this issue Mar 6, 2023 · 4 comments
Labels
question This is more a question for the support than an issue. wontfix Nobody will work on this.

Comments

@isametal88
Copy link

Describe the issue

Hello,
we are facing a problem using Weblate to handle the translation of our Angular application.
I think we are missing something, but we're not able to figure out what.
The source strings are extracted in XLIFF (1.2) format using the standard Angular tools, but when the source messages are uploaded to weblate for translation, every variable used in the strings is stripped. We don't know if we need to write these variables in a certain way to make them work.

Source string example:
<trans-unit id="2085829909901977917" datatype="html"> <source>rinnovabile <x id="PH" equiv-text="getYearFromDate(this.coupon.fixed_license_expire)"/></source> <context-group purpose="location"> <context context-type="sourcefile">src/app/_shared/components/coupon-modal-accountant/coupon-display/coupon-description/coupon-description.component.ts</context> <context context-type="linenumber">17</context> </context-group> </trans-unit>

Spanish version created from weblate
<trans-unit id="2085829909901977917" datatype="html" xml:space="preserve" approved="no"> <source>rinnovabile</source> <target state="translated">renovable</target> <context-group purpose="location"> <context context-type="sourcefile">src/app/_shared/components/coupon-modal-accountant/coupon-modal-accountant.component.ts</context> <context context-type="linenumber">112,111</context> </context-group> </trans-unit>

Of course the result is the correct string in the base language, and only "rinnovabile" in spanish.
Thank you for your support

Isaia

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. Go to '...'
  2. Scroll down to '...'
  3. Click on '...'
  4. See error

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

@isametal88 isametal88 added the question This is more a question for the support than an issue. label Mar 6, 2023
@github-actions
Copy link

github-actions bot commented Mar 6, 2023

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!

@nijel
Copy link
Member

nijel commented Mar 7, 2023

You should choose XLIFF with placeables support, see https://docs.weblate.org/en/latest/formats.html#xliff

@isametal88
Copy link
Author

Hello Nijel,

this is the format Angular uses with XLIFF:

<?xml version="1.0" encoding="UTF-8" ?> <xliff version="1.2" xmlns="urn:oasis:names:tc:xliff:document:1.2"> <file source-language="it" datatype="plaintext" original="ng2.template"> <body> ...

Using placeables I generate units like this:
<trans-unit id="4666442495607243569" datatype="html"> <source>Data di riferimento <x id="refDate" equiv-text="item.reference_date"/></source> <context-group purpose="location"> <context context-type="sourcefile">src/app/sections/communications/components/side/edit/edit.config.ts</context> <context context-type="linenumber">42</context> </context-group> </trans-unit>

but looking at the string in weblate, it's only 'Data di riferimento ', so the variable is lost in the translation.

Also, i'm not able to use placeables using i18n tags but only with localize (but this is more a Angular problem, I think)

Thank you very much

Isaia

@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 Mar 18, 2023
@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Mar 23, 2023
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

2 participants