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

Sidebar links are not updated when changing language #454

Closed
george-silva opened this issue May 16, 2018 · 3 comments
Closed

Sidebar links are not updated when changing language #454

george-silva opened this issue May 16, 2018 · 3 comments

Comments

@george-silva
Copy link

  • Linux Mint 18
  • Node.js 10
  • VuePress 0.84
  • Is this a global or local install? Global
  • Which package manager did you use for the install? NPM

Hello!

Congratulations on the project! Marvelous!

Minor problem:

  1. I have a simple website configured published in github pages (but I found this while testing locally)
  2. I've created three simple pages and added to the sidebar, so far so good.
  3. Created the same three pages in the i18n version (pt-br)
  4. When I click the change language dropdown, it changes the language only for the page I'm looking at. It does not replace the links for the sidebar, for example.
@meteorlxy
Copy link
Member

check the config.js of official docs to find how to set theme locale sidebar

https://github.com/vuejs/vuepress/blob/master/docs/.vuepress/config.js

@ulivz
Copy link
Member

ulivz commented May 16, 2018

When using i18n, you need add locales as well as the themeConfig.locales:

module.exports = {
    locales: {
        '/': {
            lang: 'en-US',
            title: 'George\'s Journal',
            description: 'A personal website and "blog", from me: George'
        },
        '/pt-BR/': {
            // ...
        }
    },
    themeConfig: {
        locales: {
            '/': {
                sidebar: [
                    // ...
                ]
            },
            '/pt-BR/': {
                sidebar: [
                    // ...
                ]
            }
        }
    }
}

@ulivz ulivz closed this as completed May 16, 2018
@george-silva
Copy link
Author

george-silva commented May 16, 2018 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants