Skip to content

Commit eeda1c5

Browse files
author
Tuqire Hussain
committed
fix: support locales with names that match other locales (en and en-us)
1 parent 75300c3 commit eeda1c5

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

src/plugins/routing.js

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -74,16 +74,12 @@ function getRouteBaseNameFactory (contextRoute) {
7474
}
7575

7676
return function getRouteBaseName (route) {
77-
const LOCALE_CODE_KEY = '<%= options.LOCALE_CODE_KEY %>'
78-
const getLocaleCodes = <%= options.getLocaleCodes %>
7977
const routesNameSeparator = '<%= options.routesNameSeparator %>'
8078
route = routeGetter.call(this, route)
8179
if (!route.name) {
8280
return null
8381
}
84-
const locales = getLocaleCodes(<%= JSON.stringify(options.locales) %>)
85-
const regexp = new RegExp(routesNameSeparator + '(' + locales.join('|') + ')')
86-
return route.name.replace(regexp, '')
82+
return route.name.split(routesNameSeparator)[0]
8783
}
8884
}
8985

0 commit comments

Comments
 (0)