From 7c73dd146ee294f9092346a0b0041990cc648a13 Mon Sep 17 00:00:00 2001 From: Nguyen Long Nhat <27698189+torn4dom4n@users.noreply.github.com> Date: Fri, 6 Oct 2023 22:53:08 +0700 Subject: [PATCH] i18n(vi): add Vietnames translation for Starlight UI (#807) Co-authored-by: HiDeoo <494699+HiDeoo@users.noreply.github.com> Co-authored-by: Chris Swithinbank --- .changeset/good-ways-jump.md | 5 +++++ docs/src/content/docs/guides/i18n.mdx | 2 +- packages/starlight/translations/index.ts | 2 ++ packages/starlight/translations/vi.json | 22 ++++++++++++++++++++++ 4 files changed, 30 insertions(+), 1 deletion(-) create mode 100644 .changeset/good-ways-jump.md create mode 100644 packages/starlight/translations/vi.json diff --git a/.changeset/good-ways-jump.md b/.changeset/good-ways-jump.md new file mode 100644 index 0000000000..93d67f8cfa --- /dev/null +++ b/.changeset/good-ways-jump.md @@ -0,0 +1,5 @@ +--- +"@astrojs/starlight": patch +--- + +Add Vietnamese translations for Starlight UI diff --git a/docs/src/content/docs/guides/i18n.mdx b/docs/src/content/docs/guides/i18n.mdx index a208e67c48..0819703e2e 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, Hebrew, Simplified Chinese, Korean, Indonesian, 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). +English, Czech, French, German, Italian, Japanese, Portuguese, Dutch, Danish, Spanish, Turkish, Arabic, Norwegian, Farsi, Hebrew, Simplified Chinese, Korean, Indonesian, Russian, Swedish, and Vietnamese 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 1f4fdf7b5a..37c2fd4dcf 100644 --- a/packages/starlight/translations/index.ts +++ b/packages/starlight/translations/index.ts @@ -19,6 +19,7 @@ import zh from './zh.json'; import ko from './ko.json'; import sv from './sv.json'; import ru from './ru.json'; +import vi from './vi.json'; const { parse } = builtinI18nSchema(); @@ -44,5 +45,6 @@ export default Object.fromEntries( ko, sv, ru, + vi, }).map(([key, dict]) => [key, parse(dict)]) ); diff --git a/packages/starlight/translations/vi.json b/packages/starlight/translations/vi.json new file mode 100644 index 0000000000..079cf8de59 --- /dev/null +++ b/packages/starlight/translations/vi.json @@ -0,0 +1,22 @@ +{ + "skipLink.label": "Bỏ qua nội dung", + "search.label": "Tìm kiếm", + "search.shortcutLabel": "(Nhấn / để Tìm kiếm)", + "search.cancelLabel": "Thoát", + "search.devWarning": "Tìm kiếm không khả dụng khi đang trong môi trường lập trình. \nThử xuất bản website và tìm kiếm.", + "themeSelect.accessibleLabel": "Chọn giao diện", + "themeSelect.dark": "Tối", + "themeSelect.light": "Sáng", + "themeSelect.auto": "Tự động", + "languageSelect.accessibleLabel": "Chọn ngôn ngữ", + "menuButton.accessibleLabel": "Menu", + "sidebarNav.accessibleLabel": "Chính", + "tableOfContents.onThisPage": "Tóm tắt", + "tableOfContents.overview": "Tổng quát", + "i18n.untranslatedContent": "Nội dung này không tồn tại trong ngôn ngữ của bạn", + "page.editLink": "Chỉnh sửa trang", + "page.lastUpdated": "Cập nhật lần cuối:", + "page.previousLink": "Tiếp", + "page.nextLink": "Trước", + "404.text": "Không tìm thấy trang. Kiểm tra URL hoặc thử sử dụng thanh tìm kiếm." +}