From 660a5f57adf0340de21df3e364aada38255bb06c Mon Sep 17 00:00:00 2001 From: "Vedanta-krit das (Alex Vedmedenko)" Date: Fri, 15 Sep 2023 00:50:04 +0300 Subject: [PATCH] i18n (ru) - add localization for Russian language (#682) Co-authored-by: Chris Swithinbank --- .changeset/large-onions-fail.md | 5 +++++ docs/src/content/docs/guides/i18n.mdx | 2 +- packages/starlight/translations/index.ts | 3 ++- packages/starlight/translations/ru.json | 22 ++++++++++++++++++++++ 4 files changed, 30 insertions(+), 2 deletions(-) create mode 100644 .changeset/large-onions-fail.md create mode 100644 packages/starlight/translations/ru.json diff --git a/.changeset/large-onions-fail.md b/.changeset/large-onions-fail.md new file mode 100644 index 00000000000..7e01bde61aa --- /dev/null +++ b/.changeset/large-onions-fail.md @@ -0,0 +1,5 @@ +--- +'@astrojs/starlight': patch +--- + +Add Russian language support diff --git a/docs/src/content/docs/guides/i18n.mdx b/docs/src/content/docs/guides/i18n.mdx index 0015b4e78fa..a4d03935e73 100644 --- a/docs/src/content/docs/guides/i18n.mdx +++ b/docs/src/content/docs/guides/i18n.mdx @@ -143,7 +143,7 @@ If a translation is not yet available for a language, Starlight will show reader In addition to hosting translated content files, Starlight allows you to translate the default UI strings (e.g. the "On this page" heading in the table of contents) so that your readers can experience your site entirely in the selected language. -English, Czech, French, German, Italian, Japanese, Portuguese, Dutch, Danish, Spanish, Turkish, Arabic, Norwegian, Farsi, Simplified Chinese, Korean, and Swedish translated UI strings are provided out of the box, and we welcome [contributions to add more default languages](https://github.com/withastro/starlight/blob/main/CONTRIBUTING.md). +English, Czech, French, German, Italian, Japanese, Portuguese, Dutch, Danish, Spanish, Turkish, Arabic, Norwegian, Farsi, Simplified Chinese, Korean, Russian, and Swedish translated UI strings are provided out of the box, and we welcome [contributions to add more default languages](https://github.com/withastro/starlight/blob/main/CONTRIBUTING.md). You can provide translations for additional languages you support — or override our default labels — via the `i18n` data collection. diff --git a/packages/starlight/translations/index.ts b/packages/starlight/translations/index.ts index 22d5188e071..d06c3d6559a 100644 --- a/packages/starlight/translations/index.ts +++ b/packages/starlight/translations/index.ts @@ -16,11 +16,12 @@ import nb from './nb.json'; import zh from './zh.json'; import ko from './ko.json'; import sv from './sv.json'; +import ru from './ru.json'; const { parse } = builtinI18nSchema(); export default Object.fromEntries( - Object.entries({ cs, en, es, de, ja, pt, fa, fr, it, nl, da, tr, ar, nb, zh, ko, sv }).map( + Object.entries({ cs, en, es, de, ja, pt, fa, fr, it, nl, da, tr, ar, nb, zh, ko, sv, ru }).map( ([key, dict]) => [key, parse(dict)] ) ); diff --git a/packages/starlight/translations/ru.json b/packages/starlight/translations/ru.json new file mode 100644 index 00000000000..fda513f055c --- /dev/null +++ b/packages/starlight/translations/ru.json @@ -0,0 +1,22 @@ +{ + "skipLink.label": "Пропустить до содержимого", + "search.label": "Поиск", + "search.shortcutLabel": "(Нажмите / для Поиска)", + "search.cancelLabel": "Отменить", + "search.devWarning": "Поиск доступен только в производственных сборках. \nПопробуйте выполнить сборку и просмотреть сайт, чтобы протестировать его локально.", + "themeSelect.accessibleLabel": "Выберите тему", + "themeSelect.dark": "Темная", + "themeSelect.light": "Светлая", + "themeSelect.auto": "Авто", + "languageSelect.accessibleLabel": "Выберите язык", + "menuButton.accessibleLabel": "Меню", + "sidebarNav.accessibleLabel": "Основное", + "tableOfContents.onThisPage": "На странице", + "tableOfContents.overview": "Обзор", + "i18n.untranslatedContent": "Этот содержимое пока не доступно на вашем языке.", + "page.editLink": "Редактировать странице", + "page.lastUpdated": "Последнее обновление:", + "page.previousLink": "Предыдущая", + "page.nextLink": "Следующая", + "404.text": "Страница не найдена. Проверьтье URL или используйте поиск по сайту" +}