From b404ca1a022ed8eda7f035bf277e010d21891cf1 Mon Sep 17 00:00:00 2001 From: Anders Kaseorg Date: Mon, 28 Jul 2025 14:27:39 -0700 Subject: [PATCH] makemessages: Remove vestigial custom JavaScript extraction. Commit d8a36d07022a590710afd84bfdff5a2d530db71e (#18075) should have removed this. Signed-off-by: Anders Kaseorg --- zerver/management/commands/makemessages.py | 20 -------------------- 1 file changed, 20 deletions(-) diff --git a/zerver/management/commands/makemessages.py b/zerver/management/commands/makemessages.py index 3f1457fba0..3ad4215247 100644 --- a/zerver/management/commands/makemessages.py +++ b/zerver/management/commands/makemessages.py @@ -33,7 +33,6 @@ https://stackoverflow.com/questions/2090717 """ import glob -import itertools import os import re import subprocess @@ -75,8 +74,6 @@ tags = [ ] frontend_compiled_regexes = [re.compile(regex) for regex in regexes] -multiline_js_comment = re.compile(r"/\*.*?\*/", re.DOTALL) -singleline_js_comment = re.compile(r"//.*?\n") def strip_whitespaces(src: str, env: Environment) -> str: @@ -209,13 +206,6 @@ class Command(makemessages.Command): return translation_strings - def ignore_javascript_comments(self, data: str) -> str: - # Removes multi line comments. - data = multiline_js_comment.sub("", data) - # Removes single line (//) comments. - data = singleline_js_comment.sub("", data) - return data - def get_translation_strings(self) -> list[str]: translation_strings: list[str] = [] dirname = self.get_template_dir() @@ -227,16 +217,6 @@ class Command(makemessages.Command): with open(os.path.join(dirpath, filename)) as reader: data = reader.read() translation_strings.extend(self.extract_strings(data)) - for dirpath, dirnames, filenames in itertools.chain( - os.walk("web/src"), os.walk("web/shared/src") - ): - for filename in [f for f in filenames if f.endswith((".js", ".ts"))]: - if filename.startswith("."): - continue - with open(os.path.join(dirpath, filename)) as reader: - data = reader.read() - data = self.ignore_javascript_comments(data) - translation_strings.extend(self.extract_strings(data)) extracted = subprocess.check_output( [