Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,8 @@ Twitter = "https://twitter.com/WeblateOrg"
target-version = ['py310']

[tool.codespell]
skip = '*.po,*.pot,*.json,*.tmx,*.tbx,yarn.lock,known_hosts'
count = true
skip = '*.po,*.pot,*.json,*.tmx,*.tbx,*.csv,yarn.lock,known_hosts,*/vendor/*'

[tool.django-stubs]
django_settings_module = "weblate.settings_example"
Expand Down
2 changes: 1 addition & 1 deletion weblate/accounts/forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ class CommitForm(ProfileBaseForm):
label=gettext_lazy("Commit e-mail"),
choices=[("", gettext_lazy("Use account e-mail address"))],
help_text=gettext_lazy(
"Used in version control commits. The address will stay in the repository forever once changes are commited by Weblate."
"Used in version control commits. The address will stay in the repository forever once changes are committed by Weblate."
),
required=False,
widget=forms.RadioSelect,
Expand Down
2 changes: 1 addition & 1 deletion weblate/accounts/migrations/0001_squashed_weblate_5.py
Original file line number Diff line number Diff line change
Expand Up @@ -425,7 +425,7 @@ class Migration(migrations.Migration):
),
("LockNotification", "Component was locked or unlocked"),
("LicenseNotification", "License was changed"),
("ParseErrorNotification", "Parse error occured"),
("ParseErrorNotification", "Parse error occurred"),
(
"NewStringNotificaton",
"New string is available for translation",
Expand Down
2 changes: 1 addition & 1 deletion weblate/accounts/notifications.py
Original file line number Diff line number Diff line change
Expand Up @@ -477,7 +477,7 @@ class LicenseNotification(Notification):
@register_notification
class ParseErrorNotification(Notification):
actions = (Change.ACTION_PARSE_ERROR,)
verbose = pgettext_lazy("Notification name", "Parse error occured")
verbose = pgettext_lazy("Notification name", "Parse error occurred")
template_name = "parse_error"

def get_context(
Expand Down
2 changes: 1 addition & 1 deletion weblate/auth/management/commands/createadmin.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ def handle(self, *args, **options) -> None:
else:
for user in matching_users:
self.stderr.write(
f"Found maching user: username={user.username} email={user.email}"
f"Found matching user: username={user.username} email={user.email}"
)
raise CommandError("Multiple users matched given parameters!")

Expand Down
2 changes: 1 addition & 1 deletion weblate/checks/fluent/inner_html.py
Original file line number Diff line number Diff line change
Expand Up @@ -620,7 +620,7 @@ def _parse_end_tag(
"""Parse an end tag, starting after the "</"."""
end_tag_match = source.match(cls._END_TAG_REGEX)
if not end_tag_match:
# May correspond to using a non-ASCII alpha-numeric value in the tag
# May correspond to using a non-ASCII alphanumeric value in the tag
# name, which whilst technically allowed for HTML, is not allowed by
# this check.
#
Expand Down
8 changes: 4 additions & 4 deletions weblate/checks/tests/test_chars_checks.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,14 +96,14 @@ def setUp(self) -> None:
def test_arabic(self) -> None:
self.assertTrue(
self.check.check_target(
["<unusued singular (hash=…)>", "Lorem ipsum dolor sit amet."],
["<unused singular (hash=…)>", "Lorem ipsum dolor sit amet."],
["zero", "one", "two", "few", "many", "other"],
MockUnit(code="ar"),
)
)
self.assertFalse(
self.check.check_target(
["<unusued singular (hash=…)>", "Lorem ipsum dolor sit amet."],
["<unused singular (hash=…)>", "Lorem ipsum dolor sit amet."],
["zero.", "one", "two.", "few.", "many.", "other."],
MockUnit(code="ar"),
)
Expand All @@ -114,14 +114,14 @@ def test_japanese(self) -> None:
self.do_test(True, ("Text:", "Text", ""), "ja")
self.assertTrue(
self.check.check_target(
["<unusued singular (hash=…)>", "English."],
["<unused singular (hash=…)>", "English."],
["Japanese…"],
MockUnit(code="ja"),
)
)
self.assertFalse(
self.check.check_target(
["<unusued singular (hash=…)>", "English."],
["<unused singular (hash=…)>", "English."],
["Japanese。"],
MockUnit(code="ja"),
)
Expand Down
2 changes: 1 addition & 1 deletion weblate/gitexport/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ def get_response(self):
if "status" in message:
return HttpResponse(status=int(message["status"].split()[0]))

# Send streaming content as reponse
# Send streaming content as response
return StreamingHttpResponse(
streaming_content=self.stream(), content_type=message["content-type"]
)
4 changes: 2 additions & 2 deletions weblate/lang/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -996,11 +996,11 @@ def map_units(self, units) -> None:
def zip(self, sources, targets, unit):
if len(sources) != self.source_plural.number:
raise ValueError(
"length of `sources` does't match the number of source plurals"
"length of `sources` doesn't match the number of source plurals"
)
if len(targets) != self.target_plural.number:
raise ValueError(
"length of `targets` does't match the number of target plurals"
"length of `targets` doesn't match the number of target plurals"
)
if self.same_plurals:
return zip(sources, targets, strict=True)
Expand Down
4 changes: 2 additions & 2 deletions weblate/machinery/dummy.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ class DummyTranslation(MachineTranslation):

def download_languages(self):
"""
List supported languges.
List supported languages.

Dummy translation supports just Czech language.
"""
Expand All @@ -28,7 +28,7 @@ def download_translations(
threshold: int = 75,
) -> DownloadTranslations:
"""
Donwload translations.
Download translations.

Dummy translation supports just few phrases.
"""
Expand Down
2 changes: 1 addition & 1 deletion weblate/screenshots/forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ def __init__(
pk__in=(initial["translation"].pk, component.source_translation.pk)
)
self.fields["translation"].queryset = translations
# This is overriden from initial arg of the form
# This is overridden from initial arg of the form
self.fields["translation"].initial = component.source_translation
self.fields["translation"].empty_label = None

Expand Down
2 changes: 1 addition & 1 deletion weblate/templates/machinery/list.html
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
{% include 'machinery/detail.html' %}
</td>
<td class="bottom-button">
{% if service.is_enabled or not serivce.is_available %}
{% if service.is_enabled or not service.is_available %}
<form method="POST" action="{{ service.get_absolute_url }}">{% csrf_token %}<input type="hidden" name="delete" value="1" /><button type="submit" class="btn btn-danger">{% trans "Disable" %}</button></form>
{% else %}
<form method="POST" action="{{ service.get_absolute_url }}">{% csrf_token %}<input type="hidden" name="enable" value="1" /><button type="submit" class="btn btn-primary">{% trans "Enable" %}</button></form>
Expand Down
2 changes: 1 addition & 1 deletion weblate/trans/models/change.py
Original file line number Diff line number Diff line change
Expand Up @@ -638,7 +638,7 @@ def save(self, *args, **kwargs) -> None:
self.translation.stats.fetch_last_change()
# Update stats at the end of transaction
transaction.on_commit(self.update_cache_last_change)
# Make sure stats is updated at the end of trasaction
# Make sure stats is updated at the end of transaction
self.translation.invalidate_cache()

def get_absolute_url(self):
Expand Down
8 changes: 4 additions & 4 deletions weblate/trans/models/component.py
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@


def perform_on_link(func):
"""Perfom operation on repository link."""
"""Perform operation on repository link."""

def on_link_wrapper(self, *args, **kwargs):
linked = self.linked_component
Expand Down Expand Up @@ -1909,10 +1909,10 @@ def get_repo_link_url(self):
@cached_property
def linked_childs(self):
"""Return list of components which links repository to us."""
childs = self.component_set.prefetch()
for child in childs:
children = self.component_set.prefetch()
for child in children:
child.linked_component = self
return childs
return children

def get_linked_childs_for_template(self):
return [
Expand Down
2 changes: 1 addition & 1 deletion weblate/trans/models/unit.py
Original file line number Diff line number Diff line change
Expand Up @@ -394,7 +394,7 @@ class Unit(models.Model, LoggerMixin):
labels = LabelsField("Label", verbose_name=gettext_lazy("Labels"), blank=True)

# The type annotation hides that field can be None because
# save() updates it to non-None immediatelly.
# save() updates it to non-None immediately.
source_unit: Unit = models.ForeignKey(
"trans.Unit", on_delete=models.deletion.CASCADE, blank=True, null=True
)
Expand Down
2 changes: 1 addition & 1 deletion weblate/trans/tests/test_edit.py
Original file line number Diff line number Diff line change
Expand Up @@ -991,7 +991,7 @@ def test_edit_source_pending(self) -> None:
# Edit source string
self.edit_unit("Hello, world!\n", "Hello, beautiful world!\n", language="en")

# Force commiting source string change
# Force committing source string change
self.component.commit_pending("test", None)

# Translation revision should have been updated now
Expand Down
2 changes: 1 addition & 1 deletion weblate/trans/tests/test_middleware.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ def test_translation_redirect(self) -> None:
self.assertIn("Hindi translation is currently not available", messages[0])

def test_redirect_category(self) -> None:
# Non existing category should be ommitted
# Non existing category should be omitted
kwargs = {
"path": [
self.project.slug,
Expand Down
2 changes: 1 addition & 1 deletion weblate/trans/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,7 @@ def render(

def path_separator(path: str) -> str:
"""
Consolidate path separtor.
Consolidate path separator.

Always use / as path separator for consistency.
"""
Expand Down
4 changes: 2 additions & 2 deletions weblate/trans/validators.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,11 @@ def validate_filemask(val) -> None:


def validate_autoaccept(val) -> None:
"""Validate correct value for automatical acceptance."""
"""Validate correct value for automatic acceptance."""
if val == 1:
raise ValidationError(
gettext(
"A value of 1 is not allowed for automatical acceptance as "
"A value of 1 is not allowed for automatic acceptance as "
"it would permit users to vote on their own suggestions."
)
)
Expand Down
2 changes: 1 addition & 1 deletion weblate/utils/db.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ class PostgreSQLFallbackLookupMixin:
Mixin to block PostgreSQL from using trigram index.

It is ineffective for very short strings as these produce a lot of matches
which need to be rechecked and full table scan is more effecive in that
which need to be rechecked and full table scan is more effective in that
case.

It is performed by concatenating empty string which will prevent index usage.
Expand Down
2 changes: 1 addition & 1 deletion weblate/vcs/gpg.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ def get_gpg_key(silent=False) -> str | None:
gpg_error("GPG key listing", error, silent)
return None
for line in result.stdout.splitlines():
if not line.startswith("fpr:"):
if not line.startswith("fpr:"): # codespell:ignore fpr
continue
return line.split(":")[9]
return None
Expand Down