Skip to content

Commit 91fcf07

Browse files
committed
feat: remove getEntryPath params
1 parent 46fbe74 commit 91fcf07

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

packages/runtime/plugin-i18n/src/runtime/context.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff 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

packages/runtime/plugin-i18n/src/runtime/utils.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { getGlobalBasename } from '@modern-js/runtime/context';
22
import { 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;

0 commit comments

Comments
 (0)