summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBugo2025-01-03 13:33:59 +0500
committerGitHub2025-01-03 09:33:59 +0100
commit2bdb6c2ba04ef378ef2c8babbd6e8cf3cb14a8e4 (patch)
treef6671bcc3bc2a1fe19c596d9d111fe98b93677f6
parent29cdb8145c5deef3d655d46971116e762276b653 (diff)
downloadIT.starlight-2bdb6c2ba04ef378ef2c8babbd6e8cf3cb14a8e4.tar.gz
IT.starlight-2bdb6c2ba04ef378ef2c8babbd6e8cf3cb14a8e4.tar.bz2
IT.starlight-2bdb6c2ba04ef378ef2c8babbd6e8cf3cb14a8e4.zip
i18n(ru): update `guides/i18n.mdx` (#2745)
-rw-r--r--docs/src/content/docs/ru/guides/i18n.mdx7
1 files changed, 4 insertions, 3 deletions
diff --git a/docs/src/content/docs/ru/guides/i18n.mdx b/docs/src/content/docs/ru/guides/i18n.mdx
index 81282b41..779b886a 100644
--- a/docs/src/content/docs/ru/guides/i18n.mdx
+++ b/docs/src/content/docs/ru/guides/i18n.mdx
@@ -193,6 +193,7 @@ import UIStringsList from '~/components/ui-strings-list.astro';
```diff lang="js" ins=/, (i18nLoader|i18nSchema)/
// src/content.config.ts
+ import { defineCollection } from 'astro:content';
import { docsLoader, i18nLoader } from '@astrojs/starlight/loaders';
import { docsSchema, i18nSchema } from '@astrojs/starlight/schema';
@@ -283,7 +284,7 @@ export const collections = {
Π’Ρ‹ ΠΌΠΎΠΆΠ΅Ρ‚Π΅ ΠΏΠΎΠ»ΡƒΡ‡ΠΈΡ‚ΡŒ доступ ΠΊ [встроСнным строкам ΠΏΠΎΠ»ΡŒΠ·ΠΎΠ²Π°Ρ‚Π΅Π»ΡŒΡΠΊΠΎΠ³ΠΎ интСрфСйса](/ru/guides/i18n/#ΠΏΠ΅Ρ€Π΅Π²ΠΎΠ΄-интСрфСйса-starlight) Starlight, Π° Ρ‚Π°ΠΊΠΆΠ΅ ΠΊ [ΠΏΠΎΠ»ΡŒΠ·ΠΎΠ²Π°Ρ‚Π΅Π»ΡŒΡΠΊΠΈΠΌ](/ru/guides/i18n/#Ρ€Π°ΡΡˆΠΈΡ€Π΅Π½ΠΈΠ΅-схСмы-ΠΏΠ΅Ρ€Π΅Π²ΠΎΠ΄Π°) ΠΈ [прСдоставляСмым ΠΏΠ»Π°Π³ΠΈΠ½Π°ΠΌΠΈ](/ru/reference/plugins/#injecttranslations) строкам ΠΏΠΎΠ»ΡŒΠ·ΠΎΠ²Π°Ρ‚Π΅Π»ΡŒΡΠΊΠΎΠ³ΠΎ интСрфСйса Ρ‡Π΅Ρ€Π΅Π· Π΅Π΄ΠΈΠ½Ρ‹ΠΉ API Π½Π° Π±Π°Π·Π΅ [i18next](https://www.i18next.com/).
Π­Ρ‚ΠΎ Π²ΠΊΠ»ΡŽΡ‡Π°Π΅Ρ‚ ΠΏΠΎΠ΄Π΄Π΅Ρ€ΠΆΠΊΡƒ Ρ‚Π°ΠΊΠΈΡ… Ρ„ΡƒΠ½ΠΊΡ†ΠΈΠΉ, ΠΊΠ°ΠΊ [интСрполяция](https://www.i18next.com/translation-function/interpolation) ΠΈ [ΠΏΠ»ΡŽΡ€Π°Π»ΠΈΠ·Π°Ρ†ΠΈΡ](https://www.i18next.com/translation-function/plurals).
-Π’ ΠΊΠΎΠΌΠΏΠΎΠ½Π΅Π½Ρ‚Π°Ρ… Astro этот API доступСн ΠΊΠ°ΠΊ Ρ‡Π°ΡΡ‚ΡŒ [глобального ΠΎΠ±ΡŠΠ΅ΠΊΡ‚Π° `Astro`](https://docs.astro.build/ru/reference/api-reference/#astrolocals) Π² Π²ΠΈΠ΄Π΅ `Astro.locals.t`:
+Π’ ΠΊΠΎΠΌΠΏΠΎΠ½Π΅Π½Ρ‚Π°Ρ… Astro этот API доступСн ΠΊΠ°ΠΊ Ρ‡Π°ΡΡ‚ΡŒ [глобального ΠΎΠ±ΡŠΠ΅ΠΊΡ‚Π° `Astro`](https://docs.astro.build/en/reference/api-reference/#locals) Π² Π²ΠΈΠ΄Π΅ `Astro.locals.t`:
```astro title="example.astro"
<p dir={Astro.locals.t.dir()}>
@@ -291,7 +292,7 @@ export const collections = {
</p>
```
-Π’Ρ‹ Ρ‚Π°ΠΊΠΆΠ΅ ΠΌΠΎΠΆΠ΅Ρ‚Π΅ ΠΈΡΠΏΠΎΠ»ΡŒΠ·ΠΎΠ²Π°Ρ‚ΡŒ API Π² [эндпойнтах](https://docs.astro.build/ru/guides/endpoints/), Π³Π΄Π΅ ΠΎΠ±ΡŠΠ΅ΠΊΡ‚ `locals` доступСн ΠΊΠ°ΠΊ Ρ‡Π°ΡΡ‚ΡŒ контСкста [эндпойнта](https://docs.astro.build/ru/reference/api-reference/#contextlocals):
+Π’Ρ‹ Ρ‚Π°ΠΊΠΆΠ΅ ΠΌΠΎΠΆΠ΅Ρ‚Π΅ ΠΈΡΠΏΠΎΠ»ΡŒΠ·ΠΎΠ²Π°Ρ‚ΡŒ API Π² [эндпойнтах](https://docs.astro.build/ru/guides/endpoints/), Π³Π΄Π΅ ΠΎΠ±ΡŠΠ΅ΠΊΡ‚ `locals` доступСн ΠΊΠ°ΠΊ Ρ‡Π°ΡΡ‚ΡŒ контСкста [эндпойнта](https://docs.astro.build/en/reference/api-reference/#locals):
```ts title="src/pages/404.ts"
export const GET = (context) => {
@@ -392,7 +393,7 @@ const arabicDirection = Astro.locals.t.dir('ar');
## Доступ ΠΊ Ρ‚Π΅ΠΊΡƒΡ‰Π΅ΠΉ Π»ΠΎΠΊΠ°Π»ΠΈ
-Π’Ρ‹ ΠΌΠΎΠΆΠ΅Ρ‚Π΅ ΠΈΡΠΏΠΎΠ»ΡŒΠ·ΠΎΠ²Π°Ρ‚ΡŒ [`Astro.currentLocale`](https://docs.astro.build/ru/reference/api-reference/#astrocurrentlocale) для получСния Ρ‚Π΅ΠΊΡƒΡ‰Π΅ΠΉ Π»ΠΎΠΊΠ°Π»ΠΈ Π² ΠΊΠΎΠΌΠΏΠΎΠ½Π΅Π½Ρ‚Π°Ρ… `.astro`.
+Π’Ρ‹ ΠΌΠΎΠΆΠ΅Ρ‚Π΅ ΠΈΡΠΏΠΎΠ»ΡŒΠ·ΠΎΠ²Π°Ρ‚ΡŒ [`Astro.currentLocale`](https://docs.astro.build/en/reference/api-reference/#currentlocale) для получСния Ρ‚Π΅ΠΊΡƒΡ‰Π΅ΠΉ Π»ΠΎΠΊΠ°Π»ΠΈ Π² ΠΊΠΎΠΌΠΏΠΎΠ½Π΅Π½Ρ‚Π°Ρ… `.astro`.
Π‘Π»Π΅Π΄ΡƒΡŽΡ‰ΠΈΠΉ ΠΏΡ€ΠΈΠΌΠ΅Ρ€ считываСт Ρ‚Π΅ΠΊΡƒΡ‰ΡƒΡŽ локаль ΠΈ ΠΈΡΠΏΠΎΠ»ΡŒΠ·ΡƒΠ΅Ρ‚ Π΅Ρ‘ с ΠΏΠΎΠΌΠΎΡ‰ΡŒΡŽ Ρ…Π΅Π»ΠΏΠ΅Ρ€Π° [`getRelativeLocaleUrl()`](https://docs.astro.build/ru/reference/modules/astro-i18n/#getrelativelocaleurl) для Π³Π΅Π½Π΅Ρ€Π°Ρ†ΠΈΠΈ ссылки Π½Π° страницу «О сайтС» Π½Π° Ρ‚Π΅ΠΊΡƒΡ‰Π΅ΠΌ языкС: