File tree Expand file tree Collapse file tree 2 files changed +8
-1
lines changed
Expand file tree Collapse file tree 2 files changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -14,7 +14,8 @@ export const LOCALE_FILE_KEY = 'file'
1414// Options
1515export const STRATEGIES = {
1616 PREFIX : 'prefix' ,
17- PREFIX_EXCEPT_DEFAULT : 'prefix_except_default'
17+ PREFIX_EXCEPT_DEFAULT : 'prefix_except_default' ,
18+ PREFIX_AND_DEFAULT : 'prefix_and_default'
1819}
1920export const COMPONENT_OPTIONS_KEY = 'nuxtI18n'
2021export const DEFAULT_OPTIONS = {
Original file line number Diff line number Diff line change @@ -88,13 +88,19 @@ export const makeRoutes = (baseRoutes, {
8888 // Skip default locale if strategy is PREFIX_EXCEPT_DEFAULT
8989 ! ( locale === defaultLocale && strategy === STRATEGIES . PREFIX_EXCEPT_DEFAULT )
9090 )
91+
92+ if ( locale === defaultLocale && strategy === STRATEGIES . PREFIX_AND_DEFAULT ) {
93+ routes . push ( { ...localizedRoute , path} )
94+ }
95+
9196 if ( shouldAddPrefix ) {
9297 path = `/${ locale } ${ path } `
9398 }
9499
95100 localizedRoute . path = path
96101
97102 routes . push ( localizedRoute )
103+
98104 }
99105
100106 return routes
You can’t perform that action at this time.
0 commit comments