-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathi18n.js
More file actions
317 lines (314 loc) · 11 KB
/
Copy pathi18n.js
File metadata and controls
317 lines (314 loc) · 11 KB
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
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
// Locale-aware strings for Taskwarrior Time (plugin id: taskwarrior-time).
function isRussian(localeName) {
var candidates = []
if (localeName !== undefined && localeName !== null && String(localeName) !== "")
candidates.push(String(localeName))
try {
var loc = Qt.locale()
if (loc) {
if (loc.name) candidates.push(String(loc.name))
// Prefer the first UI language (e.g. "ru-RU", "ru") when set.
var ui = loc.uiLanguages
if (ui && ui.length > 0) candidates.push(String(ui[0]))
}
} catch (e) {}
for (var i = 0; i < candidates.length; i++) {
var raw = String(candidates[i] || "").toLowerCase().replace(/-/g, "_")
if (!raw) continue
// "ru", "ru_RU", "ru_RU.UTF-8", "ru.utf8"
var lang = raw.split(".")[0].split("_")[0]
if (lang === "ru") return true
}
return false
}
function t(key, localeName, uiLanguage) {
var mode = String(uiLanguage || "system").toLowerCase()
var ru
if (mode === "ru") ru = true
else if (mode === "en") ru = false
else ru = isRussian(localeName)
var en = {
title: "Taskwarrior Time",
titleInProgress: "Taskwarrior Time",
projects: "Projects",
filterAll: "All",
filterActive: "Active",
filterToday: "Today",
filterDone: "Done",
filterSpoiler: "Filter",
filterClear: "Reset",
filterAny: "Any",
filterStatus: "Status",
filterStatusOpen: "Open",
filterStatusAll: "Any status",
filterProject: "Project",
filterDue: "Due",
filterDueSoon: "Soon",
filterTimer: "Timer",
filterTimerOn: "Running",
filterTimerOff: "Idle",
filterDeps: "Dependencies",
filterDepsClear: "No deps",
filterSearch: "Search",
filterSearchHint: "Description…",
groupBy: "Group",
groupNone: "None",
groupProject: "Project",
groupPriority: "Priority",
groupDue: "Due",
groupStatus: "Status",
addPlaceholder: "New task…",
addSection: "New task",
addDetails: "Task fields",
addDetailsHide: "Hide fields",
advancedShow: "Schedule, links & time",
advancedHide: "Hide schedule, links & time",
startTimerOnCreate: "Start timer after creating",
addTaskBtn: "Add task",
startDate: "Start",
endDate: "Due",
details: "Details",
detailsHint: "Longer notes…",
titleField: "Title",
editSectionPlan: "Plan",
editSectionSchedule: "Schedule",
editSectionLinks: "Dependencies",
editSectionTime: "Time",
priority: "Priority",
priorityNone: "—",
project: "Project",
projectNone: "No project",
allProjects: "All projects",
add: "Add",
unsavedChanges: "This task has unsaved changes.",
unsavedSave: "Save",
unsavedContinue: "Keep editing",
unsavedDiscard: "Discard",
save: "Save",
cancel: "Cancel",
deleteTask: "Delete",
confirmDelete: "Delete this task?",
confirmClearProject: "Remove this project from all tasks?",
confirm: "Confirm",
play: "Start timer",
stop: "Stop timer",
todayTime: "Today",
adjustTime: "Adjust time",
adjustTimeHint: "30m, 1h, 1:30",
timeAdd: "+ Add",
timeRemove: "− Remove",
done: "Done",
pending: "Pending",
waiting: "Waiting",
waitingFor: "Waiting for",
waitingForHint: "What are we waiting for…",
outcome: "Outcome",
outcomeHint: "What was the result…",
status: "Status",
depends: "Depends on",
blocks: "Blocks",
blocked: "Blocked",
blocking: "Blocking",
overdue: "Overdue",
noTasks: "No tasks",
noProjects: "No projects yet",
newProject: "New project…",
rename: "Rename",
clearProject: "Clear",
expand: "Details",
missingTaskwarrior: "Install Taskwarrior (task)",
sectionNone: "Inbox",
dueOverdue: "Overdue",
dueToday: "Today",
dueTomorrow: "Tomorrow",
dueWeek: "This week",
dueLater: "Later",
dueNone: "No due date",
priH: "high",
priM: "middle",
priL: "low",
priNone: "No priority",
statusPending: "Pending",
statusCompleted: "Completed",
statusWaiting: "Waiting",
tooltipTimer: "Timer",
tooltipOverdue: "%1 overdue",
tooltipPending: "%1 pending",
tooltipWaiting: "%1 waiting",
tooltipIdle: "No open tasks",
tooltipDebugOn: "Debug log ON",
viewTasks: "Tasks",
viewProjects: "Projects",
addDep: "Add dependency",
noDepCandidates: "No other tasks to link",
removeDep: "Remove",
datesHint: "today, tomorrow, DD.MM.YYYY[ HH:MM:SS]",
dateApply: "Apply",
dateTime: "Time",
dateClear: "Clear",
about: "About",
aboutTitle: "Taskwarrior Time",
aboutVersion: "Version",
aboutDeveloper: "Developer",
aboutDeveloperName: "DataArchitectPro",
aboutGithub: "Open on GitHub",
aboutMarketplace: "Omarchy Marketplace",
aboutChangelog: "What's new",
aboutNewIssue: "Report a problem",
aboutLinks: "Help & links",
aboutClose: "Close",
debugLog: "Debug logging",
debugLogOn: "Debug log: ON",
debugLogOff: "Debug log: OFF",
debugLogHint: "Writes a diagnostic log with versions (plugin, Taskwarrior, Timewarrior, Omarchy) and UI events. Attach the whole file when reporting a problem.",
aboutOpenLogFolder: "Open log folder",
aboutClearLogs: "Clear logs",
uiLanguage: "Interface language",
uiLanguageSystem: "System",
uiLanguageRu: "Русский",
uiLanguageEn: "English",
}
var ruMap = {
title: "Taskwarrior Time",
titleInProgress: "Taskwarrior Time",
projects: "Проекты",
filterAll: "Все",
filterActive: "Активные",
filterToday: "Сегодня",
filterDone: "Готово",
filterSpoiler: "Фильтр",
filterClear: "Сбросить",
filterAny: "Любой",
filterStatus: "Статус",
filterStatusOpen: "Открытые",
filterStatusAll: "Любой статус",
filterProject: "Проект",
filterDue: "Срок",
filterDueSoon: "Скоро",
filterTimer: "Таймер",
filterTimerOn: "Идёт",
filterTimerOff: "Стоп",
filterDeps: "Зависимости",
filterDepsClear: "Без зависимостей",
filterSearch: "Поиск",
filterSearchHint: "Описание…",
groupBy: "Группы",
groupNone: "Без групп",
groupProject: "Проект",
groupPriority: "Приоритет",
groupDue: "Срок",
groupStatus: "Статус",
addPlaceholder: "Новая задача…",
addSection: "Новая задача",
addDetails: "Поля задачи",
addDetailsHide: "Скрыть поля",
advancedShow: "Сроки, связи и время",
advancedHide: "Скрыть сроки, связи и время",
startTimerOnCreate: "Запустить таймер после создания",
addTaskBtn: "Добавить задачу",
startDate: "Начало",
endDate: "Срок",
details: "Описание",
detailsHint: "Подробности задачи…",
titleField: "Название",
editSectionPlan: "План",
editSectionSchedule: "Сроки",
editSectionLinks: "Связи",
editSectionTime: "Время",
priority: "Приоритет",
priorityNone: "—",
project: "Проект",
projectNone: "Без проекта",
allProjects: "Все проекты",
add: "Добавить",
unsavedChanges: "В задаче есть несохранённые изменения.",
unsavedSave: "Сохранить",
unsavedContinue: "Продолжить",
unsavedDiscard: "Отменить",
save: "Сохранить",
cancel: "Отмена",
deleteTask: "Удалить",
confirmDelete: "Удалить эту задачу?",
confirmClearProject: "Снять проект со всех задач?",
confirm: "Подтвердить",
play: "Таймер",
stop: "Стоп",
todayTime: "Сегодня",
adjustTime: "Время",
adjustTimeHint: "30м, 1ч, 1:30",
timeAdd: "+ Добавить",
timeRemove: "− Убрать",
done: "Готово",
pending: "В работе",
waiting: "Ожидание",
waitingFor: "Чего ждём",
waitingForHint: "Текст ожидания…",
outcome: "Итоги",
outcomeHint: "Что получилось по итогу…",
status: "Статус",
depends: "Зависит от",
blocks: "Блокирует",
blocked: "Блокирована",
blocking: "Блокирует",
overdue: "Просрочено",
noTasks: "Нет задач",
noProjects: "Пока нет проектов",
newProject: "Новый проект…",
rename: "Переименовать",
clearProject: "Очистить",
expand: "Подробнее",
missingTaskwarrior: "Установите Taskwarrior (task)",
sectionNone: "Входящие",
dueOverdue: "Просрочено",
dueToday: "Сегодня",
dueTomorrow: "Завтра",
dueWeek: "На неделе",
dueLater: "Позже",
dueNone: "Без срока",
priH: "high",
priM: "middle",
priL: "low",
priNone: "Без приоритета",
statusPending: "В работе",
statusCompleted: "Выполнено",
statusWaiting: "Ожидание",
tooltipTimer: "Таймер",
tooltipOverdue: "%1 просрочено",
tooltipPending: "%1 в работе",
tooltipWaiting: "%1 в ожидании",
tooltipIdle: "Нет открытых задач",
tooltipDebugOn: "Отладка: ВКЛ",
viewTasks: "Задачи",
viewProjects: "Проекты",
addDep: "Добавить зависимость",
noDepCandidates: "Нет других задач для связи",
removeDep: "Убрать",
datesHint: "today, tomorrow, ДД.ММ.ГГГГ[ ЧЧ:ММ:СС]",
dateApply: "Готово",
dateTime: "Время",
dateClear: "Очистить",
about: "О плагине",
aboutTitle: "Taskwarrior Time",
aboutVersion: "Версия",
aboutDeveloper: "Разработчик",
aboutDeveloperName: "DataArchitectPro",
aboutGithub: "Открыть на GitHub",
aboutMarketplace: "Маркетплейс Omarchy",
aboutChangelog: "Что нового",
aboutNewIssue: "Сообщить о проблеме",
aboutLinks: "Справка и ссылки",
aboutClose: "Закрыть",
debugLog: "Отладочный лог",
debugLogOn: "Отладка: ВКЛ",
debugLogOff: "Отладка: ВЫКЛ",
debugLogHint: "Пишет диагностический лог с версиями (плагин, Taskwarrior, Timewarrior, Omarchy) и событиями UI. При сообщении о проблеме приложите весь файл.",
aboutOpenLogFolder: "Открыть папку с логами",
aboutClearLogs: "Очистить логи",
uiLanguage: "Язык интерфейса",
uiLanguageSystem: "Системный",
uiLanguageRu: "Русский",
uiLanguageEn: "English",
}
var map = ru ? ruMap : en
return map[key] !== undefined ? map[key] : (en[key] !== undefined ? en[key] : key)
}