From 8c5c5f9130c65fcc48412a24b0a6c98b254f1934 Mon Sep 17 00:00:00 2001
From: makondratev <69584771+makondratev@users.noreply.github.com>
Date: Sun, 18 Feb 2024 18:54:37 +0000
Subject: [PATCH] feat(i18n): add Russian (#886)

---
 quartz/i18n/locales/ru-RU.ts |   95 +++++++++++++++++++++++++++++++++++++++++++++++
 quartz/i18n/index.ts         |    2 +
 2 files changed, 97 insertions(+), 0 deletions(-)

diff --git a/quartz/i18n/index.ts b/quartz/i18n/index.ts
index c4fa425..1e4853f 100644
--- a/quartz/i18n/index.ts
+++ b/quartz/i18n/index.ts
@@ -8,6 +8,7 @@
 import es from "./locales/es-ES"
 import ar from "./locales/ar-SA"
 import uk from "./locales/uk-UA"
+import ru from "./locales/ru-RU"
 
 export const TRANSLATIONS = {
   "en-US": en,
@@ -40,6 +41,7 @@
   "ar-DZ": ar,
   "ar-MR": ar,
   "uk-UA": uk,
+  "ru-RU": ru,
 } as const
 
 export const defaultTranslation = "en-US"
diff --git a/quartz/i18n/locales/ru-RU.ts b/quartz/i18n/locales/ru-RU.ts
new file mode 100644
index 0000000..8ead3ca
--- /dev/null
+++ b/quartz/i18n/locales/ru-RU.ts
@@ -0,0 +1,95 @@
+import { Translation } from "./definition"
+
+export default {
+  propertyDefaults: {
+    title: "Без названия",
+    description: "Описание отсутствует",
+  },
+  components: {
+    callout: {
+      note: "Заметка",
+      abstract: "Резюме",
+      info: "Инфо",
+      todo: "Сделать",
+      tip: "Подсказка",
+      success: "Успех",
+      question: "Вопрос",
+      warning: "Предупреждение",
+      failure: "Неудача",
+      danger: "Опасность",
+      bug: "Баг",
+      example: "Пример",
+      quote: "Цитата",
+    },
+    backlinks: {
+      title: "Обратные ссылки",
+      noBacklinksFound: "Обратные ссылки отсутствуют",
+    },
+    themeToggle: {
+      lightMode: "Светлый режим",
+      darkMode: "Тёмный режим",
+    },
+    explorer: {
+      title: "Проводник",
+    },
+    footer: {
+      createdWith: "Создано с помощью",
+    },
+    graph: {
+      title: "Вид графа",
+    },
+    recentNotes: {
+      title: "Недавние заметки",
+      seeRemainingMore: ({ remaining }) =>
+        `Посмотреть оставш${getForm(remaining, "уюся", "иеся", "иеся")} ${remaining} →`,
+    },
+    transcludes: {
+      transcludeOf: ({ targetSlug }) => `Переход из ${targetSlug}`,
+      linkToOriginal: "Ссылка на оригинал",
+    },
+    search: {
+      title: "Поиск",
+      searchBarPlaceholder: "Найти что-нибудь",
+    },
+    tableOfContents: {
+      title: "Оглавление",
+    },
+    contentMeta: {
+      readingTime: ({ minutes }) => `время чтения ~${minutes} мин.`,
+    },
+  },
+  pages: {
+    rss: {
+      recentNotes: "Недавние заметки",
+      lastFewNotes: ({ count }) =>
+        `Последн${getForm(count, "яя", "ие", "ие")} ${count} замет${getForm(count, "ка", "ки", "ок")}`,
+    },
+    error: {
+      title: "Страница не найдена",
+      notFound: "Эта страница приватная или не существует",
+    },
+    folderContent: {
+      folder: "Папка",
+      itemsUnderFolder: ({ count }) =>
+        `в этой папке ${count} элемент${getForm(count, "", "а", "ов")}`,
+    },
+    tagContent: {
+      tag: "Тег",
+      tagIndex: "Индекс тегов",
+      itemsUnderTag: ({ count }) => `с этим тегом ${count} элемент${getForm(count, "", "а", "ов")}`,
+      showingFirst: ({ count }) =>
+        `Показыва${getForm(count, "ется", "ются", "ются")} ${count} тег${getForm(count, "", "а", "ов")}`,
+      totalTags: ({ count }) => `Всего ${count} тег${getForm(count, "", "а", "ов")}`,
+    },
+  },
+} as const satisfies Translation
+
+function getForm(number: number, form1: string, form2: string, form5: string): string {
+  const remainder100 = number % 100
+  const remainder10 = remainder100 % 10
+
+  if (remainder100 >= 10 && remainder100 <= 20) return form5
+  if (remainder10 > 1 && remainder10 < 5) return form2
+  if (remainder10 == 1) return form1
+  return form5
+}

--
Gitblit v1.10.0