Skip to content

Commit c4ba38b

Browse files
committed
feat(checks): consolidate stop check behavior for CJK langs
The condition was used for Japanese only, let's expanding to to all CJK languages. Fixes #13678
1 parent c43887f commit c4ba38b

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

docs/changes.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ Weblate 5.10
2626
* Improved language compatibility in :ref:`mt-microsoft-translator`.
2727
* :ref:`check-reused` check gracefully handles languages which are not case sensitive.
2828
* :ref:`component-enforced_checks` are now applied on strings imported from the repository.
29+
* Reduced false positives in :ref:`check-end-colon` and :ref:`check-end-stop` for CJK languages.
2930

3031
.. rubric:: Bug fixes
3132

weblate/checks/chars.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ def check_single(self, source: str, target: str, unit: Unit):
185185
# Allow ... to be translated into ellipsis
186186
if source.endswith("...") and target[-1] == "…":
187187
return False
188-
if unit.translation.language.is_base({"ja"}) and source[-1] in {":", ";"}:
188+
if unit.translation.language.is_cjk() and source[-1] in {":", ";"}:
189189
# Japanese sentence might need to end with full stop
190190
# in case it's used before list.
191191
return self.check_chars(source, target, -1, {";", ":", ":", ".", "。"})
@@ -237,7 +237,7 @@ def check_single(self, source: str, target: str, unit: Unit):
237237
return False
238238
if unit.translation.language.is_base({"hy"}):
239239
return self._check_hy(source, target)
240-
if unit.translation.language.is_base({"ja"}):
240+
if unit.translation.language.is_cjk():
241241
return self._check_ja(source, target)
242242
return self.check_chars(source, target, -1, {":", ":", "៖"})
243243

0 commit comments

Comments
 (0)