-
Notifications
You must be signed in to change notification settings - Fork 462
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: default locale catch-all route overrides locale-specific one
With there being a catch-all route (_.vue) in pages directory, depending on the order of locales in configuration, default locale's route could shadow locale-specific one due to being first on the list of generated routes. For example, routes were generated like so: ``` routes: [{ path: "/*", component: _0bdbeb02, name: "all___en" }, { path: "/fr/*", component: _0bdbeb02, name: "all___fr" }], ``` which meant that `/*` route never allowed later ones to be matched. Fix by sorting routes by specificity, using function exposed by `@nuxt/utils` (only from 2.10.2). Resolves #152
- Loading branch information
Showing
4 changed files
with
46 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
const { resolve } = require('path') | ||
|
||
module.exports = { | ||
...require('../base.config.js'), | ||
buildDir: resolve(__dirname, '.nuxt'), | ||
srcDir: __dirname | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
<template> | ||
<div> | ||
<div id="current-locale">locale: {{ $i18n.locale }}</div> | ||
</div> | ||
</template> | ||
|
||
<script> | ||
export default {} | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters