Commit 5d4b04c4 authored by intrigeri's avatar intrigeri
Browse files

lint_po: support LL.po filename format.

We have this e.g. in greeter.git.
parent 53c414fa
......@@ -100,7 +100,7 @@ class PoFile:
def lang(self) -> str:
"""@returns: language of filename"""
name = os.path.basename(self.fname)
m = re.match(r"^[^.].*\.(?P<lang>[A-Za-z_]+)\.po$", name)
m = re.match(r"^(?:[^.].*\.)?(?P<lang>[A-Za-z_]+)\.po$", name)
if not m:
raise NoLanguageError(self.fname)
return m.group("lang")
......@@ -238,6 +238,7 @@ def main(logger) -> None:
if args.lang:
args.files += glob.glob("**/*.{lang}.po".format(lang=args.lang), recursive=True)
args.files += glob.glob("**/{lang}.po".format(lang=args.lang), recursive=True)
if args.cached:
# get top level directory of the current git repository
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment