hamedbahram / next-i18n Goto Github PK
View Code? Open in Web Editor NEWHome Page: https://next-i18n-ten.vercel.app
Home Page: https://next-i18n-ten.vercel.app
remove-default-locale
Branch - Locale Switching IssueEnvironment:
remove-default-locale
en
de
Description:
There appears to be a bug affecting locale switching functionality. When the browser's default locale is set to English ('en') and the project's default locale is set to German ('de'), the following issue occurs:
Steps to Reproduce:
Expected Behavior:
Upon clicking the switch button, the application should redirect to the '/de' route.
Actual Behavior:
The button does not work as intended. The redirectedPathName
becomes '/' and the middleware interprets this as if no locale is found, resulting in a redirect back to the user's default locale ('en'). Consequently, switching to '/de' via the button is not possible.
When I put the middleware file in my project, the photos that were in the public folder were not loaded.
I think the code snippet for this isπ€·πΌββοΈ:
export const config = {
// Matcher ignoring `/_next/` and `/api/`
matcher: ['/((?!api|_next/static|_next/image|favicon.ico).*)']
}
I was trying to chain multiple middlewares with the lang checker middleware and I'm getting the locale missing error when I try to load pages with defaultLocale(without providing the lang parameter)
I've tried to rename the middleware function to middleware2 and just simply call it from a middleware function and that also giving me error.
here is the middleware function I was calling:
export async function middleware(request: NextRequest) {
await middleware2(request);
}
A declarative, efficient, and flexible JavaScript library for building user interfaces.
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. πππ
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google β€οΈ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.