docs: translate container labels and the code copy button title

Uses the new `locales.<index>.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 <noreply@anthropic.com>
pull/5335/head
Divyansh Singh 2 weeks ago
parent faaa4a124e
commit f21ec91763

@ -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: {

@ -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.',

@ -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',

@ -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 による静的サイトジェネレーター',

@ -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 기반 정적 사이트 생성기.',

@ -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.',

@ -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.',

@ -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 驱动的静态站点生成器',

Loading…
Cancel
Save