diff --git a/.changeset/kind-crabs-live.md b/.changeset/kind-crabs-live.md new file mode 100644 index 000000000000..93b2218f828b --- /dev/null +++ b/.changeset/kind-crabs-live.md @@ -0,0 +1,6 @@ +--- +"@rocket.chat/meteor": patch +"@rocket.chat/i18n": patch +--- + +fixes "Change to language" button in login page not displaying the target language diff --git a/apps/meteor/tests/e2e/login.spec.ts b/apps/meteor/tests/e2e/login.spec.ts index 63e4949c31d9..75340c64506b 100644 --- a/apps/meteor/tests/e2e/login.spec.ts +++ b/apps/meteor/tests/e2e/login.spec.ts @@ -2,6 +2,7 @@ import { faker } from '@faker-js/faker'; import { DEFAULT_USER_CREDENTIALS } from './config/constants'; import { Utils, Registration } from './page-objects'; +import { setSettingValueById } from './utils/setSettingValueById'; import { test, expect } from './utils/test'; test.describe.parallel('Login', () => { @@ -15,6 +16,10 @@ test.describe.parallel('Login', () => { await page.goto('/home'); }); + test.afterAll(async ({ api }) => { + await setSettingValueById(api, 'Language', 'en'); + }); + test('should not have any accessibility violations', async ({ makeAxeBuilder }) => { const results = await makeAxeBuilder().analyze(); expect(results.violations).toEqual([]); @@ -50,4 +55,18 @@ test.describe.parallel('Login', () => { await expect(poUtils.mainContent).toBeVisible(); }); }); + + test('Should correctly display switch language button', async ({ page, api }) => { + expect((await setSettingValueById(api, 'Language', 'pt-BR')).status()).toBe(200); + + const button = page.getByRole('button', { name: 'Change to português (Brasil)' }); + await button.click(); + + await expect(page.getByRole('button', { name: 'Fazer Login' })).toBeVisible(); + + const buttonEnglish = page.getByRole('button', { name: 'Change to English' }); + await buttonEnglish.click(); + + await expect(page.getByRole('button', { name: 'Login' })).toBeVisible(); + }); }); diff --git a/packages/i18n/src/locales/en.i18n.json b/packages/i18n/src/locales/en.i18n.json index 98cf3b1ef86f..e9c452eaa45c 100644 --- a/packages/i18n/src/locales/en.i18n.json +++ b/packages/i18n/src/locales/en.i18n.json @@ -6315,7 +6315,7 @@ "registration.component.login": "Login", "registration.component.login.userNotFound": "User not found", "registration.component.login.incorrectPassword": "Incorrect password", - "registration.component.switchLanguage": "Change to <1>{{name}}", + "registration.component.switchLanguage": "Change to <2>{{name}}", "registration.component.resetPassword": "Reset password", "registration.component.form.emailOrUsername": "Email or username", "registration.component.form.username": "Username", diff --git a/packages/i18n/src/locales/es.i18n.json b/packages/i18n/src/locales/es.i18n.json index fc1362aa7eeb..31b3b41aefb1 100644 --- a/packages/i18n/src/locales/es.i18n.json +++ b/packages/i18n/src/locales/es.i18n.json @@ -4788,7 +4788,7 @@ "registration.component.login": "Iniciar sesión", "registration.component.login.userNotFound": "Usuario no encontrado", "registration.component.login.incorrectPassword": "Contraseña incorrecta", - "registration.component.switchLanguage": "Cambiar a <1>{{name}}", + "registration.component.switchLanguage": "Cambiar a <2>{{name}}", "registration.component.resetPassword": "Reestablecer contraseña", "registration.component.form.username": "Nombre de usuario", "registration.component.form.name": "Nombre", diff --git a/packages/i18n/src/locales/fi.i18n.json b/packages/i18n/src/locales/fi.i18n.json index 6365656bf6cc..b1435822c864 100644 --- a/packages/i18n/src/locales/fi.i18n.json +++ b/packages/i18n/src/locales/fi.i18n.json @@ -5505,7 +5505,7 @@ "registration.component.login": "Kirjaudu", "registration.component.login.userNotFound": "Käyttäjää ei löydy", "registration.component.login.incorrectPassword": "Väärä salasana", - "registration.component.switchLanguage": "Vaihda kieleksi <1>{{name}}", + "registration.component.switchLanguage": "Vaihda kieleksi <2>{{name}}", "registration.component.resetPassword": "Nollaa salasana", "registration.component.form.emailOrUsername": "Sähköpostiosoite tai käyttäjätunnus", "registration.component.form.username": "Käyttäjätunnus", diff --git a/packages/i18n/src/locales/hi-IN.i18n.json b/packages/i18n/src/locales/hi-IN.i18n.json index 1a6a29a71cd6..35dd69ec28ac 100644 --- a/packages/i18n/src/locales/hi-IN.i18n.json +++ b/packages/i18n/src/locales/hi-IN.i18n.json @@ -5792,7 +5792,7 @@ "registration.component.login": "लॉग इन करें", "registration.component.login.userNotFound": "उपयोगकर्ता नहीं मिला", "registration.component.login.incorrectPassword": "गलत पासवर्ड", - "registration.component.switchLanguage": "<1>{{name}} में बदलें", + "registration.component.switchLanguage": "<2>{{name}} में बदलें", "registration.component.resetPassword": "पासवर्ड रीसेट", "registration.component.form.emailOrUsername": "ईमेल या उपयोगकर्ता का नाम", "registration.component.form.username": "उपयोगकर्ता नाम", diff --git a/packages/i18n/src/locales/hu.i18n.json b/packages/i18n/src/locales/hu.i18n.json index 90b0c1d8ef82..9f2ed6f082aa 100644 --- a/packages/i18n/src/locales/hu.i18n.json +++ b/packages/i18n/src/locales/hu.i18n.json @@ -5299,7 +5299,7 @@ "registration.component.login": "Bejelentkezés", "registration.component.login.userNotFound": "A felhasználó nem található", "registration.component.login.incorrectPassword": "Hibás jelszó", - "registration.component.switchLanguage": "Átváltás <1>{{name}}", + "registration.component.switchLanguage": "Átváltás <2>{{name}}", "registration.component.resetPassword": "Jelszó visszaállítása", "registration.component.form.emailOrUsername": "E-mail-cím vagy felhasználónév", "registration.component.form.username": "Felhasználónév", diff --git a/packages/i18n/src/locales/nn.i18n.json b/packages/i18n/src/locales/nn.i18n.json index 9b9f6935a254..6637364b8265 100644 --- a/packages/i18n/src/locales/nn.i18n.json +++ b/packages/i18n/src/locales/nn.i18n.json @@ -4475,7 +4475,7 @@ "registration.component.login": "Logg inn", "registration.component.login.userNotFound": "Bruker ikke funnet", "registration.component.login.incorrectPassword": "feil passord", - "registration.component.switchLanguage": "Bytt til <1>{{name}}", + "registration.component.switchLanguage": "Bytt til <2>{{name}}", "registration.component.resetPassword": "Tilbakestilling av passord", "registration.component.form.username": "Brukernavn", "registration.component.form.name": "Navn", diff --git a/packages/i18n/src/locales/no.i18n.json b/packages/i18n/src/locales/no.i18n.json index 952b0ca9b711..39a50fbad692 100644 --- a/packages/i18n/src/locales/no.i18n.json +++ b/packages/i18n/src/locales/no.i18n.json @@ -4475,7 +4475,7 @@ "registration.component.login": "Logg inn", "registration.component.login.userNotFound": "Bruker ikke funnet", "registration.component.login.incorrectPassword": "feil passord", - "registration.component.switchLanguage": "Bytt til <1>{{name}}", + "registration.component.switchLanguage": "Bytt til <2>{{name}}", "registration.component.resetPassword": "Tilbakestilling av passord", "registration.component.form.username": "Brukernavn", "registration.component.form.name": "Navn", diff --git a/packages/i18n/src/locales/se.i18n.json b/packages/i18n/src/locales/se.i18n.json index 3ac677c4dcbd..2c2512c9aba6 100644 --- a/packages/i18n/src/locales/se.i18n.json +++ b/packages/i18n/src/locales/se.i18n.json @@ -6172,7 +6172,7 @@ "registration.component.login": "Login", "registration.component.login.userNotFound": "User not found", "registration.component.login.incorrectPassword": "Incorrect password", - "registration.component.switchLanguage": "Change to <1>{{name}}", + "registration.component.switchLanguage": "Change to <2>{{name}}", "registration.component.resetPassword": "Reset password", "registration.component.form.emailOrUsername": "Email or username", "registration.component.form.username": "Username", diff --git a/packages/i18n/src/locales/sv.i18n.json b/packages/i18n/src/locales/sv.i18n.json index 69b59f03c321..d097e915b2e4 100644 --- a/packages/i18n/src/locales/sv.i18n.json +++ b/packages/i18n/src/locales/sv.i18n.json @@ -5513,7 +5513,7 @@ "registration.component.login": "Logga in", "registration.component.login.userNotFound": "Användare inte hittad", "registration.component.login.incorrectPassword": "Felaktigt lösenord", - "registration.component.switchLanguage": "Växla till <1>{{name}}", + "registration.component.switchLanguage": "Växla till <2>{{name}}", "registration.component.resetPassword": "Återställ lösenord", "registration.component.form.emailOrUsername": "E-postadress eller användarnamn", "registration.component.form.username": "Användarnamn",