Base completion on number of words in msgids #20
No reviewers
Labels
No labels
No milestone
No project
No assignees
4 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
AFPy/potodo!20
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "maciek/potodo:word-counts"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Closes #13.
@ -72,8 +82,12 @@ class PoFileStats:),"percent_translated": pofile.percent_translated(),"entries": len([e for e in pofile if not e.obsolete]),"words": sum([len(e.msgid.split()) for e in pofile if not e.obsolete]),nit: consider leaving a TODO comment mentioning that it can later be modified as e.total_words() and e.translated_words() after polib supports these methods.
@ -75,2 +86,4 @@"untranslated": len(pofile.untranslated_entries()),"translated": len(pofile.translated_entries()),"translated_words": sum([len(e.msgid.split()) for e in pofile.translated_entries()]related issue: https://github.com/izimobil/polib/pull/166#discussion_r2209880615
not an issue after clarification
LGTM
I've added word completion to project class (missed earlier), and added a new test assert for
TOTAL. Also added TODOs according to the comment.@ -133,2 +157,4 @@return sum(po_file.words for po_file in self.files_stats)@propertydef completion(self) -> float:Changing this will may cause large changes in the returned result, I think this should be an option as so to not surprise people.
I think those are good defaults, I'd be for including this change in a changelog and maybe bumping library version to 1.0.0? @seluj78 @mdk what do you think?
@ -201,2 +240,4 @@)@propertydef completion(self) -> float:Ditto.