Skip to content

Commit b47d26e

Browse files
committed
fix review issues
1 parent 9c668c0 commit b47d26e

File tree

6 files changed

+25
-3
lines changed

6 files changed

+25
-3
lines changed

docs/changes.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ Weblate 5.16
55

66
.. rubric:: New features
77

8+
* :ref:`check-multiple-capital` quality check.
9+
810
.. rubric:: Improvements
911

1012
* Delete announcements permission can be assigned to teams, see :ref:`privileges`.

docs/user/checks.rst

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1476,6 +1476,22 @@ Specifics on how each plural form is used can be found in the string definition.
14761476
Failing to fill in plural forms will in some cases lead to displaying nothing when
14771477
the plural form is in use.
14781478

1479+
.. _check-multiple-capital:
1480+
1481+
Multiple capitals
1482+
~~~~~~~~~~~~~~~~~
1483+
1484+
.. versionadded:: 5.16
1485+
1486+
:Summary: Translation contains words with multiple misplaced capital letters.
1487+
:Scope: translated strings
1488+
:Check class: ``weblate.checks.chars.MultipleCapitalCheck``
1489+
:Check identifier: ``multiple_capital``
1490+
:Trigger: This check is always enabled but can be ignored using a flag.
1491+
:Flag to ignore: ``ignore-multiple-capital``
1492+
1493+
Checks for misplaced capitalization, which often is a mistake when typing words with a first uppercased letter.
1494+
14791495
.. _check-kabyle-characters:
14801496

14811497
Non‑standard characters in Kabyle

weblate/checks/chars.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
import unicodedata
99
from typing import TYPE_CHECKING, ClassVar
1010

11-
import regex # pip install regex
11+
import regex
1212
from django.utils.translation import gettext_lazy
1313

1414
from weblate.checks.base import CountingCheck, TargetCheck, TargetCheckParametrized
@@ -587,7 +587,9 @@ class MultipleCapitalCheck(TargetCheck):
587587

588588
check_id = "multiple_capital"
589589
name = gettext_lazy("Multiple capitals")
590-
description = gettext_lazy("Detects words with multiple misplaced capital letters")
590+
description = gettext_lazy(
591+
"Translation contains words with multiple misplaced capital letters."
592+
)
591593

592594
# matches sequences of 2+ uppercase letters in *any language*
593595
UPPERCASE_SEQ = regex.compile(r"\p{Lu}{2,}")

weblate/checks/models.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ class WeblateChecksConf(AppConf):
6565
"weblate.checks.chars.EndEllipsisCheck",
6666
"weblate.checks.chars.EndSemicolonCheck",
6767
"weblate.checks.chars.MaxLengthCheck",
68+
"weblate.checks.chars.MultipleCapitalCheck",
6869
"weblate.checks.chars.KashidaCheck",
6970
"weblate.checks.chars.PunctuationSpacingCheck",
7071
"weblate.checks.chars.KabyleCharactersCheck",

weblate/checks/tests/test_chars_checks.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
KabyleCharactersCheck,
2424
KashidaCheck,
2525
MaxLengthCheck,
26-
MultipleCapitalCheck, # added class
26+
MultipleCapitalCheck,
2727
NewLineCountCheck,
2828
PunctuationSpacingCheck,
2929
ZeroWidthSpaceCheck,

weblate/settings_docker.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1108,6 +1108,7 @@
11081108
"weblate.checks.chars.EndEllipsisCheck",
11091109
"weblate.checks.chars.EndSemicolonCheck",
11101110
"weblate.checks.chars.MaxLengthCheck",
1111+
"weblate.checks.chars.MultipleCapitalCheck",
11111112
"weblate.checks.chars.KashidaCheck",
11121113
"weblate.checks.chars.PunctuationSpacingCheck",
11131114
"weblate.checks.chars.KabyleCharactersCheck",

0 commit comments

Comments
 (0)