File size: 4,438 Bytes
2d7377d
 
 
 
 
 
 
 
 
 
 
 
 
 
5580bab
2d7377d
a124874
5580bab
2d7377d
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
7e5e159
06fc90d
 
2d7377d
 
 
 
 
 
 
 
 
5580bab
2d7377d
a124874
5580bab
a124874
2d7377d
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
7e5e159
06fc90d
 
2d7377d
 
 
7e5e159
2d7377d
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
# Localization strings for the Caption Editor app

# Set the active language here: "en" or "uk"
LANGUAGE = "uk"

STRINGS = {
    "en": {
        # Header and login
        "app_title": "Caption Editor",
        "please_log_in": "Please log in via Hugging Face",
        "logged_in_as": "Logged in as",
        "log_in_button": "Log in",
        
        # Main interface
        "next_button": "Go to next video",
        "add_entry_button": "Add Entry",
        "editing_complete_checkbox": "Captions for this video are complete",
        "show_incomplete_only_checkbox": "Only show videos with incomplete captions",
        
        # Table headers
        "header_start": "Start",
        "header_text": "Text",
        "header_end": "End",
        
        # Edit form
        "edit_caption_title": "Edit Caption Entry",
        "start_time_label": "Start Time (seconds)",
        "caption_text_label": "Caption Text",
        "caption_text_placeholder": "Enter caption text...",
        "end_time_label": "End Time (seconds)",
        "insert_current_time": "Insert Video Current Time",
        "save_entry_button": "Save Entry",
        "update_entry_button": "Update Entry",
        "add_entry_button_form": "Add Entry",
        "cancel_button": "Cancel",
        
        # Messages
        "please_sign_in": "Please sign in to save changes",
        "start_less_than_end": "Start time must be less than end time",
        "text_cannot_be_empty": "Text cannot be empty",
        "save_successful": "Save successful!",
        "save_failed": "Save failed:",
        "invalid_time_format": "Invalid time format:",
        "error": "Error:",
        "all_videos_transcribed": "Save cancelled: All videos transcribed",
        "change_video_completion_status_success": "Video completion status successfully changed",
        "show_incomplete_only_change": "List of accessible videos successfully changed"
    },
    "uk": {
        # Header and login
        "app_title": "Редактор субтитрів",
        "please_log_in": "Будь ласка, увійдіть через Hugging Face",
        "logged_in_as": "Ви увійшли як",
        "log_in_button": "Увійти",
        
        # Main interface
        "next_button": "Перейти до наступного відео",
        "add_entry_button": "Додати субтитр",
        "editing_complete_checkbox": "Розмітка цього відео готова",
        "show_incomplete_only_checkbox": "Показувати лише відео із незавершеною розміткою",

        # Table headers
        "header_start": "Початок",
        "header_text": "Текст",
        "header_end": "Кінець",
        
        # Edit form
        "edit_caption_title": "Редагувати субтитр",
        "start_time_label": "Час початку (секунди)",
        "caption_text_label": "Текст субтитру",
        "caption_text_placeholder": "Введіть текст субтитру...",
        "end_time_label": "Час кінця (секунди)",
        "insert_current_time": "Вставити поточний час відео",
        "save_entry_button": "Зберегти запис",
        "update_entry_button": "Оновити запис",
        "add_entry_button_form": "Додати запис",
        "cancel_button": "Скасувати",
        
        # Messages
        "please_sign_in": "Будь ласка, увійдіть, щоб зберегти зміни",
        "start_less_than_end": "Час початку повинен бути менше часу кінця",
        "text_cannot_be_empty": "Текст не може бути порожнім",
        "save_successful": "Успішно збережено!",
        "save_failed": "Помилка збереження:",
        "invalid_time_format": "Невірний формат часу:",
        "error": "Помилка:",
        "all_videos_transcribed": "Відміна збереження: Усі відео розмічено",
        "change_video_completion_status_success": "Статус відео успішно змінено",
        "show_incomplete_only_change": "Список доступних відео успішно змінено"
    }
}


def get_string(key):
    """Get localized string by key"""
    return STRINGS[LANGUAGE].get(key, key)