File tree Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -51,8 +51,13 @@ def generate_commit_msg():
51
51
entry .msgid not in old_entries
52
52
or old_entries [entry .msgid ] != entry .msgstr
53
53
):
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
+ )
56
61
if translator :
57
62
translators .add (f"Co-Authored-By: { translator } " )
58
63
break
@@ -79,7 +84,7 @@ def chdir(path: Path):
79
84
parser .add_argument (
80
85
"path" ,
81
86
type = Path ,
82
- nargs = '?' ,
87
+ nargs = "?" ,
83
88
default = "." ,
84
89
help = "Path to the Git repository (default: current directory)" ,
85
90
)
You can’t perform that action at this time.
0 commit comments