Skip to content

Conversation

@amCap1712
Copy link
Contributor

@amCap1712 amCap1712 commented May 24, 2025

Handle TermWeb extended metadata: 'definition', 'Translation needed', 'administrativeStatus' and 'Usage note' in accordance with #12795. The _get_notes_list method is reimplemented in TBXUnit based on translate toolkit's tbxunit.getnotes to appropriately filter the extended metadata terms based on node tag and attributes.

I was a bit perplexed by the reference files attached in the the issue. They were multilingual files and it took me a while to realize that weblate doesn't support importing multilingual files (only mono or bi). Further, the TBX format (at least some versions if not all) support multiple terms inside termEntry tag, in these cases Weblate only considers the first term tag. Please correct me if my understanding is wrong.

The administrativeStatus and Translation needed seem general enough to upstream the support in Translate Toolkit. Thoughts?

@codecov
Copy link

codecov bot commented May 24, 2025

Codecov Report

❌ Patch coverage is 96.07843% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 91.16%. Comparing base (845c499) to head (7adde90).
⚠️ Report is 2623 commits behind head on main.

Files with missing lines Patch % Lines
weblate/formats/ttkit.py 93.54% 0 Missing and 2 partials ⚠️
Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##             main   #14998   +/-   ##
=======================================
  Coverage   91.15%   91.16%           
=======================================
  Files         626      626           
  Lines       65459    65513   +54     
  Branches     6751     6759    +8     
=======================================
+ Hits        59672    59724   +52     
  Misses       4059     4059           
- Partials     1728     1730    +2     
Files with missing lines Coverage Δ
weblate/formats/tests/test_formats.py 99.78% <100.00%> (+<0.01%) ⬆️
weblate/formats/ttkit.py 91.22% <93.54%> (+0.15%) ⬆️

... and 3 files with indirect coverage changes

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@nijel
Copy link
Member

nijel commented May 24, 2025

Indeed pushing that to translate-toolkit seems reasonable. For the various comments, it could be also implemented there, the getnotes has origin parmeter to distinguish different kinds.

@amCap1712
Copy link
Contributor Author

amCap1712 commented Jun 4, 2025

translate/translate#5601. For comments, explanation does not seem to be a unit field in translate-tooklit.

@nijel nijel linked an issue Jun 10, 2025 that may be closed by this pull request
@nijel nijel added this to the 5.12 milestone Jun 10, 2025
@nijel
Copy link
Member

nijel commented Jun 10, 2025

https://github.com/translate/translate/releases/tag/3.15.3 is out with the changes, you can now base on that after adjusting the minimal required version.

Handle TermWeb extended metadata: 'definition', 'Translation needed', 'administrativeStatus'
and 'Usage note' in accordance with WeblateOrg#12795.

The `_get_notes_list` method is reimplemented in `TBXUnit` based on translate toolkit's
`tbxunit.getnotes` to appropriately filter the extended metadata terms based on node tag
and attributes.
@nijel nijel self-assigned this Jun 11, 2025
@nijel nijel merged commit 5f51f73 into WeblateOrg:main Jun 11, 2025
49 of 52 checks passed
@nijel
Copy link
Member

nijel commented Jun 11, 2025

Merged, thanks for your contribution!

@amCap1712 amCap1712 deleted the termweb branch July 4, 2025 17:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Parse extended info from TermWeb TBX

2 participants