Description
When a user clicks the language toggle to switch languages, the NEXT_LOCALE cookie is set with the corresponding locale. Subsequent page loads respect this cookie and serve the correct translations for that locale. However, there are two issues:
Issue 1: <html lang> attribute mismatch
The server always renders <html lang="en"> in the HTML, regardless of which locale is actually being served. When NEXT_LOCALE=zh, the page content is in Chinese but the lang attribute stays en.
Issue 2: No way to reset locale (cookie persists)
Once NEXT_LOCALE is set (e.g., to zh), there is no visible UI to switch back. The language toggle is not available after login on all pages. The cookie persists across InPrivate sessions if the browser window stays open, and the only way to reset it is:
- Manually delete the cookie via DevTools
- Append
?lang=en to the URL
- Close all InPrivate windows and open a fresh one
Steps to Reproduce
- Visit
http://localhost:3300/admin/repositories
- If
NEXT_LOCALE=zh cookie is set, observe Chinese translations in embedded JSON data
- Check
<html lang> — it always shows en regardless
- Try to find a UI control to switch back to English — none exists
Expected Behavior
<html lang> should match the actual locale being served
- There should be a user-visible way to reset/change the locale cookie (language toggle should be accessible on admin pages)
Screenshot
(Screenshot showing Chinese translations with <html lang="en"> — attach manually via web UI)
Environment
- OpenDeepWiki (latest upstream HEAD)
- Docker Desktop deployment
- Browser: Opera (reproducible in InPrivate mode)
Description
When a user clicks the language toggle to switch languages, the
NEXT_LOCALEcookie is set with the corresponding locale. Subsequent page loads respect this cookie and serve the correct translations for that locale. However, there are two issues:Issue 1:
<html lang>attribute mismatchThe server always renders
<html lang="en">in the HTML, regardless of which locale is actually being served. WhenNEXT_LOCALE=zh, the page content is in Chinese but thelangattribute staysen.Issue 2: No way to reset locale (cookie persists)
Once
NEXT_LOCALEis set (e.g., tozh), there is no visible UI to switch back. The language toggle is not available after login on all pages. The cookie persists across InPrivate sessions if the browser window stays open, and the only way to reset it is:?lang=ento the URLSteps to Reproduce
http://localhost:3300/admin/repositoriesNEXT_LOCALE=zhcookie is set, observe Chinese translations in embedded JSON data<html lang>— it always showsenregardlessExpected Behavior
<html lang>should match the actual locale being servedScreenshot
(Screenshot showing Chinese translations with
<html lang="en">— attach manually via web UI)Environment