From 5bf20d155f7c7cfeff2976e9fe6078a559d2025b Mon Sep 17 00:00:00 2001 From: WarmUpTill Date: Wed, 11 Sep 2024 13:30:31 +0200 Subject: [PATCH] Ignore comments --- build-aux/CI/check-locale.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/build-aux/CI/check-locale.py b/build-aux/CI/check-locale.py index d66b6721..9dd9579c 100644 --- a/build-aux/CI/check-locale.py +++ b/build-aux/CI/check-locale.py @@ -6,6 +6,7 @@ import re import sys defaultLocaleFile = "en-US.ini" +commentChars = ";#" class localeEntry: @@ -21,6 +22,13 @@ class localeEntry: self.lineNum = lineNum +def isCommentLine(line): + for char in commentChars: + if line.startswith(char): + return True + return False + + def getNonDefaultLocales(dir): files = [] for filename in os.listdir(dir): @@ -38,7 +46,7 @@ def getAllLocaleEntries(file): widgetPlaceholders = [] qStringArgs = [] - if line.startswith(";"): + if isCommentLine(line): continue for word in line.split("{{"):