Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 8 additions & 3 deletions scripts/generate_commit_msg.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,13 @@ def generate_commit_msg():
entry.msgid not in old_entries
or old_entries[entry.msgid] != entry.msgstr
):
translator = new_po.metadata.get("Last-Translator")
translator = translator.split(",")[0].strip()
# Prevent failure on missing Last-Translator field.
# Transifex only adds Last-Translator if someone from
# the team translated. If it was uploaded by an account
# that is not in the team, this field will be missing.
translator = (
(new_po.metadata.get("Last-Translator") or "").split(",")[0].strip()
)
if translator:
translators.add(f"Co-Authored-By: {translator}")
break
Expand All @@ -79,7 +84,7 @@ def chdir(path: Path):
parser.add_argument(
"path",
type=Path,
nargs='?',
nargs="?",
default=".",
help="Path to the Git repository (default: current directory)",
)
Expand Down
Loading