Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: setup the translation helper #2373

Merged
merged 3 commits into from
Mar 20, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions docs/.vitepress/theme/index.mts
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import { h } from 'vue'
import Theme from 'vitepress/theme'
import TranslationStatus from 'vitepress-translation-helper/ui/TranslationStatus.vue'
import status from '../translation-status.json'

const i18nLabels = {
// TODO: to be translated
fr: 'The translation is synced to the docs on ${date} of which the commit hash is <code>${hash}</code>.',
}


export default {
...Theme,
Layout() {
return h(Theme.Layout, null, {
'doc-before': () => h(TranslationStatus, { status, i18nLabels }),
})
},
}
6 changes: 6 additions & 0 deletions docs/.vitepress/translation-status.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"fr": {
"hash": "1d8e1ee",
"date": "2024-02-14"
}
}
4 changes: 4 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@
"unplugin-vue-components": "0.26.0",
"vite": "5.1.6",
"vitepress": "1.0.0-rc.45",
"vitepress-translation-helper": "^0.1.3",
"vitest": "1.3.1",
"vue": "3.4.21",
"vue-class-component": "8.0.0-rc.1",
Expand All @@ -81,6 +82,9 @@
"lint:fix": "pnpm run lint --fix",
"docs:dev": "vitepress dev docs",
"docs:build": "vitepress build docs",
"docs:translation:compare": "v-translation compare --status-file=docs/.vitepress/translation-status.json",
"docs:translation:update": "v-translation update --status-file=docs/.vitepress/translation-status.json",
"docs:translation:status": "v-translation status --status-file=docs/.vitepress/translation-status.json",
"vue-tsc": "vue-tsc --noEmit -p tsconfig.volar.json",
"prepublishOnly": "pnpm run build"
},
Expand Down
44 changes: 44 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.