From dc71762c9c28c5797c6eeb89f83697c693577510 Mon Sep 17 00:00:00 2001 From: Matthijs Velsink Date: Thu, 12 Jun 2025 19:22:09 +0200 Subject: [PATCH] decompiler: Force newline before translator comments The decompiler does not insert newlines and so relies on the formatter to format its output. The previous commit however broke translator comments, as they are now assumed to be inline. Therefore, make sure the decompiler forces a newline before a translator comment. We could special case such a comment in the formatter, but this might be difficult if #202 gets resolved, whereas in the decompiler we already know exactly when a comment is a translator comment. --- blueprintcompiler/decompiler.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/blueprintcompiler/decompiler.py b/blueprintcompiler/decompiler.py index 850b6d8..072aa89 100644 --- a/blueprintcompiler/decompiler.py +++ b/blueprintcompiler/decompiler.py @@ -375,7 +375,7 @@ def decompile_translatable( comments = "" else: comments = comments.replace("/*", " ").replace("*/", " ") - comments = f"/* Translators: {comments} */" + comments = f"\n/* Translators: {comments} */" if context is not None: return comments, f"C_({escape_quote(context)}, {escape_quote(string)})"