feat: add i18n in login page (#5947)
* feat: add i18n in login page * fix: add word space and put the app name into the title * fix: remove duplicate replace title * fix: prettier format code * fix: fix typescript check warning * fix: add zh-cn locale file code owner * fix: use existing flag locale to the login page Co-authored-by: Joe Previte <jjprevite@gmail.com>
This commit is contained in:
@ -138,5 +138,16 @@ describe("login", () => {
|
||||
expect(resp.status).toBe(200)
|
||||
expect(htmlContent).toContain(`Welcome to ${appName}`)
|
||||
})
|
||||
|
||||
it("should return correct welcome text when locale is set to non-English", async () => {
|
||||
process.env.PASSWORD = previousEnvPassword
|
||||
const locale = "zh-cn"
|
||||
const codeServer = await integration.setup([`--locale=${locale}`], "")
|
||||
const resp = await codeServer.fetch("/login", { method: "GET" })
|
||||
|
||||
const htmlContent = await resp.text()
|
||||
expect(resp.status).toBe(200)
|
||||
expect(htmlContent).toContain(`欢迎来到 code-server`)
|
||||
})
|
||||
})
|
||||
})
|
||||
|
Reference in New Issue
Block a user