chore(translations): preserve NBSP in front of : as well when merging [no changelog]
What changed, and why it matters
This commit is a minor translation-processing fix. It changes a script that cleans translated text so it keeps a special non-breaking space before colons (':') in addition to question marks and exclamation points. This is purely a localization/punctuation formatting tweak and has no security relevance.
No security action needed. This is a routine localization tooling change.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The change updates a regex in core/translations/crowdin.py used during Crowdin translation merging. The regex \u00A0(?![?!:]) now preserves non-breaking spaces (U+00A0) before ‘?’, ‘!’, and ‘:’ when replacing them with regular spaces. Previously only ‘?’ and ‘!’ were preserved. This is a French typographic convention and affects only translation string normalization.
Changed components
core/translations/crowdin.pyInspect captured patch +2 / −2
diff --git a/core/translations/crowdin.py b/core/translations/crowdin.py
index 39439e05..9d192b93 100644
--- a/core/translations/crowdin.py
+++ b/core/translations/crowdin.py
@@ -52,9 +52,9 @@ def merge() -> None:
def clean_translation(text: str) -> str:
"""Remove or replace non-printable characters in translation strings."""
- # Replace non-breaking spaces with regular spaces, EXCEPT before ? and !
+ # Replace non-breaking spaces with regular spaces, EXCEPT before ? ! and :
# Use negative lookahead to avoid replacing before French punctuation
- text = re.sub(r'\u00A0(?![?!])', ' ', text)
+ text = re.sub(r'\u00A0(?![?!:])', ' ', text)
return text
for lang in sorted(tdir.all_languages()):
Why this scored 15/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.