Spaces:
Sleeping
Sleeping
Commit
·
766ff27
1
Parent(s):
4102ee9
Debug 5
Browse files- Resources/localization.py +2 -0
- app.py +4 -2
Resources/localization.py
CHANGED
|
@@ -41,6 +41,7 @@ STRINGS = {
|
|
| 41 |
"save_failed": "Save failed:",
|
| 42 |
"invalid_time_format": "Invalid time format:",
|
| 43 |
"error": "Error:",
|
|
|
|
| 44 |
},
|
| 45 |
"uk": {
|
| 46 |
# Header and login
|
|
@@ -79,6 +80,7 @@ STRINGS = {
|
|
| 79 |
"save_failed": "Помилка збереження:",
|
| 80 |
"invalid_time_format": "Невірний формат часу:",
|
| 81 |
"error": "Помилка:",
|
|
|
|
| 82 |
}
|
| 83 |
}
|
| 84 |
|
|
|
|
| 41 |
"save_failed": "Save failed:",
|
| 42 |
"invalid_time_format": "Invalid time format:",
|
| 43 |
"error": "Error:",
|
| 44 |
+
"all_videos_transcribed": "All videos transcribed!",
|
| 45 |
},
|
| 46 |
"uk": {
|
| 47 |
# Header and login
|
|
|
|
| 80 |
"save_failed": "Помилка збереження:",
|
| 81 |
"invalid_time_format": "Невірний формат часу:",
|
| 82 |
"error": "Помилка:",
|
| 83 |
+
"all_videos_transcribed": "Усі відео розмічено!",
|
| 84 |
}
|
| 85 |
}
|
| 86 |
|
app.py
CHANGED
|
@@ -54,6 +54,8 @@ def save_entry(df, start_time, text, end_time, selected_row_idx, video_id):
|
|
| 54 |
"""Save or update a caption entry"""
|
| 55 |
if user == "anonymous_user":
|
| 56 |
return df, gr.update(visible=True), gr.Warning(get_string("please_sign_in"))
|
|
|
|
|
|
|
| 57 |
try:
|
| 58 |
start_time = float(start_time)
|
| 59 |
end_time = float(end_time)
|
|
@@ -103,7 +105,7 @@ def cancel_edit():
|
|
| 103 |
|
| 104 |
def change_completion_status(completion_status):
|
| 105 |
global next_video_pointer
|
| 106 |
-
change_video_completion_status(completion_status, next_video_pointer - 1)
|
| 107 |
|
| 108 |
|
| 109 |
def get_next_components():
|
|
@@ -112,7 +114,7 @@ def get_next_components():
|
|
| 112 |
next_video_link = get_video_link_by_pointer(next_video_pointer)
|
| 113 |
next_video_pointer = (next_video_pointer + 1) % n_videos
|
| 114 |
|
| 115 |
-
for i in range(n_videos):
|
| 116 |
if next_video_link is not None:
|
| 117 |
break
|
| 118 |
next_video_link = get_video_link_by_pointer(next_video_pointer)
|
|
|
|
| 54 |
"""Save or update a caption entry"""
|
| 55 |
if user == "anonymous_user":
|
| 56 |
return df, gr.update(visible=True), gr.Warning(get_string("please_sign_in"))
|
| 57 |
+
if next_video_pointer == -1:
|
| 58 |
+
return df, gr.update(visible=True), gr.Success(get_string("all_videos_transcribed"))
|
| 59 |
try:
|
| 60 |
start_time = float(start_time)
|
| 61 |
end_time = float(end_time)
|
|
|
|
| 105 |
|
| 106 |
def change_completion_status(completion_status):
|
| 107 |
global next_video_pointer
|
| 108 |
+
change_video_completion_status(completion_status, (next_video_pointer + n_videos - 1) % n_videos)
|
| 109 |
|
| 110 |
|
| 111 |
def get_next_components():
|
|
|
|
| 114 |
next_video_link = get_video_link_by_pointer(next_video_pointer)
|
| 115 |
next_video_pointer = (next_video_pointer + 1) % n_videos
|
| 116 |
|
| 117 |
+
for i in range(n_videos + 1):
|
| 118 |
if next_video_link is not None:
|
| 119 |
break
|
| 120 |
next_video_link = get_video_link_by_pointer(next_video_pointer)
|