Skip to content

Add internationalization feature #631

Closed
@kiaking

Description

@kiaking

related #628

VitePress Next don't have this feature yet. Let's implement it. While doing so, I would also like to suggest new config structure for locales option.

Currently, we must define two locales when defining multi locale site. One in app config level, and one in theme config level.

I think it's much easier to just be able to define locale on top level only.

export default {
  // Top level config for default and fallbacks.
  lang: 'en',
  title: 'VitePress',
  themeConfig: { ... }
  
  // All other locale settings.
  locales: {
    fr: {
      lang: 'fr',
      title: 'VitePress',
      themeConfig: { ... }
    },

    ja: {
      lang: 'ja',
      title: 'VitePress',
      themeConfig: { ... }
    }
  }
}

This should make typings much simpler too (maybe). It should eliminate weird situation like in #628 🤔

Also, maybe not required for 1.0.0 release, but consider #291 as well.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions