From f21ec91763ce14f2709897439b3bd17accbd333a Mon Sep 17 00:00:00 2001 From: Divyansh Singh <40380293+brc-dd@users.noreply.github.com> Date: Sat, 25 Jul 2026 14:58:20 +0530 Subject: [PATCH] docs: translate container labels and the code copy button title Uses the new `locales..markdown` option, with the strings exported from each locale's config file. Labels come from the translated examples in each locale's markdown guide where available; the rest (es/pt/ja labels and the note/important/caution set) are best-effort and open to native-speaker review. Co-Authored-By: Claude Fable 5 --- docs/.vitepress/config.ts | 22 +++++++++++++++------- docs/es/config.ts | 22 +++++++++++++++++++++- docs/fa/config.ts | 22 +++++++++++++++++++++- docs/ja/config.ts | 22 +++++++++++++++++++++- docs/ko/config.ts | 22 +++++++++++++++++++++- docs/pt/config.ts | 22 +++++++++++++++++++++- docs/ru/config.ts | 22 +++++++++++++++++++++- docs/zh/config.ts | 22 +++++++++++++++++++++- 8 files changed, 162 insertions(+), 14 deletions(-) diff --git a/docs/.vitepress/config.ts b/docs/.vitepress/config.ts index 0a5413ee..558bff97 100644 --- a/docs/.vitepress/config.ts +++ b/docs/.vitepress/config.ts @@ -9,6 +9,13 @@ import { localIconLoader } from 'vitepress-plugin-group-icons' import llmstxt from 'vitepress-plugin-llms' +import { markdown as esMarkdown } from '../es/config' +import { markdown as faMarkdown } from '../fa/config' +import { markdown as jaMarkdown } from '../ja/config' +import { markdown as koMarkdown } from '../ko/config' +import { markdown as ptMarkdown } from '../pt/config' +import { markdown as ruMarkdown } from '../ru/config' +import { markdown as zhMarkdown } from '../zh/config' const prod = !!process.env.NETLIFY const siteUrl = 'https://vitepress.dev' @@ -121,15 +128,16 @@ export default defineConfig({ carbonAds: { code: 'CEBDT27Y', placement: 'vuejsorg' } }, + // prettier-ignore locales: { root: { label: 'English', lang: 'en-US', dir: 'ltr' }, - zh: { label: '简体中文', lang: 'zh-Hans', dir: 'ltr' }, - pt: { label: 'Português', lang: 'pt-BR', dir: 'ltr' }, - ru: { label: 'Русский', lang: 'ru-RU', dir: 'ltr' }, - es: { label: 'Español', lang: 'es', dir: 'ltr' }, - ko: { label: '한국어', lang: 'ko-KR', dir: 'ltr' }, - fa: { label: 'فارسی', lang: 'fa-IR', dir: 'rtl' }, - ja: { label: '日本語', lang: 'ja', dir: 'ltr' } + zh: { label: '简体中文', lang: 'zh-Hans', dir: 'ltr', markdown: zhMarkdown }, + pt: { label: 'Português', lang: 'pt-BR', dir: 'ltr', markdown: ptMarkdown }, + ru: { label: 'Русский', lang: 'ru-RU', dir: 'ltr', markdown: ruMarkdown }, + es: { label: 'Español', lang: 'es', dir: 'ltr', markdown: esMarkdown }, + ko: { label: '한국어', lang: 'ko-KR', dir: 'ltr', markdown: koMarkdown }, + fa: { label: 'فارسی', lang: 'fa-IR', dir: 'rtl', markdown: faMarkdown }, + ja: { label: '日本語', lang: 'ja', dir: 'ltr', markdown: jaMarkdown } }, vite: { diff --git a/docs/es/config.ts b/docs/es/config.ts index bb31ca42..3d4c2377 100644 --- a/docs/es/config.ts +++ b/docs/es/config.ts @@ -1,9 +1,29 @@ import { createRequire } from 'node:module' -import { defineAdditionalConfig, type DefaultTheme } from 'vitepress' +import { + defineAdditionalConfig, + type DefaultTheme, + type MarkdownLocaleOptions +} from 'vitepress' const require = createRequire(import.meta.url) const pkg = require('vitepress/package.json') +// imported by the root config - locale markdown strings cannot be +// applied from additional config files +export const markdown: MarkdownLocaleOptions = { + container: { + tipLabel: 'CONSEJO', + infoLabel: 'INFORMACIÓN', + warningLabel: 'ADVERTENCIA', + dangerLabel: 'PELIGRO', + detailsLabel: 'Detalles', + noteLabel: 'NOTA', + importantLabel: 'IMPORTANTE', + cautionLabel: 'PRECAUCIÓN' + }, + codeCopyButtonTitle: 'Copiar código' +} + export default defineAdditionalConfig({ description: 'Generador de Sitios Estáticos desarrollado con Vite y Vue.', diff --git a/docs/fa/config.ts b/docs/fa/config.ts index 8e2f899d..8ada50db 100644 --- a/docs/fa/config.ts +++ b/docs/fa/config.ts @@ -1,9 +1,29 @@ import { createRequire } from 'node:module' -import { defineAdditionalConfig, type DefaultTheme } from 'vitepress' +import { + defineAdditionalConfig, + type DefaultTheme, + type MarkdownLocaleOptions +} from 'vitepress' const require = createRequire(import.meta.url) const pkg = require('vitepress/package.json') +// imported by the root config - locale markdown strings cannot be +// applied from additional config files +export const markdown: MarkdownLocaleOptions = { + container: { + tipLabel: 'نکته', + infoLabel: 'اطلاعات', + warningLabel: 'اخطار', + dangerLabel: 'خطر', + detailsLabel: 'جزئیات', + noteLabel: 'یادداشت', + importantLabel: 'مهم', + cautionLabel: 'احتیاط' + }, + codeCopyButtonTitle: 'کپی کد' +} + export default defineAdditionalConfig({ description: 'ژنراتور استاتیک وب‌سایت با Vite و Vue', diff --git a/docs/ja/config.ts b/docs/ja/config.ts index c2119b10..86a5c64a 100644 --- a/docs/ja/config.ts +++ b/docs/ja/config.ts @@ -1,9 +1,29 @@ import { createRequire } from 'node:module' -import { defineAdditionalConfig, type DefaultTheme } from 'vitepress' +import { + defineAdditionalConfig, + type DefaultTheme, + type MarkdownLocaleOptions +} from 'vitepress' const require = createRequire(import.meta.url) const pkg = require('vitepress/package.json') +// imported by the root config - locale markdown strings cannot be +// applied from additional config files +export const markdown: MarkdownLocaleOptions = { + container: { + tipLabel: 'ヒント', + infoLabel: '情報', + warningLabel: '警告', + dangerLabel: '危険', + detailsLabel: '詳細', + noteLabel: 'メモ', + importantLabel: '重要', + cautionLabel: '注意' + }, + codeCopyButtonTitle: 'コードをコピー' +} + export default defineAdditionalConfig({ description: 'Vite と Vue による静的サイトジェネレーター', diff --git a/docs/ko/config.ts b/docs/ko/config.ts index 22a96ed8..d2a0f5da 100644 --- a/docs/ko/config.ts +++ b/docs/ko/config.ts @@ -1,9 +1,29 @@ import { createRequire } from 'node:module' -import { defineAdditionalConfig, type DefaultTheme } from 'vitepress' +import { + defineAdditionalConfig, + type DefaultTheme, + type MarkdownLocaleOptions +} from 'vitepress' const require = createRequire(import.meta.url) const pkg = require('vitepress/package.json') +// imported by the root config - locale markdown strings cannot be +// applied from additional config files +export const markdown: MarkdownLocaleOptions = { + container: { + tipLabel: '팁', + infoLabel: '정보', + warningLabel: '경고', + dangerLabel: '위험', + detailsLabel: '세부 정보', + noteLabel: '노트', + importantLabel: '중요', + cautionLabel: '주의' + }, + codeCopyButtonTitle: '코드 복사' +} + export default defineAdditionalConfig({ description: 'Vite 및 Vue 기반 정적 사이트 생성기.', diff --git a/docs/pt/config.ts b/docs/pt/config.ts index 5431fc36..ac5cc4e5 100644 --- a/docs/pt/config.ts +++ b/docs/pt/config.ts @@ -1,9 +1,29 @@ import { createRequire } from 'node:module' -import { defineAdditionalConfig, type DefaultTheme } from 'vitepress' +import { + defineAdditionalConfig, + type DefaultTheme, + type MarkdownLocaleOptions +} from 'vitepress' const require = createRequire(import.meta.url) const pkg = require('vitepress/package.json') +// imported by the root config - locale markdown strings cannot be +// applied from additional config files +export const markdown: MarkdownLocaleOptions = { + container: { + tipLabel: 'DICA', + infoLabel: 'INFORMAÇÃO', + warningLabel: 'AVISO', + dangerLabel: 'PERIGO', + detailsLabel: 'Detalhes', + noteLabel: 'NOTA', + importantLabel: 'IMPORTANTE', + cautionLabel: 'CUIDADO' + }, + codeCopyButtonTitle: 'Copiar código' +} + export default defineAdditionalConfig({ description: 'Gerador de Site Estático desenvolvido com Vite e Vue.', diff --git a/docs/ru/config.ts b/docs/ru/config.ts index 129a5db3..c2552b35 100644 --- a/docs/ru/config.ts +++ b/docs/ru/config.ts @@ -1,9 +1,29 @@ import { createRequire } from 'node:module' -import { defineAdditionalConfig, type DefaultTheme } from 'vitepress' +import { + defineAdditionalConfig, + type DefaultTheme, + type MarkdownLocaleOptions +} from 'vitepress' const require = createRequire(import.meta.url) const pkg = require('vitepress/package.json') +// imported by the root config - locale markdown strings cannot be +// applied from additional config files +export const markdown: MarkdownLocaleOptions = { + container: { + tipLabel: 'СОВЕТ', + infoLabel: 'ИНФОРМАЦИЯ', + warningLabel: 'ПРЕДУПРЕЖДЕНИЕ', + dangerLabel: 'ОПАСНОСТЬ', + detailsLabel: 'Подробная информация', + noteLabel: 'ЗАМЕТКА', + importantLabel: 'ВАЖНО', + cautionLabel: 'ВНИМАНИЕ' + }, + codeCopyButtonTitle: 'Скопировать код' +} + export default defineAdditionalConfig({ description: 'Генератор статических сайтов на основе Vite и Vue.', diff --git a/docs/zh/config.ts b/docs/zh/config.ts index 99fbdf86..1737adbc 100644 --- a/docs/zh/config.ts +++ b/docs/zh/config.ts @@ -1,9 +1,29 @@ import { createRequire } from 'node:module' -import { defineAdditionalConfig, type DefaultTheme } from 'vitepress' +import { + defineAdditionalConfig, + type DefaultTheme, + type MarkdownLocaleOptions +} from 'vitepress' const require = createRequire(import.meta.url) const pkg = require('vitepress/package.json') +// imported by the root config - locale markdown strings cannot be +// applied from additional config files +export const markdown: MarkdownLocaleOptions = { + container: { + tipLabel: '提示', + infoLabel: '信息', + warningLabel: '警告', + dangerLabel: '危险', + detailsLabel: '详细信息', + noteLabel: '注意', + importantLabel: '重要', + cautionLabel: '小心' + }, + codeCopyButtonTitle: '复制代码' +} + export default defineAdditionalConfig({ description: '由 Vite 和 Vue 驱动的静态站点生成器',