Skip to content

Commit

Permalink
i18n (ru) - add localization for Russian language (#682)
Browse files Browse the repository at this point in the history
Co-authored-by: Chris Swithinbank <[email protected]>
  • Loading branch information
vedmalex and delucis authored Sep 14, 2023
1 parent 711fe56 commit 660a5f5
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 2 deletions.
5 changes: 5 additions & 0 deletions .changeset/large-onions-fail.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@astrojs/starlight': patch
---

Add Russian language support
2 changes: 1 addition & 1 deletion docs/src/content/docs/guides/i18n.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down
3 changes: 2 additions & 1 deletion packages/starlight/translations/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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)]
)
);
22 changes: 22 additions & 0 deletions packages/starlight/translations/ru.json
Original file line number Diff line number Diff line change
@@ -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 или используйте поиск по сайту"
}

0 comments on commit 660a5f5

Please sign in to comment.