fix: gen_i18n.py wraps comment lines to avoid clang-format reflow

This commit is contained in:
pablohc
2026-03-29 22:48:15 +02:00
parent 4699ff0b88
commit 4e4fcd278a
2 changed files with 12 additions and 6 deletions
+10 -4
View File
@@ -470,12 +470,18 @@ def generate_keys_header(
names = [language_names[i] for i in sorted_indices]
comment_names = ", ".join(names)
lines.append("// Sorted language indices by code (auto-generated by gen_i18n.py)")
if len(f"// Order: {comment_names}") <= 100:
if len(f"// Order: {comment_names}") <= 120:
lines.append(f"// Order: {comment_names}")
else:
lines.append("// Order: " + names[0] + ",")
rest_line = ", ".join(names[1:])
lines.append("// " + rest_line)
current = "// Order: "
for name in names:
candidate = current + name + ", "
if len(candidate) > 100:
lines.append(current.rstrip(", "))
current = "// " + name + ", "
else:
current = candidate
lines.append(current.rstrip(", "))
lines.append(
"constexpr uint8_t SORTED_LANGUAGE_INDICES[] = {"
f"{', '.join(str(i) for i in sorted_indices)}"