Skip to content

Commit

Permalink
fix: No name on parent routes (#101)
Browse files Browse the repository at this point in the history
Fixes #98
  • Loading branch information
elrolito authored and paulgv committed Jun 22, 2018
1 parent 2394878 commit fd51e3e
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/helpers/routes.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,13 @@ export const makeRoutes = (baseRoutes, {
console.warn(`[${MODULE_NAME}] Can't generate localized route for route '${name}' with locale '${locale}' because locale is not in the module's configuration`)
continue
}

// Make localized route name
localizedRoute.name = name + routesNameSeparator + locale

// Generate localized children routes if any
if (route.children) {
delete localizedRoute.name
localizedRoute.children = []
for (let i = 0, length1 = route.children.length; i < length1; i++) {
localizedRoute.children = localizedRoute.children.concat(buildLocalizedRoutes(route.children[i], { locales: [locale] }, true))
Expand All @@ -75,9 +79,6 @@ export const makeRoutes = (baseRoutes, {
path = componentOptions.paths[locale]
}

// Make localized route name
localizedRoute.name = name + routesNameSeparator + locale

// Add route prefix if needed
const shouldAddPrefix = (
// No prefix if app uses different locale domains
Expand Down

0 comments on commit fd51e3e

Please sign in to comment.