Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit4599318

Browse files
authored
Prevent failure on missing Last-Translator field (#270)
1 parenta865294 commit4599318

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

‎scripts/generate_commit_msg.py‎

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,13 @@ def generate_commit_msg():
5151
entry.msgidnotinold_entries
5252
orold_entries[entry.msgid]!=entry.msgstr
5353
):
54-
translator=new_po.metadata.get("Last-Translator")
55-
translator=translator.split(",")[0].strip()
54+
# Prevent failure on missing Last-Translator field.
55+
# Transifex only adds Last-Translator if someone from
56+
# the team translated. If it was uploaded by an account
57+
# that is not in the team, this field will be missing.
58+
translator= (
59+
(new_po.metadata.get("Last-Translator")or"").split(",")[0].strip()
60+
)
5661
iftranslator:
5762
translators.add(f"Co-Authored-By:{translator}")
5863
break
@@ -79,7 +84,7 @@ def chdir(path: Path):
7984
parser.add_argument(
8085
"path",
8186
type=Path,
82-
nargs='?',
87+
nargs="?",
8388
default=".",
8489
help="Path to the Git repository (default: current directory)",
8590
)

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp