-
-
Notifications
You must be signed in to change notification settings - Fork 593
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
i18n(ru): update some translations #2849
Changes from all commits
271627a
edef9f4
4c5f7a3
59f9cab
0a24159
e043fdf
98fa7fd
cd24671
66aa0cc
59e5942
c4a985c
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
@@ -1,6 +1,8 @@ | ||||||
--- | ||||||
title: Поиск по сайту | ||||||
description: Узнайте о встроенных в Starlight функциях поиска по сайту и о том, как их настроить. | ||||||
tableOfContents: | ||||||
maxHeadingLevel: 4 | ||||||
--- | ||||||
|
||||||
import { Tabs, TabItem, Steps } from '@astrojs/starlight/components'; | ||||||
|
@@ -110,13 +112,62 @@ title: Частично проиндексированная страница | |||||
|
||||||
#### Конфигурация DocSearch | ||||||
|
||||||
Плагин Starlight DocSearch также поддерживает настройку компонента DocSearch с помощью следующих дополнительных опций: | ||||||
Плагин Starlight DocSearch поддерживает настройку компонента DocSearch с помощью следующих встроенных опций: | ||||||
|
||||||
- `maxResultsPerGroup`: Ограничивает количество результатов, отображаемых для каждой группы поиска. По умолчанию `5`. | ||||||
- `disableUserPersonalization`: Предотвращает сохранение недавних поисков и избранных элементов пользователя в локальном хранилище. По умолчанию `false`. | ||||||
- `insights`: Включает плагин Algolia Insights и отправляет события поиска в ваш индекс DocSearch. По умолчанию `false`. | ||||||
- `searchParameters`: Объект, настраивающий [параметры поиска Algolia](https://www.algolia.com/doc/api-reference/search-api-parameters/). | ||||||
|
||||||
##### Дополнительные опции DocSearch | ||||||
|
||||||
Необходим отдельный файл конфигурации для передачи параметров функции, таких как `transformItems()` или `resultsFooterComponent()`, в компонент DocSearch. | ||||||
|
||||||
<Steps> | ||||||
|
||||||
1. Создайте файл TypeScript, экспортирующий вашу конфигурацию DocSearch. | ||||||
|
||||||
```ts | ||||||
// src/config/docsearch.ts | ||||||
import type { DocSearchClientOptions } from '@astrojs/starlight-docsearch'; | ||||||
|
||||||
export default { | ||||||
appId: 'YOUR_APP_ID', | ||||||
apiKey: 'YOUR_SEARCH_API_KEY', | ||||||
indexName: 'YOUR_INDEX_NAME', | ||||||
getMissingResultsUrl({ query }) { | ||||||
return `https://github.com/algolia/docsearch/issues/new?title=${query}`; | ||||||
}, | ||||||
// ... | ||||||
} satisfies DocSearchClientOptions; | ||||||
``` | ||||||
|
||||||
2. Передайте путь к вашему файлу конфигурации плагину Starlight DocSearch в `astro.config.mjs`. | ||||||
|
||||||
```js {11-13} | ||||||
// astro.config.mjs | ||||||
import { defineConfig } from 'astro/config'; | ||||||
import starlight from '@astrojs/starlight'; | ||||||
import starlightDocSearch from '@astrojs/starlight-docsearch'; | ||||||
|
||||||
export default defineConfig({ | ||||||
integrations: [ | ||||||
starlight({ | ||||||
title: 'Сайт с DocSearch', | ||||||
plugins: [ | ||||||
starlightDocSearch({ | ||||||
clientOptionsModule: './src/config/docsearch.ts', | ||||||
}), | ||||||
], | ||||||
}), | ||||||
], | ||||||
}); | ||||||
``` | ||||||
|
||||||
</Steps> | ||||||
|
||||||
Смотрите [Документацию по API клиента DocSearch JavaScript](https://docsearch.algolia.com/docs/api/), чтобы узнать все поддерживаемые параметры. | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. suggestion: something like this would be a more accurate translation, I think
Suggested change
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Так будет звучать, как будто документация принимает API-запросы, но ведь это не так? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. API — это необязательно про запросы, это любой программный интерфейс. В английском просто часто используют "API reference" в значении "руководство по API", я здесь перевел это как "API-документация". В целом, сейчас я перечитал твой вариант, и он тоже хороший, я бы только предложил передвинуть слово "JavaScript", чтоб было "JavaScript-клиенту DocSearch", потому что у DocSearch есть несколько клиентов для разных языков There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Можно и так. Создадите PR? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Да, скоро создам |
||||||
|
||||||
#### Перевод пользовательского интерфейса DocSearch | ||||||
|
||||||
По умолчанию DocSearch предоставляет только английские строки пользовательского интерфейса. | ||||||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -268,6 +268,11 @@ export default defineConfig({ | |
label: '简体中文', | ||
lang: 'zh-CN', | ||
}, | ||
// Арабская документация в `src/content/docs/ar/` | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Nice catch! |
||
ar: { | ||
label: 'العربية', | ||
dir: 'rtl', | ||
}, | ||
// Русская документация в `src/content/docs/ru/` | ||
ru: { | ||
label: 'Русский', | ||
|
@@ -383,10 +388,10 @@ starlight({ | |
**тип:** `StarlightExpressiveCodeOptions | boolean` | ||
**по умолчанию:** `true` | ||
|
||
Starlight использует [Expressive Code](https://github.com/expressive-code/expressive-code/tree/main/packages/astro-expressive-code) для визуализации блоков кода и добавляет поддержку выделения частей примеров кода, добавления имён файлов к блокам кода и многое другое. | ||
Starlight использует [Expressive Code](https://expressive-code.com) для визуализации блоков кода и добавляет поддержку выделения частей примеров кода, добавления имён файлов к блокам кода и многое другое. | ||
Смотрите руководство [Блоки кода](/ru/guides/authoring-content/#блоки-кода), чтобы узнать, как использовать синтаксис выразительного кода в Markdown и MDX-содержимом. | ||
|
||
Вы также можете использовать любые стандартные [параметры конфигурации Expressive Code](https://github.com/expressive-code/expressive-code/blob/main/packages/astro-expressive-code/README.md#configuration), как некоторые свойства, специфичные для Starlight, установив их в опции `expressiveCode` Starlight. | ||
Вы также можете использовать любые стандартные [параметры конфигурации Expressive Code](https://expressive-code.com/reference/configuration/), как некоторые свойства, специфичные для Starlight, установив их в опции `expressiveCode` Starlight. | ||
Например, установите опцию `styleOverrides` в Expressive Code, чтобы переопределить CSS по умолчанию. Это позволяет настраивать код, например, сделать блокам кода закругленные углы: | ||
|
||
```js ins={2-4} | ||
|
@@ -413,7 +418,7 @@ starlight({ | |
**по умолчанию:** `['starlight-dark', 'starlight-light']` | ||
|
||
Установите темы, используемые для оформления блоков кода. | ||
См. [документацию по темам Expressive Code](https://github.com/expressive-code/expressive-code/blob/main/packages/astro-expressive-code/README.md#themes) для получения подробной информации о поддерживаемых форматах тем. | ||
См. [документацию по темам Expressive Code](https://expressive-code.com/guides/themes/) для получения подробной информации о поддерживаемых форматах тем. | ||
|
||
По умолчанию Starlight использует тёмный и светлый варианты [темы Night Owl](https://github.com/sdras/night-owl-vscode-theme) Сары Драснер. | ||
|
||
|
@@ -446,16 +451,32 @@ starlight({ | |
|
||
### `pagefind` | ||
|
||
**тип:** `boolean` | ||
**тип:** <code>boolean | <a href="#pagefindoptions">PagefindOptions</a></code> | ||
**по умолчанию:** `true` | ||
|
||
Определите, включен ли в Starlight поставщик поиска по сайту по умолчанию — [Pagefind](https://pagefind.app/). | ||
Настройте стандартный поставщик поиска по сайту Starlight — [Pagefind](https://pagefind.app/). | ||
|
||
Установите значение `false`, чтобы отключить индексацию вашего сайта с помощью Pagefind. | ||
Это также скроет стандартный пользовательский интерфейс поиска, если он используется. | ||
|
||
Pagefind не может быть включен, если для параметра [`prerender`](#prerender) установлено значение `false`. | ||
|
||
Установите `pagefind` в объект, чтобы настроить клиент поиска Pagefind. | ||
Смотрите главу [Настройка ранжирования результатов Pagefind](https://pagefind.app/docs/ranking/) в документации Pagefind для получения дополнительной информации о том, как использовать параметр `pagefind.ranking` для управления расчётом ранжирования результатов поиска. | ||
|
||
#### `PagefindOptions` | ||
|
||
```ts | ||
interface PagefindOptions { | ||
ranking?: { | ||
pageLength?: number; | ||
termFrequency?: number; | ||
termSaturation?: number; | ||
termSimilarity?: number; | ||
}; | ||
} | ||
``` | ||
|
||
### `prerender` | ||
|
||
**тип:** `boolean` | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
suggestion: I think it would sound more natural to flip the order of the sentence a little
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Можно и так, или «функций с параметрами».
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Не, мне кажется, там имелось в виду "параметры, значения которых являются функциями". Поэтому я сократил до "параметров-функций"