File tree Expand file tree Collapse file tree 2 files changed +3
-3
lines changed
packages/runtime/plugin-i18n/src/runtime Expand file tree Collapse file tree 2 files changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -132,7 +132,7 @@ export const useModernI18n = (): UseModernI18nReturn => {
132132 location
133133 ) {
134134 const currentPath = location . pathname ;
135- const entryPath = getEntryPath ( entryName ) ;
135+ const entryPath = getEntryPath ( ) ;
136136 const relativePath = currentPath . replace ( entryPath , '' ) ;
137137
138138 // Build new path with updated language
@@ -148,7 +148,7 @@ export const useModernI18n = (): UseModernI18nReturn => {
148148 } else if ( localePathRedirect && isBrowser ( ) && ! hasRouter ) {
149149 // Fallback: use window.history API when router is not available
150150 const currentPath = window . location . pathname ;
151- const entryPath = getEntryPath ( entryName ) ;
151+ const entryPath = getEntryPath ( ) ;
152152 const relativePath = currentPath . replace ( entryPath , '' ) ;
153153
154154 // Build new path with updated language
Original file line number Diff line number Diff line change 11import { getGlobalBasename } from '@modern-js/runtime/context' ;
22import { MAIN_ENTRY_NAME } from '@modern-js/utils/universal/constants' ;
33
4- export const getEntryPath = ( entryName ?: string ) : string => {
4+ export const getEntryPath = ( ) : string => {
55 const basename = getGlobalBasename ( ) ;
66 if ( basename ) {
77 return basename === '/' ? '' : basename ;
You can’t perform that action at this time.
0 commit comments