Skip to content

Commit

Permalink
Unit: Fix number of words calculation
Browse files Browse the repository at this point in the history
It should count words, not strings
  • Loading branch information
nijel committed Sep 22, 2020
1 parent 3f758eb commit ab0c90a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion weblate/trans/models/unit.py
Original file line number Diff line number Diff line change
Expand Up @@ -322,7 +322,7 @@ def save(
"""Wrapper around save to run checks or update fulltext."""
# Store number of words
if not same_content or not self.num_words:
self.num_words = len(self.source_string)
self.num_words = len(self.source_string.split())
if update_fields and "num_words" not in update_fields:
update_fields.append("num_words")

Expand Down

0 comments on commit ab0c90a

Please sign in to comment.