diff --git a/blueprintcompiler/decompiler.py b/blueprintcompiler/decompiler.py index 81072d9..99901c1 100644 --- a/blueprintcompiler/decompiler.py +++ b/blueprintcompiler/decompiler.py @@ -391,9 +391,6 @@ def decompile_property( context=None, ): name = name.replace("_", "-") - if comments is not None: - ctx.print(f"/* Translators: {comments} */") - if cdata is None: ctx.print(f"{name}: ") ctx.end_block_with(";") diff --git a/tests/samples/translator_comments.blp b/tests/samples/translator_comments.blp new file mode 100644 index 0000000..b95e0c0 --- /dev/null +++ b/tests/samples/translator_comments.blp @@ -0,0 +1,6 @@ +using Gtk 4.0; + +Label { + /* Translators: This is a test comment. */ + label: C_("test", "Hello, world!"); +} diff --git a/tests/samples/translator_comments.ui b/tests/samples/translator_comments.ui new file mode 100644 index 0000000..ec3efd3 --- /dev/null +++ b/tests/samples/translator_comments.ui @@ -0,0 +1,12 @@ + + + + + + Hello, world! + + \ No newline at end of file diff --git a/tests/test_samples.py b/tests/test_samples.py index 11fe6f8..265a716 100644 --- a/tests/test_samples.py +++ b/tests/test_samples.py @@ -206,6 +206,9 @@ class TestSamples(unittest.TestCase): "unchecked_class", ] + # Decompiler-only tests + SKIP_COMPILE = ["translator_comments"] + SKIP_DECOMPILE = [ # Not implemented yet "action_widgets", @@ -225,7 +228,8 @@ class TestSamples(unittest.TestCase): continue with self.subTest(sample): - self.assert_sample(sample, skip_run=sample in SKIP_RUN) + if sample not in SKIP_COMPILE: + self.assert_sample(sample, skip_run=sample in SKIP_RUN) with self.subTest("decompile/" + sample): if sample not in SKIP_DECOMPILE: