Skip to content

Commit

Permalink
Fix #62 last row of empty translation text missing issue
Browse files Browse the repository at this point in the history
  • Loading branch information
BingLingGroup committed Sep 3, 2019
1 parent b617874 commit 0e1192c
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 19 deletions.
10 changes: 9 additions & 1 deletion autosub/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,7 @@ def list_to_googletrans( # pylint: disable=too-many-locals, too-many-arguments,
i = 0
partial_index = []
valid_index = []
is_last = False
is_last = ""
for text in text_list:
if text:
if not is_last:
Expand Down Expand Up @@ -351,6 +351,14 @@ def list_to_googletrans( # pylint: disable=too-many-locals, too-many-arguments,
pbar.update(i)
if len(partial_index) > 1:
time.sleep(sleep_seconds)

i = valid_index[-1]
while i < partial_index[-1]:
# if valid_index[-1] is less than partial_index[-1]
# add empty strings
translated_text.append("")
i = i + 1

pbar.finish()

except KeyboardInterrupt:
Expand Down
35 changes: 17 additions & 18 deletions docs/issue_labels.json
Original file line number Diff line number Diff line change
@@ -1,20 +1,19 @@
[
{ "name": "Type: Bug", "color": "#dc322f" },
{ "name": "Type: Duplicated", "color": "#93a1a1" },
{ "name": "Type: Maintenance", "color": "#6c71c4" },
{ "name": "Type: Enhancement", "color": "#268bd2" },
{ "name": "Type: Question", "color": "#2aa198" },
{ "name": "Type: Invalid", "color": "#93a1a1" },
{ "name": "Type: help wanted", "color": "#fdf6e3" },
{ "name": "Priority: Low", "color": "#fdf6e3" },
{ "name": "Priority: Medium", "color": "#b58900" },
{ "name": "Priority: High", "color": "#dc322f" },
{ "name": "Priority: Critical", "color": "#d33682" },
{ "name": "Status: Abandoned", "color": "#002b36" },
{ "name": "Status: Accepted", "color": "#859900" },
{ "name": "Status: Blocked", "color": "#dc322f" },
{ "name": "Status: Completed", "color": "#fdf6e3" },
{ "name": "Status: In Progress", "color": "#eee8d5" },
{ "name": "Status: Review Needed", "color": "#b58900" },
{ "name": "Status: Revision Needed", "color": "#dc322f" }
{ "name": "Type: Bug", "color": "#FF6E40" },
{ "name": "Type: Duplicated", "color": "#B0BEC5" },
{ "name": "Type: Maintenance", "color": "#A5D6A7" },
{ "name": "Type: Enhancement", "color": "#80DEEA" },
{ "name": "Type: Question", "color": "#69F0AE" },
{ "name": "Type: Invalid", "color": "#B0BEC5" },
{ "name": "Type: Help Wanted", "color": "#FFE082" },
{ "name": "Priority: Low", "color": "#9FA8DA" },
{ "name": "Priority: Medium", "color": "#CE93D8" },
{ "name": "Priority: High", "color": "#EF9A9A" },
{ "name": "Priority: Critical", "color": "#F48FB1" },
{ "name": "Status: Abandoned", "color": "#BCAAA4" },
{ "name": "Status: Accepted", "color": "#E6EE9C" },
{ "name": "Status: Blocked", "color": "#B0BEC5" },
{ "name": "Status: Completed", "color": "#FDF6E3" },
{ "name": "Status: In Progress", "color": "#EEE8D5" },
{ "name": "Status: Review Needed", "color": "#FFF59D" }
]

0 comments on commit 0e1192c

Please sign in to comment.