diff options
author | Bugo | 2025-01-03 13:33:59 +0500 |
---|---|---|
committer | GitHub | 2025-01-03 09:33:59 +0100 |
commit | 2bdb6c2ba04ef378ef2c8babbd6e8cf3cb14a8e4 (patch) | |
tree | f6671bcc3bc2a1fe19c596d9d111fe98b93677f6 | |
parent | 29cdb8145c5deef3d655d46971116e762276b653 (diff) | |
download | IT.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.mdx | 7 |
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) Π΄Π»Ρ Π³Π΅Π½Π΅ΡΠ°ΡΠΈΠΈ ΡΡΡΠ»ΠΊΠΈ Π½Π° ΡΡΡΠ°Π½ΠΈΡΡ Β«Π ΡΠ°ΠΉΡΠ΅Β» Π½Π° ΡΠ΅ΠΊΡΡΠ΅ΠΌ ΡΠ·ΡΠΊΠ΅: |