rin
Публичный Open-source lightweight git hosting.
i18n.go · 963 строки · 54.2 KB
Raw
1 package i18n
2
3 type Lang string
4
5 const (
6 RU Lang = "ru"
7 EN Lang = "en"
8 )
9
10 func Normalize(code string) Lang {
11 switch code {
12 case "en", "EN":
13 return EN
14 default:
15 return RU
16 }
17 }
18
19 var translations = map[Lang]map[string]string{
20 RU: {
21 // Навигация и общее
22 "app.tagline": "Лёгкий self-hosted Git-хостинг",
23 "nav.home": "Главная",
24 "nav.repositories": "Репозитории",
25 "nav.explore": "Обзор",
26 "nav.settings": "Настройки",
27 "nav.admin": "Админка",
28 "nav.login": "Войти",
29 "nav.register": "Регистрация",
30 "nav.logout": "Выйти",
31 "nav.new_repo": "Создать",
32 "nav.command_palette": "Поиск и команды",
33 "nav.search_placeholder": "Поиск...",
34 "nav.theme": "Тема",
35 "nav.lang": "Язык",
36 "common.copy": "Копировать",
37 "common.copied": "Скопировано",
38 "common.cancel": "Отмена",
39 "common.save": "Сохранить",
40 "common.delete": "Удалить",
41 "common.close": "Закрыть",
42 "common.never": "Никогда",
43 "common.newer": "Новее",
44 "common.older": "Старее",
45 "common.up": "Наверх",
46
47 // Темы (только 3)
48 "theme.light": "Светлая",
49 "theme.dark": "Тёмная",
50 "theme.system": "Авто",
51
52 // Лендинг
53 "landing.badge": "Один бинарник · SQLite · Ноль зависимостей",
54 "landing.hero.title": "Лёгкий self-hosted Git-хостинг",
55 "landing.hero.subtitle": "Один бинарник на Go со встроенным SQLite. Поднимается за минуту, потребляет минимум памяти и не перегружен лишним.",
56 "landing.hero.cta_start": "Начать",
57 "landing.features.title": "Принципы",
58 "landing.feat1.title": "Один бинарник",
59 "landing.feat1.desc": "Шаблоны, стили, шрифты, миграции и иконки вшиты через go:embed.",
60 "landing.feat2.title": "SQLite (WAL)",
61 "landing.feat2.desc": "Вся база — один файл data/polar.db без CGO. Бэкап простым копированием.",
62 "landing.feat3.title": "Быстрый отклик",
63 "landing.feat3.desc": "Мгновенный старт, серверный рендеринг и < 30 МБ памяти в простое.",
64 "landing.feat4.title": "Приватность",
65 "landing.feat4.desc": "Публичные и приватные репозитории, Argon2id и токены доступа для Git HTTP.",
66 // Авторизация
67 "auth.login.title": "Вход",
68 "auth.register.title": "Регистрация",
69 "auth.register.disabled": "Публичная регистрация отключена администратором.",
70 "auth.username": "Имя пользователя",
71 "auth.username_hint": "2–32 символа: латиница, цифры, дефис, подчёркивание",
72 "auth.username_or_email": "Логин или Email",
73 "auth.email": "Email",
74 "auth.password": "Пароль",
75 "auth.password_hint": "Минимум 8 символов",
76 "auth.submit_login": "Войти",
77 "auth.submit_register": "Создать аккаунт",
78 "auth.no_account": "Нет аккаунта?",
79 "auth.have_account": "Уже есть аккаунт?",
80 "auth.invalid_creds": "Неверный логин или пароль",
81
82 // Репозитории
83 "repo.new.title": "Новый репозиторий",
84 "repo.name": "Название",
85 "repo.name_hint": "Латинские буквы, цифры, точка, дефис, подчёркивание",
86 "repo.description": "Описание",
87 "repo.description_ph": "Краткое описание проекта (необязательно)",
88 "repo.visibility": "Доступ",
89 "repo.public": "Публичный",
90 "repo.public_desc": "Виден всем, клонирование без авторизации",
91 "repo.private": "Приватный",
92 "repo.private_desc": "Доступен только владельцу",
93 "repo.create_btn": "Создать репозиторий",
94 "repo.filter_ph": "Фильтр репозиториев...",
95 "repo.empty_list": "Репозиториев пока нет",
96 "repo.empty_list_sub": "Создайте первый репозиторий, чтобы отправить код.",
97 "repo.empty.title": "Репозиторий пуст",
98 "repo.empty.new_cmd": "Создать новый репозиторий в командной строке",
99 "repo.empty.push_cmd": "Отправить существующий репозиторий",
100 "repo.tab.code": "Код",
101 "repo.tab.commits": "Коммиты",
102 "repo.tab.branches": "Ветки и теги",
103 "repo.tab.issues": "Задачи",
104 "repo.tab.pulls": "Пул-реквесты",
105 "repo.tab.releases": "Релизы",
106 "repo.tab.activity": "Активность",
107 "repo.tab.settings": "Настройки",
108 "repo.features": "Возможности репозитория",
109 "repo.clone": "Клонировать",
110 "repo.download_zip": "Скачать ZIP",
111 "repo.branches": "Ветки",
112 "repo.tags": "Теги",
113 "repo.default_branch": "Ветка по умолчанию",
114 "repo.find_file": "Поиск файла...",
115 "repo.files": "Файлы",
116 "repo.readme": "README",
117 "repo.raw": "Raw",
118 "repo.history": "История",
119 "repo.lines": "строк",
120 "repo.lines_one": "строка",
121 "repo.lines_few": "строки",
122 "repo.lines_many": "строк",
123 "repo.binary_notice": "Бинарный файл — предпросмотр недоступен",
124 "repo.download_raw": "Скачать файл",
125 "repo.browse_at_commit": "Файлы на момент коммита",
126 "repo.files_changed": "файлов изменено",
127 "repo.files_changed_one": "файл изменён",
128 "repo.files_changed_few": "файла изменено",
129 "repo.files_changed_many": "файлов изменено",
130 "repo.no_commits": "Коммитов пока нет",
131 "repo.danger_zone": "Опасная зона",
132 "repo.delete": "Удалить репозиторий",
133 "repo.delete_desc": "Удаление необратимо: все файлы и история git будут стёрты.",
134 "repo.delete_confirm": "Введите название репозитория для подтверждения",
135 "repo.rename": "Переименовать",
136 "repo.save": "Сохранить",
137 "repo.branch.new": "Новая ветка",
138 "repo.branch.name_ph": "Имя ветки (напр. feat/ui)",
139 "repo.branch.from": "От ветки / коммита",
140 "repo.branch.create": "Создать ветку",
141 "repo.branch.default": "по умолчанию",
142 "repo.tag.new": "Новый тег / релиз",
143 "repo.tag.name_ph": "Тег (напр. v1.0.0)",
144 "repo.tag.msg_ph": "Описание тега (необязательно)",
145 "repo.tag.create": "Создать тег",
146 "repo.tags.empty": "Тегов пока нет",
147
148 // Pull Requests
149 "pulls.title": "Пул-реквесты",
150 "pulls.new": "Новый пул-реквест",
151 "pulls.empty": "Пул-реквестов пока нет",
152 "pulls.open": "Открыт",
153 "pulls.closed": "Закрыт",
154 "pulls.merged": "Слит",
155 "pulls.compare": "Сравнение веток",
156 "pulls.base": "Базовая ветка",
157 "pulls.head": "Ветка изменений",
158 "pulls.title_ph": "Заголовок пул-реквеста...",
159 "pulls.desc_ph": "Опишите предлагаемые изменения (Markdown)...",
160 "pulls.create_btn": "Создать пул-реквест",
161 "pulls.merge_btn": "Слить пул-реквест",
162 "pulls.can_merge": "Ветки можно объединить автоматически.",
163 "pulls.cannot_merge": "Невозможно объединить автоматически: обнаружены конфликты.",
164 "pulls.already_merged": "Ветка изменений уже объединена с базовой.",
165 "pulls.close_btn": "Закрыть PR",
166 "pulls.reopen_btn": "Открыть заново",
167 "pulls.comment_btn": "Прокомментировать",
168 "pulls.conversation": "Обсуждение",
169 "pulls.files_changed": "Изменения",
170 "pulls.commits": "Коммиты",
171 "pulls.able_to_merge": "Можно слить автоматически",
172 "pulls.body": "Описание",
173 "pulls.body_ph": "Опишите предлагаемые изменения (Markdown)...",
174 "pulls.branches_identical": "Ветки идентичны — сравнивать нечего",
175 "pulls.cannot_merge_warning": "Обнаружены конфликты — автоматическое слияние невозможно",
176 "pulls.closed_desc": "Ветка изменений не была объединена с базовой.",
177 "pulls.closed_message": "Пул-реквест закрыт",
178 "pulls.comment_ph": "Напишите комментарий (поддерживается Markdown)...",
179 "pulls.compare_branches": "Сравнение веток",
180 "pulls.conflicts_desc": "Разрешите конфликты локально и запушьте изменения в ветку.",
181 "pulls.conflicts_title": "Есть конфликты слияния",
182 "pulls.into": "в",
183 "pulls.merge_clean": "Конфликтов нет — изменения можно объединить.",
184 "pulls.merged_message": "Пул-реквест слит",
185 "pulls.no_changes": "Файлы не изменены",
186 "pulls.no_commits": "В этом пул-реквесте пока нет коммитов",
187 "pulls.only_write_merge": "Сливать пул-реквесты могут только пользователи с правом записи.",
188 "pulls.status.closed": "Закрыт",
189 "pulls.status.merged": "Слит",
190 "pulls.status.open": "Открыт",
191 "pulls.wants_to_merge": "хочет слить",
192
193 // Releases
194 "releases.title": "Релизы",
195 "releases.new": "Новый релиз",
196 "releases.empty": "Релизов пока нет",
197 "releases.tag_select": "Тег",
198 "releases.title_ph": "Название релиза",
199 "releases.desc_ph": "Описание релиза, список изменений (Markdown)...",
200 "releases.prerelease": "Пре-релиз (нестабильная сборка)",
201 "releases.publish": "Опубликовать релиз",
202 "releases.delete": "Удалить релиз",
203 "releases.assets": "Файлы",
204 "releases.source_zip": "Исходный код (zip)",
205 "releases.source_tar": "Исходный код (tar.gz)",
206 "releases.body": "Описание",
207 "releases.body_ph": "Опишите релиз, список изменений (Markdown)...",
208 "releases.count": "релизов",
209 "releases.count_one": "релиз",
210 "releases.count_few": "релиза",
211 "releases.count_many": "релизов",
212 "releases.delete_confirm": "Удалить этот релиз? Действие необратимо.",
213 "releases.is_prerelease": "Пре-релиз (нестабильная сборка)",
214 "releases.publish_btn": "Опубликовать релиз",
215 "releases.tag_desc": "Существующий тег или новый — он будет создан автоматически.",
216 "releases.tag_name": "Тег",
217 "releases.tags": "тегов",
218 "releases.tags_one": "тег",
219 "releases.tags_few": "тега",
220 "releases.tags_many": "тегов",
221 "releases.target": "Ветка",
222 "releases.target_desc": "Ветка или коммит, на который будет указывать тег.",
223
224 // Activity
225 "activity.title": "Активность",
226 "activity.pulse": "Сводка активности",
227 "activity.empty": "Активности пока нет",
228 "activity.commits": "коммитов",
229 "activity.open_prs": "открытых PR",
230 "activity.merged_prs": "слитых PR",
231 "activity.open_issues": "открытых задач",
232 "activity.releases": "релизов",
233 "activity.issues": "открыто и закрыто",
234 "activity.on_default_branch": "в ветке по умолчанию",
235 "activity.published_releases": "опубликованные релизы",
236 "activity.pull_requests": "открыто и слито",
237 "activity.recent_feed": "Лента активности",
238 "activity.badge_commit": "коммит",
239 "activity.badge_release": "релиз",
240
241 // Задачи (Issues)
242 "issue.new": "Новая задача",
243 "issue.title": "Заголовок",
244 "issue.title_ph": "Кратко опишите задачу или проблему",
245 "issue.body": "Описание",
246 "issue.body_ph": "Подробное описание (поддерживается Markdown)...",
247 "issue.create": "Создать задачу",
248 "issue.open": "Открытые",
249 "issue.closed": "Закрытые",
250 "issue.status.open": "Открыта",
251 "issue.status.closed": "Закрыта",
252 "issue.close_btn": "Закрыть задачу",
253 "issue.reopen_btn": "Переоткрыть",
254 "issue.comment_ph": "Напишите комментарий (поддерживается Markdown)...",
255 "issue.comment_btn": "Отправить",
256 "issue.empty": "Задач в этом списке нет",
257
258 // Настройки пользователя, профиль и токены
259 "settings.title": "Настройки",
260 "settings.profile": "Профиль",
261 "settings.avatar": "Аватар",
262 "settings.avatar_upload": "Выбрать изображение",
263 "settings.avatar_remove": "Удалить аватар",
264 "settings.avatar_hint": "PNG, JPG, WebP или GIF — автоматически кадрируется до 256×256",
265 "settings.full_name": "Отображаемое имя",
266 "settings.full_name_ph": "Ваше имя или ник",
267 "settings.bio": "О себе",
268 "settings.bio_ph": "Короткая подпись в профиле",
269 "settings.location": "Локация",
270 "settings.location_ph": "Город, страна",
271 "settings.website": "Сайт",
272 "settings.website_ph": "https://example.com",
273 "profile.edit": "Редактировать профиль",
274 "profile.joined": "Регистрация",
275 "profile.public_repos": "Публичные",
276 "profile.private_repos": "Приватные",
277 "profile.total_repos": "Репозитории",
278 "settings.tokens": "Токены доступа",
279 "settings.tokens.desc": "Используйте токен вместо пароля для git clone и git push по HTTP.",
280 "settings.token.name": "Название токена (например, Ноутбук)",
281 "settings.token.create": "Создать",
282 "settings.token.revoke": "Отозвать",
283 "settings.token.created_once": "Скопируйте токен сейчас — он показывается только один раз:",
284 "settings.token.col_name": "Название",
285 "settings.token.col_prefix": "Префикс",
286 "settings.token.col_created": "Создан",
287 "settings.token.col_used": "Использован",
288 "settings.token.empty": "Токенов доступа пока нет",
289 "settings.password.current": "Текущий пароль",
290 "settings.password.new": "Новый пароль",
291 "settings.password.update": "Обновить пароль",
292
293 // Админка
294 "admin.title": "Администрирование",
295 "admin.features": "Модули и доступ",
296 "admin.users": "Пользователи",
297 "admin.registration": "Публичная регистрация",
298 "admin.registration.desc": "Разрешить самостоятельную регистрацию новых аккаунтов",
299 "admin.explore": "Раздел «Обзор» (Explore)",
300 "admin.explore.desc": "Показывать каталог публичных репозиториев в сайдбаре и по адресу /explore",
301 "admin.landing": "Приветственная страница",
302 "admin.landing.desc": "Показывать лендинг на главной странице (если отключено — переход сразу к репозиториям или входу)",
303 "admin.anon_read": "Гостевой просмотр",
304 "admin.anon_read.desc": "Разрешить неавторизованным пользователям просматривать публичные репозитории и профили",
305 "admin.issues": "Трекер задач (Issues)",
306 "admin.issues.desc": "Включить вкладку «Задачи» в репозиториях",
307 "admin.enabled": "Включено",
308 "admin.disabled": "Отключено",
309 "admin.enable_btn": "Включить",
310 "admin.disable_btn": "Отключить",
311 "admin.col.user": "Пользователь",
312 "admin.col.repos": "Репозитории",
313 "admin.col.role": "Роль",
314 "admin.col.joined": "Дата",
315 "admin.role.admin": "Админ",
316 "admin.role.user": "Участник",
317
318 // Командная палитра и хоткеи
319 "palette.placeholder": "Поиск репозитория, файла или команды...",
320 "palette.group.nav": "Навигация",
321 "palette.group.themes": "Тема оформления",
322 "palette.group.repos": "Репозитории",
323 "shortcuts.title": "Горячие клавиши",
324 "shortcuts.palette": "Командная палитра",
325 "shortcuts.search": "Фокус на поиск",
326 "shortcuts.home": "На главную",
327 "shortcuts.repos": "Мои репозитории",
328 "shortcuts.files": "Фильтр файлов",
329 "shortcuts.sidebar": "Скрыть / показать сайдбар",
330 "nav.toggle_sidebar": "Сайдбар (Ctrl+B)",
331
332 // Флеш-сообщения
333 "flash.welcome": "Добро пожаловать в Polar, @%s!",
334 "flash.profile_updated": "Профиль обновлён.",
335 "flash.password_updated": "Пароль успешно изменён.",
336 "flash.token_revoked": "Токен доступа отозван.",
337 "flash.settings_updated": "Настройки сохранены.",
338 "flash.error": "Ошибка: %s",
339 "flash.comment_error": "Не удалось отправить комментарий: %s",
340 "flash.pr_created": "Пул-реквест #%d создан.",
341 "flash.pr_closed": "Пул-реквест #%d закрыт.",
342 "flash.pr_reopened": "Пул-реквест #%d открыт заново.",
343 "flash.pr_merged": "Пул-реквест #%d слит.",
344 "flash.pr_merged_state": "Нельзя изменить состояние слитого пул-реквеста.",
345 "flash.pr_merge_open_only": "Слить можно только открытый пул-реквест.",
346 "flash.pr_merge_failed": "Не удалось слить: %s",
347 "flash.release_tag_empty": "Имя тега не может быть пустым.",
348 "flash.release_tag_failed": "Не удалось создать тег: %s",
349 "flash.release_create_failed": "Не удалось создать релиз: %s",
350 "flash.release_published": "Релиз %s опубликован.",
351 "flash.release_delete_failed": "Не удалось удалить релиз: %s",
352 "flash.release_deleted": "Релиз удалён.",
353 "flash.repo_settings_saved": "Настройки репозитория сохранены.",
354 "flash.repo_rename_failed": "Не удалось переименовать: %s",
355 "flash.repo_renamed": "Репозиторий переименован в %s.",
356 "flash.repo_confirm_mismatch": "Введённое имя не совпадает с названием репозитория.",
357 "flash.repo_deleted": "Репозиторий %s удалён.",
358 "flash.branch_created": "Ветка %s создана.",
359 "flash.branch_create_failed": "Не удалось создать ветку: %s",
360 "flash.branch_default_delete": "Нельзя удалить ветку по умолчанию.",
361 "flash.branch_deleted": "Ветка %s удалена.",
362 "flash.branch_delete_failed": "Не удалось удалить ветку: %s",
363 "flash.tag_created": "Тег %s создан.",
364 "flash.tag_create_failed": "Не удалось создать тег: %s",
365 "flash.tag_deleted": "Тег %s удалён.",
366 "flash.tag_delete_failed": "Не удалось удалить тег: %s",
367 "flash.issue_closed": "Задача #%d закрыта.",
368 "flash.issue_reopened": "Задача #%d открыта заново.",
369
370 // Ошибочные страницы
371 "err.not_found": "Не найдено",
372 "err.forbidden": "Доступ запрещён",
373 "err.session_error": "Ошибка сессии",
374 "err.session_create": "Не удалось создать сессию.",
375 "err.settings_error": "Ошибка настроек",
376 "err.settings_save": "Не удалось сохранить настройку.",
377 "err.explore_disabled": "Раздел «Обзор» отключён на этом сервере.",
378 "err.activity_disabled": "Активность отключена для этого репозитория.",
379 "err.pulls_disabled": "Пул-реквесты отключены для этого репозитория.",
380 "err.releases_disabled": "Релизы отключены для этого репозитория.",
381 "err.issues_disabled": "Задачи отключены для этого репозитория.",
382 "err.repo_not_found": "Репозиторий не найден",
383 "err.repo_not_found_desc": "Репозиторий не существует или у вас нет к нему доступа.",
384 "err.repo_private_desc": "Репозиторий не существует или является приватным.",
385 "err.access_denied": "Доступ запрещён",
386 "err.repo_write_denied": "У вас нет прав на изменение этого репозитория.",
387 "err.invalid_repo_path": "Некорректный путь репозитория",
388 "err.path_not_found": "Путь не найден",
389 "err.path_not_found_desc": "Не удалось найти путь в репозитории для ссылки %s",
390 "err.file_not_found": "Файл не найден",
391 "err.file_not_found_desc": "Запрошенный файл не найден в %s",
392 "err.commit_not_found": "Коммит не найден",
393 "err.commit_not_found_desc": "Не удалось найти коммит %s",
394 "err.pr_not_found": "Пул-реквест не найден",
395 "err.pr_not_found_desc": "Не удалось найти пул-реквест.",
396 "err.pr_state_forbidden": "Вы не можете изменить состояние этого пул-реквеста.",
397 "err.pr_merge_forbidden": "У вас нет прав на слияние пул-реквестов.",
398 "err.issue_not_found": "Задача не найдена",
399 "err.issue_not_found_desc": "Не удалось найти задачу.",
400 "err.issue_state_forbidden": "Вы не можете изменить состояние этой задачи.",
401 "err.delete_error": "Ошибка удаления",
402 "err.repo_delete_failed": "Не удалось удалить репозиторий.",
403 "err.user_not_found": "Пользователь @%s не существует.",
404 "err.archive_error": "Ошибка архива",
405 "err.archive_tar_failed": "Не удалось создать tar.gz архив для %s",
406 "err.archive_zip_failed": "Не удалось создать zip архив для %s",
407
408 // Форки
409 "fork.forked_from": "форк от",
410 "fork.forks": "Форки",
411 "fork.forks_btn": "Форки",
412 "fork.fork_btn": "Форк",
413 "fork.fork_btn_desc": "Создать форк этого репозитория",
414 "fork.your_fork": "Ваш форк",
415 "fork.your_fork_desc": "Перейти к вашему форку",
416 "forks.title": "Форки",
417 "forks.empty": "Пока никто не форкал этот репозиторий.",
418
419 // Коллабораторы
420 "collab.title": "Коллабораторы",
421 "collab.desc": "Люди с доступом к репозиторию",
422 "collab.owner": "Владелец",
423 "collab.role": "Роль",
424 "collab.role_read": "Чтение",
425 "collab.role_write": "Запись",
426 "collab.username": "Пользователь",
427 "collab.username_ph": "username",
428 "collab.add": "Добавить",
429 "collab.remove": "Убрать доступ",
430 "collab.empty": "Коллабораторов пока нет.",
431
432 // Ревью
433 "reviews.title": "Ревью",
434 "reviews.approved": "Одобрено",
435 "reviews.changes_requested": "Запрошены изменения",
436 "reviews.body_ph": "Комментарий к ревью (необязательно)",
437 "reviews.approve": "Одобрить",
438 "reviews.request_changes": "Запросить изменения",
439
440 // Device flow (RFC 8628)
441 "device.title": "Подключение устройства",
442 "device.badge": "Git",
443 "device.desc": "Введите код, который показал git или скрипт-помощник, чтобы выдать устройству доступ к вашему аккаунту.",
444 "device.check": "Проверить",
445 "device.authorize_for": "Выдать доступ по коду",
446 "device.scope_hint": "Доступ даётся на чтение и запись репозиториев, к которым у вас есть права, и действует только для этого устройства.",
447 "device.approve": "Разрешить",
448 "device.deny": "Отклонить",
449 "device.signin_to_approve": "Войдите, чтобы подтвердить доступ",
450 "device.helper_hint": "Подсказка: настройте credential helper, чтобы код запрашивался автоматически — см. README.",
451 "device.code_unknown": "Код не найден. Проверьте, что он введён верно.",
452 "device.code_used": "Этот код уже использован или истёк.",
453 "device.approved_now": "Готово! Устройство подключено — вернитесь в терминал.",
454 "device.denied_now": "Запрос отклонён. Устройство не получит доступ.",
455
456 // Flash: форки, коллабораторы, ревью, device flow
457 "flash.fork_self": "Это ваш репозиторий — форк не нужен.",
458 "flash.fork_exists": "У вас уже есть форк этого репозитория.",
459 "flash.fork_created": "Форк создан.",
460 "flash.fork_failed": "Не удалось создать форк: %s",
461 "flash.collab_added": "@%s добавлен в коллабораторы.",
462 "flash.collab_removed": "Доступ коллаборатора отозван.",
463 "flash.collab_failed": "Не удалось изменить коллаборатора: %s",
464 "flash.review_self": "Нельзя ревьюить собственный пул-реквест.",
465 "flash.review_closed": "Ревью доступно только для открытых пул-реквестов.",
466 "flash.review_failed": "Не удалось сохранить ревью: %s",
467 "flash.review_approved": "Ревью сохранено: одобрено.",
468 "flash.review_changes_requested": "Ревью сохранено: запрошены изменения.",
469 "flash.device_code_required": "Введите код устройства.",
470 "flash.device_code_invalid": "Код не найден, истёк или уже использован.",
471 "flash.device_approved": "Устройство авторизовано — можно возвращаться к git.",
472 "flash.device_denied": "Запрос отклонён.",
473
474 // Прочее
475 "issues.new": "Новая задача",
476 "pulls.head_repo": "Из репозитория",
477 "repo.about": "О репозитории",
478 "repo.clone_title": "Клонирование",
479 "repo.created": "Создан",
480 "repo.updated": "Обновлён",
481 "repo.view_file": "Открыть",
482 "err.collab_forbidden": "Управлять коллабораторами может только владелец или администратор.",
483 "err.pr_head_repo_invalid": "Выбран недопустимый репозиторий-источник."},
484 EN: {
485 // Navigation & Common
486 "app.tagline": "Lightweight self-hosted Git hosting",
487 "nav.home": "Home",
488 "nav.repositories": "Repositories",
489 "nav.explore": "Explore",
490 "nav.settings": "Settings",
491 "nav.admin": "Admin",
492 "nav.login": "Sign in",
493 "nav.register": "Sign up",
494 "nav.logout": "Sign out",
495 "nav.new_repo": "New",
496 "nav.command_palette": "Search & commands",
497 "nav.search_placeholder": "Search...",
498 "nav.theme": "Theme",
499 "nav.lang": "Language",
500 "common.copy": "Copy",
501 "common.copied": "Copied",
502 "common.cancel": "Cancel",
503 "common.save": "Save",
504 "common.delete": "Delete",
505 "common.close": "Close",
506 "common.never": "Never",
507 "common.newer": "Newer",
508 "common.older": "Older",
509 "common.up": "Up",
510
511 // Themes (only 3)
512 "theme.light": "Light",
513 "theme.dark": "Dark",
514 "theme.system": "System",
515
516 // Landing
517 "landing.badge": "Single Binary · SQLite · Zero Dependencies",
518 "landing.hero.title": "Lightweight self-hosted Git hosting",
519 "landing.hero.subtitle": "A single Go binary backed by SQLite. Deploys in a minute, uses minimal memory, and stays out of your way.",
520 "landing.hero.cta_start": "Get Started",
521 "landing.features.title": "Principles",
522 "landing.feat1.title": "Single Binary",
523 "landing.feat1.desc": "Templates, styles, fonts, migrations, and icons are compiled in via go:embed.",
524 "landing.feat2.title": "SQLite (WAL)",
525 "landing.feat2.desc": "Your entire database is a single data/polar.db file without CGO. Back up by copying.",
526 "landing.feat3.title": "Fast & Quiet",
527 "landing.feat3.desc": "Instant cold start, server-side rendering, and < 30 MB idle memory.",
528 "landing.feat4.title": "Private by Default",
529 "landing.feat4.desc": "Public and private repositories, Argon2id passwords, and Git HTTP access tokens.",
530
531 // Auth
532 "auth.login.title": "Sign in",
533 "auth.register.title": "Create account",
534 "auth.register.disabled": "Public registration is disabled by the administrator.",
535 "auth.username": "Username",
536 "auth.username_hint": "2–32 characters: letters, digits, hyphen, underscore",
537 "auth.username_or_email": "Username or Email",
538 "auth.email": "Email",
539 "auth.password": "Password",
540 "auth.password_hint": "At least 8 characters",
541 "auth.submit_login": "Sign in",
542 "auth.submit_register": "Create account",
543 "auth.no_account": "No account?",
544 "auth.have_account": "Have an account?",
545 "auth.invalid_creds": "Invalid username/email or password",
546
547 // Repositories
548 "repo.new.title": "New repository",
549 "repo.name": "Name",
550 "repo.name_hint": "Letters, digits, '.', '-', '_'",
551 "repo.description": "Description",
552 "repo.description_ph": "Short description (optional)",
553 "repo.visibility": "Visibility",
554 "repo.public": "Public",
555 "repo.public_desc": "Anyone can view and clone this repository",
556 "repo.private": "Private",
557 "repo.private_desc": "Accessible only to you",
558 "repo.create_btn": "Create repository",
559 "repo.filter_ph": "Filter repositories...",
560 "repo.empty_list": "No repositories yet",
561 "repo.empty_list_sub": "Create your first repository to push code.",
562 "repo.empty.title": "Repository is empty",
563 "repo.empty.new_cmd": "Create a new repository on the command line",
564 "repo.empty.push_cmd": "Push an existing repository",
565 "repo.tab.code": "Code",
566 "repo.tab.commits": "Commits",
567 "repo.tab.branches": "Branches & Tags",
568 "repo.tab.issues": "Issues",
569 "repo.tab.pulls": "Pull requests",
570 "repo.tab.releases": "Releases",
571 "repo.tab.activity": "Activity",
572 "repo.tab.settings": "Settings",
573 "repo.features": "Repository Features",
574 "repo.clone": "Clone",
575 "repo.download_zip": "Download ZIP",
576 "repo.branches": "Branches",
577 "repo.tags": "Tags",
578 "repo.default_branch": "Default branch",
579 "repo.find_file": "Filter files...",
580 "repo.files": "Files",
581 "repo.readme": "README",
582 "repo.raw": "Raw",
583 "repo.history": "History",
584 "repo.lines": "lines",
585 "repo.lines_one": "line",
586 "repo.lines_few": "lines",
587 "repo.lines_many": "lines",
588 "repo.binary_notice": "Binary file — inline preview unavailable",
589 "repo.download_raw": "Download file",
590 "repo.browse_at_commit": "Browse files",
591 "repo.files_changed": "files changed",
592 "repo.files_changed_one": "file changed",
593 "repo.files_changed_few": "files changed",
594 "repo.files_changed_many": "files changed",
595 "repo.no_commits": "No commits yet",
596 "repo.danger_zone": "Danger Zone",
597 "repo.delete": "Delete repository",
598 "repo.delete_desc": "Once deleted, the repository and its git history cannot be recovered.",
599 "repo.delete_confirm": "Type the repository name to confirm",
600 "repo.rename": "Rename",
601 "repo.save": "Save",
602 "repo.branch.new": "New branch",
603 "repo.branch.name_ph": "Branch name (e.g. feat/ui)",
604 "repo.branch.from": "From branch / ref",
605 "repo.branch.create": "Create branch",
606 "repo.branch.default": "default",
607 "repo.tag.new": "New tag / release",
608 "repo.tag.name_ph": "Tag (e.g. v1.0.0)",
609 "repo.tag.msg_ph": "Tag note (optional)",
610 "repo.tag.create": "Create tag",
611 "repo.tags.empty": "No tags yet",
612
613 // Pull Requests
614 "pulls.title": "Pull requests",
615 "pulls.new": "New pull request",
616 "pulls.empty": "No pull requests yet",
617 "pulls.open": "Open",
618 "pulls.closed": "Closed",
619 "pulls.merged": "Merged",
620 "pulls.compare": "Comparing changes",
621 "pulls.base": "base",
622 "pulls.head": "compare",
623 "pulls.title_ph": "Pull request title...",
624 "pulls.desc_ph": "Describe your changes (Markdown supported)...",
625 "pulls.create_btn": "Create pull request",
626 "pulls.merge_btn": "Merge pull request",
627 "pulls.can_merge": "Able to merge automatically.",
628 "pulls.cannot_merge": "Can't automatically merge: conflicts detected.",
629 "pulls.already_merged": "The head branch is already merged into base.",
630 "pulls.close_btn": "Close PR",
631 "pulls.reopen_btn": "Reopen PR",
632 "pulls.comment_btn": "Comment",
633 "pulls.conversation": "Conversation",
634 "pulls.files_changed": "Files changed",
635 "pulls.commits": "Commits",
636 "pulls.able_to_merge": "Able to merge automatically",
637 "pulls.body": "Description",
638 "pulls.body_ph": "Describe your changes (Markdown supported)...",
639 "pulls.branches_identical": "Branches are identical — nothing to compare",
640 "pulls.cannot_merge_warning": "Conflicts detected — automatic merge is not possible",
641 "pulls.closed_desc": "The head branch was not merged into base.",
642 "pulls.closed_message": "Pull request closed",
643 "pulls.comment_ph": "Write a comment (Markdown supported)...",
644 "pulls.compare_branches": "Comparing branches",
645 "pulls.conflicts_desc": "Resolve the conflicts locally and push to the head branch.",
646 "pulls.conflicts_title": "Merge conflicts detected",
647 "pulls.into": "into",
648 "pulls.merge_clean": "No conflicts — changes can be merged.",
649 "pulls.merged_message": "Pull request merged",
650 "pulls.no_changes": "No files changed",
651 "pulls.no_commits": "No commits in this pull request yet",
652 "pulls.only_write_merge": "Only users with write access can merge pull requests.",
653 "pulls.status.closed": "Closed",
654 "pulls.status.merged": "Merged",
655 "pulls.status.open": "Open",
656 "pulls.wants_to_merge": "wants to merge",
657
658 // Releases
659 "releases.title": "Releases",
660 "releases.new": "Draft a new release",
661 "releases.empty": "No releases yet",
662 "releases.tag_select": "Tag",
663 "releases.title_ph": "Release title",
664 "releases.desc_ph": "Describe this release, release notes (Markdown)...",
665 "releases.prerelease": "This is a pre-release",
666 "releases.publish": "Publish release",
667 "releases.delete": "Delete release",
668 "releases.assets": "Assets",
669 "releases.source_zip": "Source code (zip)",
670 "releases.source_tar": "Source code (tar.gz)",
671 "releases.body": "Description",
672 "releases.body_ph": "Describe this release, release notes (Markdown)...",
673 "releases.count": "releases",
674 "releases.count_one": "release",
675 "releases.count_few": "releases",
676 "releases.count_many": "releases",
677 "releases.delete_confirm": "Delete this release? This cannot be undone.",
678 "releases.is_prerelease": "This is a pre-release",
679 "releases.publish_btn": "Publish release",
680 "releases.tag_desc": "An existing tag or a new one — it will be created automatically.",
681 "releases.tag_name": "Tag",
682 "releases.tags": "tags",
683 "releases.tags_one": "tag",
684 "releases.tags_few": "tags",
685 "releases.tags_many": "tags",
686 "releases.target": "Branch",
687 "releases.target_desc": "Branch or commit the tag will point to.",
688
689 // Activity
690 "activity.title": "Activity",
691 "activity.pulse": "Activity overview",
692 "activity.empty": "No recent activity recorded.",
693 "activity.commits": "commits",
694 "activity.open_prs": "open PRs",
695 "activity.merged_prs": "merged PRs",
696 "activity.open_issues": "open issues",
697 "activity.releases": "releases",
698 "activity.issues": "opened and closed",
699 "activity.on_default_branch": "on the default branch",
700 "activity.published_releases": "published releases",
701 "activity.pull_requests": "opened and merged",
702 "activity.recent_feed": "Activity feed",
703 "activity.badge_commit": "commit",
704 "activity.badge_release": "release",
705
706 // Issues
707 "issue.new": "New issue",
708 "issue.title": "Title",
709 "issue.title_ph": "Brief summary of the issue",
710 "issue.body": "Description",
711 "issue.body_ph": "Detailed description (Markdown supported)...",
712 "issue.create": "Create issue",
713 "issue.open": "Open",
714 "issue.closed": "Closed",
715 "issue.status.open": "Open",
716 "issue.status.closed": "Closed",
717 "issue.close_btn": "Close issue",
718 "issue.reopen_btn": "Reopen",
719 "issue.comment_ph": "Write a comment (Markdown supported)...",
720 "issue.comment_btn": "Comment",
721 "issue.empty": "No issues in this list",
722
723 // Settings, Profile & Tokens
724 "settings.title": "Settings",
725 "settings.profile": "Profile",
726 "settings.avatar": "Avatar",
727 "settings.avatar_upload": "Choose image",
728 "settings.avatar_remove": "Remove avatar",
729 "settings.avatar_hint": "PNG, JPG, WebP, or GIF — automatically cropped to 256×256",
730 "settings.full_name": "Display name",
731 "settings.full_name_ph": "Your name",
732 "settings.bio": "Bio",
733 "settings.bio_ph": "Short profile bio",
734 "settings.location": "Location",
735 "settings.location_ph": "City, Country",
736 "settings.website": "Website",
737 "settings.website_ph": "https://example.com",
738 "profile.edit": "Edit profile",
739 "profile.joined": "Joined",
740 "profile.public_repos": "Public",
741 "profile.private_repos": "Private",
742 "profile.total_repos": "Repositories",
743 "settings.tokens": "Access Tokens",
744 "settings.tokens.desc": "Use a token instead of your password for git clone and git push over HTTP.",
745 "settings.token.name": "Token name (e.g., Laptop)",
746 "settings.token.create": "Create",
747 "settings.token.revoke": "Revoke",
748 "settings.token.created_once": "Copy this token now — it will only be shown once:",
749 "settings.token.col_name": "Name",
750 "settings.token.col_prefix": "Prefix",
751 "settings.token.col_created": "Created",
752 "settings.token.col_used": "Last used",
753 "settings.token.empty": "No access tokens yet",
754 "settings.password.current": "Current password",
755 "settings.password.new": "New password",
756 "settings.password.update": "Update password",
757
758 // Admin
759 "admin.title": "Administration",
760 "admin.features": "Features & Access",
761 "admin.users": "Users",
762 "admin.registration": "Public registration",
763 "admin.registration.desc": "Allow new users to create accounts",
764 "admin.explore": "Explore page",
765 "admin.explore.desc": "Show public repository directory in sidebar and at /explore",
766 "admin.landing": "Landing page",
767 "admin.landing.desc": "Show landing page on root URL (if disabled, redirects to repos or sign in)",
768 "admin.anon_read": "Anonymous read access",
769 "admin.anon_read.desc": "Allow unauthenticated guests to browse public repositories and profiles",
770 "admin.issues": "Issue tracker",
771 "admin.issues.desc": "Enable the Issues tab inside repositories",
772 "admin.enabled": "Enabled",
773 "admin.disabled": "Disabled",
774 "admin.enable_btn": "Enable",
775 "admin.disable_btn": "Disable",
776 "admin.col.user": "User",
777 "admin.col.repos": "Repos",
778 "admin.col.role": "Role",
779 "admin.col.joined": "Joined",
780 "admin.role.admin": "Admin",
781 "admin.role.user": "User",
782
783 // Command Palette & Shortcuts
784 "palette.placeholder": "Search repositories, files, or commands...",
785 "palette.group.nav": "Navigation",
786 "palette.group.themes": "Theme",
787 "palette.group.repos": "Repositories",
788 "shortcuts.title": "Keyboard shortcuts",
789 "shortcuts.palette": "Command palette",
790 "shortcuts.search": "Focus search",
791 "shortcuts.home": "Go home",
792 "shortcuts.repos": "Repositories",
793 "shortcuts.files": "Filter files",
794 "shortcuts.sidebar": "Toggle sidebar",
795 "nav.toggle_sidebar": "Sidebar (Ctrl+B)",
796
797 // Flash messages
798 "flash.welcome": "Welcome to Polar, @%s!",
799 "flash.profile_updated": "Profile updated.",
800 "flash.password_updated": "Password changed successfully.",
801 "flash.token_revoked": "Access token revoked.",
802 "flash.settings_updated": "Settings saved.",
803 "flash.error": "Error: %s",
804 "flash.comment_error": "Could not post the comment: %s",
805 "flash.pr_created": "Pull request #%d created.",
806 "flash.pr_closed": "Pull request #%d closed.",
807 "flash.pr_reopened": "Pull request #%d reopened.",
808 "flash.pr_merged": "Pull request #%d merged.",
809 "flash.pr_merged_state": "Cannot change the state of a merged pull request.",
810 "flash.pr_merge_open_only": "Only an open pull request can be merged.",
811 "flash.pr_merge_failed": "Could not merge: %s",
812 "flash.release_tag_empty": "Tag name cannot be empty.",
813 "flash.release_tag_failed": "Could not create the tag: %s",
814 "flash.release_create_failed": "Could not create the release: %s",
815 "flash.release_published": "Release %s published.",
816 "flash.release_delete_failed": "Could not delete the release: %s",
817 "flash.release_deleted": "Release deleted.",
818 "flash.repo_settings_saved": "Repository settings saved.",
819 "flash.repo_rename_failed": "Could not rename: %s",
820 "flash.repo_renamed": "Repository renamed to %s.",
821 "flash.repo_confirm_mismatch": "The name you typed does not match the repository name.",
822 "flash.repo_deleted": "Repository %s deleted.",
823 "flash.branch_created": "Branch %s created.",
824 "flash.branch_create_failed": "Could not create the branch: %s",
825 "flash.branch_default_delete": "The default branch cannot be deleted.",
826 "flash.branch_deleted": "Branch %s deleted.",
827 "flash.branch_delete_failed": "Could not delete the branch: %s",
828 "flash.tag_created": "Tag %s created.",
829 "flash.tag_create_failed": "Could not create the tag: %s",
830 "flash.tag_deleted": "Tag %s deleted.",
831 "flash.tag_delete_failed": "Could not delete the tag: %s",
832 "flash.issue_closed": "Issue #%d closed.",
833 "flash.issue_reopened": "Issue #%d reopened.",
834
835 // Error pages
836 "err.not_found": "Not found",
837 "err.forbidden": "Access denied",
838 "err.session_error": "Session error",
839 "err.session_create": "Could not create a session.",
840 "err.settings_error": "Settings error",
841 "err.settings_save": "Could not save the setting.",
842 "err.explore_disabled": "Explore is disabled on this server.",
843 "err.activity_disabled": "Activity is disabled for this repository.",
844 "err.pulls_disabled": "Pull requests are disabled for this repository.",
845 "err.releases_disabled": "Releases are disabled for this repository.",
846 "err.issues_disabled": "Issues are disabled for this repository.",
847 "err.repo_not_found": "Repository not found",
848 "err.repo_not_found_desc": "The repository does not exist or you do not have access to it.",
849 "err.repo_private_desc": "The repository does not exist or is private.",
850 "err.access_denied": "Access denied",
851 "err.repo_write_denied": "You do not have permission to modify this repository.",
852 "err.invalid_repo_path": "Invalid repository path",
853 "err.path_not_found": "Path not found",
854 "err.path_not_found_desc": "Could not find the path in the repository for ref %s",
855 "err.file_not_found": "File not found",
856 "err.file_not_found_desc": "The requested file was not found in %s",
857 "err.commit_not_found": "Commit not found",
858 "err.commit_not_found_desc": "Could not find commit %s",
859 "err.pr_not_found": "Pull request not found",
860 "err.pr_not_found_desc": "Could not find the pull request.",
861 "err.pr_state_forbidden": "You cannot change the state of this pull request.",
862 "err.pr_merge_forbidden": "You do not have permission to merge pull requests.",
863 "err.issue_not_found": "Issue not found",
864 "err.issue_not_found_desc": "Could not find the issue.",
865 "err.issue_state_forbidden": "You cannot change the state of this issue.",
866 "err.delete_error": "Delete error",
867 "err.repo_delete_failed": "Could not delete the repository.",
868 "err.user_not_found": "User @%s does not exist.",
869 "err.archive_error": "Archive error",
870 "err.archive_tar_failed": "Could not create a tar.gz archive for %s",
871 "err.archive_zip_failed": "Could not create a zip archive for %s",
872
873 // Forks
874 "fork.forked_from": "forked from",
875 "fork.forks": "Forks",
876 "fork.forks_btn": "Forks",
877 "fork.fork_btn": "Fork",
878 "fork.fork_btn_desc": "Create a fork of this repository",
879 "fork.your_fork": "Your fork",
880 "fork.your_fork_desc": "Go to your fork",
881 "forks.title": "Forks",
882 "forks.empty": "Nobody has forked this repository yet.",
883
884 // Collaborators
885 "collab.title": "Collaborators",
886 "collab.desc": "People with access to this repository",
887 "collab.owner": "Owner",
888 "collab.role": "Role",
889 "collab.role_read": "Read",
890 "collab.role_write": "Write",
891 "collab.username": "User",
892 "collab.username_ph": "username",
893 "collab.add": "Add",
894 "collab.remove": "Revoke access",
895 "collab.empty": "No collaborators yet.",
896
897 // Reviews
898 "reviews.title": "Reviews",
899 "reviews.approved": "Approved",
900 "reviews.changes_requested": "Changes requested",
901 "reviews.body_ph": "Review comment (optional)",
902 "reviews.approve": "Approve",
903 "reviews.request_changes": "Request changes",
904
905 // Device flow (RFC 8628)
906 "device.title": "Device authorization",
907 "device.badge": "Git",
908 "device.desc": "Enter the code shown by git or the credential helper to grant this device access to your account.",
909 "device.check": "Check",
910 "device.authorize_for": "Grant access to code",
911 "device.scope_hint": "Access covers repositories you can already reach and is bound to this device only.",
912 "device.approve": "Approve",
913 "device.deny": "Deny",
914 "device.signin_to_approve": "Sign in to approve access",
915 "device.helper_hint": "Tip: configure the credential helper so the code is requested automatically — see the README.",
916 "device.code_unknown": "Code not found. Double-check the code you entered.",
917 "device.code_used": "This code has already been used or expired.",
918 "device.approved_now": "All set! The device is authorized — return to your terminal.",
919 "device.denied_now": "Request denied. The device will not get access.",
920
921 // Flash: forks, collaborators, reviews, device flow
922 "flash.fork_self": "This repository is yours — no fork needed.",
923 "flash.fork_exists": "You already have a fork of this repository.",
924 "flash.fork_created": "Fork created.",
925 "flash.fork_failed": "Could not create fork: %s",
926 "flash.collab_added": "@%s added as a collaborator.",
927 "flash.collab_removed": "Collaborator access revoked.",
928 "flash.collab_failed": "Could not update collaborator: %s",
929 "flash.review_self": "You cannot review your own pull request.",
930 "flash.review_closed": "Reviews are only available on open pull requests.",
931 "flash.review_failed": "Could not save the review: %s",
932 "flash.review_approved": "Review saved: approved.",
933 "flash.review_changes_requested": "Review saved: changes requested.",
934 "flash.device_code_required": "Enter the device code.",
935 "flash.device_code_invalid": "Code not found, expired, or already used.",
936 "flash.device_approved": "Device authorized — you can return to git.",
937 "flash.device_denied": "Request denied.",
938
939 // Misc
940 "issues.new": "New issue",
941 "pulls.head_repo": "From repository",
942 "repo.about": "About",
943 "repo.clone_title": "Clone",
944 "repo.created": "Created",
945 "repo.updated": "Updated",
946 "repo.view_file": "Open",
947 "err.collab_forbidden": "Only the owner or an administrator can manage collaborators.",
948 "err.pr_head_repo_invalid": "The selected source repository is not allowed."},
949 }
950
951 func T(lang Lang, key string) string {
952 dict, ok := translations[Normalize(string(lang))]
953 if !ok {
954 dict = translations[RU]
955 }
956 if val, ok := dict[key]; ok {
957 return val
958 }
959 if val, ok := translations[RU][key]; ok {
960 return val
961 }
962 return key
963 }
964