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
Tags handling in xliff files #490
Comments
Hmm looks like something wrong in translate-toolkit or in way Weblate uses it for xliff files. What version of translate-toolkit are you using? |
I've been careful to use the latest 1.11.0 release. |
We're migrating from pootle and I've just checked how it performed with these files: string ' / events succesfully imported' is handled properly in the pootle UI as "{XXX_1} / {XXX_2} events succesfully imported", so the culprit could be the way weblate handles xliff. |
You're right, Weblate should use rich_source when possible and correctly store and interpret placeables from it... |
Same issue in weblate 2.6 :) |
That's expected. nobody has fixed it :-). |
The best approach to address this is probably overriding |
I started working on this, but I would need a bit more guidance. I didn't write Python for years, and I really don't have a good understanding of how data flow. So far I overrode the method as suggested, and completed <trans-unit id="id-1">
<source xml:space="preserve">source "<x id="INTERPOLATION" equiv-text="{{ angularExpression }}"/>", source.</source>
<target xml:space="preserve">target "<x id="INTERPOLATION" equiv-text="{{ angularExpression }}"/>", target.</target>
</trans-unit> I ended up the following content in DB: Is serializing Is there any documentation describing how the app internals work for developer to help me understand it ? Also @nijel would you prefer if I created a work-in-progress PR to talk about this ? |
The easiest approach is probably to serialize it back to xml in As for docs there is https://docs.weblate.org/en/latest/contributing.html and https://docs.weblate.org/en/latest/internals.html, but these are far from being complete, sorry :-(. |
This should allow to translate units containing placeholders such as the one used by Angular i18n. PoXliff will not support placehoders, because it probably doesn't make sense to support XLIFF specific placeholders in a format that actually embed PO placeholders. Fixes WeblateOrg#490 Fixes WeblateOrg#1535 Signed-off-by: Adrien Crivelli <adrien.crivelli@gmail.com>
Thank you for your report, the issue you have reported has just been fixed.
|
Hi Nijel, Thanks in Advance Ramya |
@ramyakrishnapandian This issue should be fixed, in case you see some similar issue, please open a separate issue. For business inquiries, please ask on sales@weblate.org (see https://weblate.org/support/). |
@nijel So, for now, does any XML tag inside source/target nodes supported? Or XLIFF placeholders x tags only? I mean, we are using XLIFF and we have strings like Should we add data-type="xml" to trans-unit? Or change something in our config? Because it looks like we have to always escape xml brackets with |
Maybe you're hitting #3081? |
Hello,
I'm experiencing an issue with xliff files containing tags in some of their translation units (weblate 1.9, but the issue persists with a fresh git clone). Here is a real-world example with a en/fr unit:
Weblate handles source string as "/ events succesfully imported", and target string as "/ événements importés", tags are somehow lost during the import. I've been fiddling around with datatypes but it doesn't seem to help.
Moreover, when editing and saving the translation in weblate (let's say the new French translation for this is "duh"), here is what appears in my xliff file:
The new translation is appended at the beginning of the string instead of replacing it.
Thanks for your help!
Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.
The text was updated successfully, but these errors were encountered: