Skip to content

Commit 5832402

Browse files
dragomanoaltrusl
andauthored
docs(ru): add Russian translation (#3709)
Co-authored-by: Ruslan Makarov <[email protected]>
1 parent 3113dad commit 5832402

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+7020
-2
lines changed

Diff for: docs/.vitepress/config/index.ts

+2
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,15 @@ import { shared } from './shared'
33
import { en } from './en'
44
import { zh } from './zh'
55
import { pt } from './pt'
6+
import { ru } from './ru'
67

78
export default defineConfig({
89
...shared,
910
locales: {
1011
root: { label: 'English', ...en },
1112
zh: { label: '简体中文', ...zh },
1213
pt: { label: 'Português', ...pt },
14+
ru: { label: 'Русский', ...ru },
1315
ko: { label: '한국어', lang: 'ko-KR', link: 'https://vitepress.vuejs.kr/' }
1416
}
1517
})

Diff for: docs/.vitepress/config/ru.ts

+208
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,208 @@
1+
import { createRequire } from 'module'
2+
import { defineConfig, type DefaultTheme } from 'vitepress'
3+
4+
const require = createRequire(import.meta.url)
5+
const pkg = require('vitepress/package.json')
6+
7+
export const ru = defineConfig({
8+
lang: 'ru-RU',
9+
description: 'Генератор статических сайтов на основе Vite и Vue.',
10+
11+
themeConfig: {
12+
nav: nav(),
13+
14+
sidebar: {
15+
'/ru/guide/': { base: '/ru/guide/', items: sidebarGuide() },
16+
'/ru/reference/': { base: '/ru/reference/', items: sidebarReference() }
17+
},
18+
19+
editLink: {
20+
pattern: 'https://github.com/vuejs/vitepress/edit/main/docs/:path',
21+
text: 'Редактировать страницу'
22+
},
23+
24+
footer: {
25+
message: 'Опубликовано под лицензией MIT.',
26+
copyright: '© 2019 – настоящее время, Эван Ю'
27+
},
28+
29+
outline: { label: 'Содержание страницы' },
30+
31+
docFooter: {
32+
prev: 'Предыдущая страница',
33+
next: 'Следующая страница'
34+
},
35+
36+
lastUpdated: {
37+
text: 'Обновлено'
38+
},
39+
40+
darkModeSwitchLabel: 'Оформление',
41+
lightModeSwitchTitle: 'Переключить на светлую тему',
42+
darkModeSwitchTitle: 'Переключить на тёмную тему',
43+
sidebarMenuLabel: 'Меню',
44+
returnToTopLabel: 'Вернуться к началу',
45+
langMenuLabel: 'Изменить язык'
46+
}
47+
})
48+
49+
function nav(): DefaultTheme.NavItem[] {
50+
return [
51+
{
52+
text: 'Руководство',
53+
link: '/ru/guide/what-is-vitepress',
54+
activeMatch: '/ru/guide/'
55+
},
56+
{
57+
text: 'Справочник',
58+
link: '/ru/reference/site-config',
59+
activeMatch: '/ru/reference/'
60+
},
61+
{
62+
text: pkg.version,
63+
items: [
64+
{
65+
text: 'Изменения',
66+
link: 'https://github.com/vuejs/vitepress/blob/main/CHANGELOG.md'
67+
},
68+
{
69+
text: 'Вклад',
70+
link: 'https://github.com/vuejs/vitepress/blob/main/.github/contributing.md'
71+
}
72+
]
73+
}
74+
]
75+
}
76+
77+
function sidebarGuide(): DefaultTheme.SidebarItem[] {
78+
return [
79+
{
80+
text: 'Введение',
81+
collapsed: false,
82+
items: [
83+
{ text: 'Что такое VitePress?', link: 'what-is-vitepress' },
84+
{ text: 'Первые шаги', link: 'getting-started' },
85+
{ text: 'Маршрутизация', link: 'routing' },
86+
{ text: 'Развёртывание', link: 'deploy' }
87+
]
88+
},
89+
{
90+
text: 'Написание',
91+
collapsed: false,
92+
items: [
93+
{ text: 'Расширения Markdown', link: 'markdown' },
94+
{ text: 'Обработка ресурсов', link: 'asset-handling' },
95+
{ text: 'Метаданные', link: 'frontmatter' },
96+
{ text: 'Использование Vue в Markdown', link: 'using-vue' },
97+
{ text: 'Интернационализация', link: 'i18n' }
98+
]
99+
},
100+
{
101+
text: 'Настройка',
102+
collapsed: false,
103+
items: [
104+
{ text: 'Пользовательская тема', link: 'custom-theme' },
105+
{
106+
text: 'Расширение темы по умолчанию',
107+
link: 'extending-default-theme'
108+
},
109+
{
110+
text: 'Загрузка данных в режиме реального времени',
111+
link: 'data-loading'
112+
},
113+
{ text: 'Совместимость с SSR', link: 'ssr-compat' },
114+
{ text: 'Подключение к CMS', link: 'cms' }
115+
]
116+
},
117+
{
118+
text: 'Экспериментально',
119+
collapsed: false,
120+
items: [
121+
{ text: 'Режим MPA', link: 'mpa-mode' },
122+
{ text: 'Генерация карты сайта', link: 'sitemap-generation' }
123+
]
124+
},
125+
{ text: 'Конфигурация и API', base: '/ru/reference/', link: 'site-config' }
126+
]
127+
}
128+
129+
function sidebarReference(): DefaultTheme.SidebarItem[] {
130+
return [
131+
{
132+
text: 'Справочник',
133+
items: [
134+
{ text: 'Конфигурация сайта', link: 'site-config' },
135+
{ text: 'Конфигурация метаданных', link: 'frontmatter-config' },
136+
{ text: 'Runtime API', link: 'runtime-api' },
137+
{ text: 'Командная строка', link: 'cli' },
138+
{
139+
text: 'Тема по умолчанию',
140+
base: '/ru/reference/default-theme-',
141+
items: [
142+
{ text: 'Обзор', link: 'config' },
143+
{ text: 'Навигация', link: 'nav' },
144+
{ text: 'Сайдбар', link: 'sidebar' },
145+
{ text: 'Главная страница', link: 'home-page' },
146+
{ text: 'Подвал', link: 'footer' },
147+
{ text: 'Макет', link: 'layout' },
148+
{ text: 'Значки', link: 'badge' },
149+
{ text: 'Страница команды', link: 'team-page' },
150+
{
151+
text: 'Предыдущая и следующая страницы',
152+
link: 'prev-next-links'
153+
},
154+
{ text: 'Ссылка для редактирования', link: 'edit-link' },
155+
{ text: 'Последнее обновление', link: 'last-updated' },
156+
{ text: 'Поиск', link: 'search' },
157+
{ text: 'Carbon Ads (реклама)', link: 'carbon-ads' }
158+
]
159+
}
160+
]
161+
}
162+
]
163+
}
164+
165+
export const search: DefaultTheme.AlgoliaSearchOptions['locales'] = {
166+
ru: {
167+
placeholder: 'Поиск в документации',
168+
translations: {
169+
button: {
170+
buttonText: 'Поиск',
171+
buttonAriaLabel: 'Поиск'
172+
},
173+
modal: {
174+
searchBox: {
175+
resetButtonTitle: 'Сбросить поиск',
176+
resetButtonAriaLabel: 'Сбросить поиск',
177+
cancelButtonText: 'Отменить поиск',
178+
cancelButtonAriaLabel: 'Отменить поиск'
179+
},
180+
startScreen: {
181+
recentSearchesTitle: 'История поиска',
182+
noRecentSearchesText: 'Нет истории поиска',
183+
saveRecentSearchButtonTitle: 'Сохранить в истории поиска',
184+
removeRecentSearchButtonTitle: 'Удалить из истории поиска',
185+
favoriteSearchesTitle: 'Избранное',
186+
removeFavoriteSearchButtonTitle: 'Удалить из избранного'
187+
},
188+
errorScreen: {
189+
titleText: 'Невозможно получить результаты',
190+
helpText: 'Вам может потребоваться проверить подключение к Интернету'
191+
},
192+
footer: {
193+
selectText: 'выбрать',
194+
navigateText: 'перейти',
195+
closeText: 'закрыть',
196+
searchByText: 'поставщик поиска'
197+
},
198+
noResultsScreen: {
199+
noResultsText: 'Нет результатов для',
200+
suggestedQueryText: 'Вы можете попытаться узнать',
201+
reportMissingResultsText:
202+
'Считаете, что поиск даёт ложные результаты?',
203+
reportMissingResultsLinkText: 'Нажмите на кнопку «Обратная связь»'
204+
}
205+
}
206+
}
207+
}
208+
}

Diff for: docs/.vitepress/config/shared.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import { defineConfig } from 'vitepress'
22
import { search as zhSearch } from './zh'
33
import { search as ptSearch } from './pt'
4+
import { search as ruSearch } from './ru'
45

56
export const shared = defineConfig({
67
title: 'VitePress',
@@ -55,7 +56,7 @@ export const shared = defineConfig({
5556
appId: '8J64VVRP8K',
5657
apiKey: 'a18e2f4cc5665f6602c5631fd868adfd',
5758
indexName: 'vitepress',
58-
locales: { ...zhSearch, ...ptSearch }
59+
locales: { ...zhSearch, ...ptSearch, ...ruSearch }
5960
}
6061
},
6162

Diff for: docs/lunaria.config.json

+5-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
},
77
"files": [
88
{
9-
"location": ".vitepress/config/{en,zh,pt}.ts",
9+
"location": ".vitepress/config/{en,zh,pt,ru}.ts",
1010
"pattern": ".vitepress/config/@lang.ts",
1111
"type": "universal"
1212
},
@@ -28,6 +28,10 @@
2828
{
2929
"label": "Português",
3030
"lang": "pt"
31+
},
32+
{
33+
"label": "Русский",
34+
"lang": "ru"
3135
}
3236
],
3337
"outDir": ".vitepress/dist/_translations",

Diff for: docs/ru/components/ModalDemo.vue

+80
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
<script setup lang="ts">
2+
import { ref } from 'vue'
3+
const showModal = ref(false)
4+
</script>
5+
6+
<template>
7+
<button class="modal-button" @click="showModal = true">
8+
Показать модальное окно
9+
</button>
10+
11+
<Teleport to="body">
12+
<Transition name="modal">
13+
<div v-show="showModal" class="modal-mask">
14+
<div class="modal-container">
15+
<p>Привет из модального окна!</p>
16+
<div class="model-footer">
17+
<button class="modal-button" @click="showModal = false">
18+
Закрыть
19+
</button>
20+
</div>
21+
</div>
22+
</div>
23+
</Transition>
24+
</Teleport>
25+
</template>
26+
27+
<style scoped>
28+
.modal-mask {
29+
position: fixed;
30+
z-index: 200;
31+
top: 0;
32+
left: 0;
33+
width: 100%;
34+
height: 100%;
35+
background-color: rgba(0, 0, 0, 0.5);
36+
display: flex;
37+
align-items: center;
38+
justify-content: center;
39+
transition: opacity 0.3s ease;
40+
}
41+
42+
.modal-container {
43+
width: 300px;
44+
margin: auto;
45+
padding: 20px 30px;
46+
background-color: var(--vp-c-bg);
47+
border-radius: 2px;
48+
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.33);
49+
transition: all 0.3s ease;
50+
}
51+
52+
.model-footer {
53+
margin-top: 8px;
54+
text-align: right;
55+
}
56+
57+
.modal-button {
58+
padding: 4px 8px;
59+
border-radius: 4px;
60+
border-color: var(--vp-button-alt-border);
61+
color: var(--vp-button-alt-text);
62+
background-color: var(--vp-button-alt-bg);
63+
}
64+
65+
.modal-button:hover {
66+
border-color: var(--vp-button-alt-hover-border);
67+
color: var(--vp-button-alt-hover-text);
68+
background-color: var(--vp-button-alt-hover-bg);
69+
}
70+
71+
.modal-enter-from,
72+
.modal-leave-to {
73+
opacity: 0;
74+
}
75+
76+
.modal-enter-from .modal-container,
77+
.modal-leave-to .modal-container {
78+
transform: scale(1.1);
79+
}
80+
</style>

0 commit comments

Comments
 (0)