https://github.com/zvecr/vuepress-plugin-i18n-fallback
Enable fallback of missing/untranslated vuepress content
https://github.com/zvecr/vuepress-plugin-i18n-fallback
i18n vuepress vuepress-plugin
Last synced: 3 months ago
JSON representation
Enable fallback of missing/untranslated vuepress content
- Host: GitHub
- URL: https://github.com/zvecr/vuepress-plugin-i18n-fallback
- Owner: zvecr
- License: mit
- Created: 2022-01-07T21:36:14.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2022-01-08T23:07:04.000Z (over 3 years ago)
- Last Synced: 2025-01-30T04:15:35.650Z (5 months ago)
- Topics: i18n, vuepress, vuepress-plugin
- Language: JavaScript
- Homepage:
- Size: 4.88 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# vuepress-plugin-i18n-fallback
> Enable fallback of missing/untranslated content when using
[multi-language support](https://vuepress.vuejs.org/guide/i18n.html#site-level-i18n-config).Translations for large projects can be a pain... This plugin aims to solve:
* Easier support for partial translations
* Jumping back to the root when a user hits untranslated content
* Manual copy/symlink build workaroundsUsing the following example:
```
docs
├─ README.md
├─ foo.md
├─ bar.md
└─ zh
├─ README.md
└─ foo.md
```Produces the following behaviour:
* `/zh/foo.html` will serve the content of `docs/zh/foo.md`
* `/zh/bar.html` will serve the content of `docs/foo.md`## Usage
1. Install plugin
```
yarn add vuepress-plugin-i18n-fallback -D
# OR npm install vuepress-plugin-i18n-fallback -D
```2. Enable plugin
```
//.vuepress/config.js
module.exports = {
plugins: [
'vuepress-plugin-i18n-fallback'
]
}
```## Issues
1. Links on fallback pages are currently not rewritten.
* In the example above, links on `/zh/bar.html` will jump back to the default locale.## Example
A minimal example has been provided in the `example` directory of this repo. To get started:
```
yarn --cwd example install && yarn --cwd example docs:dev
```