Skip to content

Conversation

@moonchoe
Copy link

Issue #8753
introduces a new quality check called MultipleCapitalCheck. It detects words that contain multiple consecutive or misplaced capital letters (like HEllo or CAmelCase), which are commonly typos.

Changes:

  • Implemented MultipleCapitalCheck in weblate/checks/chars.py using the regex library to properly handle Unicode uppercase characters.
  • Registered the new check in weblate/checks/models.py.
  • Added regex to project dependencies in pyproject.toml.
  • Added unit tests in weblate/checks/tests/test_chars_checks.py covering positive matches, negative matches (acronyms), and Unicode scenarios.

Verification:

  • Passed all new unit tests via pytest.
  • Passed code style and linting checks (ruff).

@moonchoe moonchoe requested a review from nijel as a code owner December 10, 2025 21:24
@nijel nijel linked an issue Dec 11, 2025 that may be closed by this pull request
Copy link
Member

@nijel nijel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • For the check to be used it needs to be listed in the default set of checks in weblate/settings_docker.py and weblate/checks/models.py.
  • Can you please add documentation and changelog entry?

KabyleCharactersCheck,
KashidaCheck,
MaxLengthCheck,
MultipleCapitalCheck, # added class
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The comment is useless.

import unicodedata
from typing import TYPE_CHECKING, ClassVar

import regex # pip install regex
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Again, useless comment.

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.

Check for more than one capital letter per word

2 participants