Skip to content

Commit

Permalink
feat: Allow usage of redirectRootToLocale option even with noPrefixDe…
Browse files Browse the repository at this point in the history
…faultLocale disabled

Closes nuxt-modules#45
  • Loading branch information
paulgv committed Mar 21, 2018
1 parent a2d1483 commit 6994072
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 2 deletions.
1 change: 0 additions & 1 deletion lib/templates/i18n.routing.middleware.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ middleware['i18n'] = function ({ app, req, res, route, params, redirect, error,
if (
route.path === '/' &&
'<%= options.redirectRootToLocale %>' &&
!('<%= options.redirectRootToLocale %>' === '<%= options.defaultLocale %>' && <%= options.noPrefixDefaultLocale %> === true) &&
localeCodes.includes('<%= options.redirectRootToLocale %>')) {
redirect('/<%= options.redirectRootToLocale %>/')
}
Expand Down
1 change: 0 additions & 1 deletion test/fixture/nuxt.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ module.exports = {
],
defaultLocale: 'en',
noPrefixDefaultLocale: true,
redirectRootToLocale: 'en',
vueI18n: {
messages: {
fr: {
Expand Down

0 comments on commit 6994072

Please sign in to comment.