Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Switch language button in login page not displaying language name #34197

Merged
merged 10 commits into from
Dec 20, 2024
6 changes: 6 additions & 0 deletions .changeset/kind-crabs-live.md
Original file line number Diff line number Diff line change
@@ -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
19 changes: 19 additions & 0 deletions apps/meteor/tests/e2e/login.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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', () => {
Expand All @@ -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([]);
Expand Down Expand Up @@ -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();
});
});
2 changes: 1 addition & 1 deletion packages/i18n/src/locales/en.i18n.json
Original file line number Diff line number Diff line change
Expand Up @@ -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}}</1>",
"registration.component.switchLanguage": "Change to <2>{{name}}</2>",
"registration.component.resetPassword": "Reset password",
"registration.component.form.emailOrUsername": "Email or username",
"registration.component.form.username": "Username",
Expand Down
2 changes: 1 addition & 1 deletion packages/i18n/src/locales/es.i18n.json
Original file line number Diff line number Diff line change
Expand Up @@ -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}}</1>",
"registration.component.switchLanguage": "Cambiar a <2>{{name}}</2>",
"registration.component.resetPassword": "Reestablecer contraseña",
"registration.component.form.username": "Nombre de usuario",
"registration.component.form.name": "Nombre",
Expand Down
2 changes: 1 addition & 1 deletion packages/i18n/src/locales/fi.i18n.json
Original file line number Diff line number Diff line change
Expand Up @@ -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}}</1>",
"registration.component.switchLanguage": "Vaihda kieleksi <2>{{name}}</2>",
"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",
Expand Down
2 changes: 1 addition & 1 deletion packages/i18n/src/locales/hi-IN.i18n.json
Original file line number Diff line number Diff line change
Expand Up @@ -5792,7 +5792,7 @@
"registration.component.login": "लॉग इन करें",
"registration.component.login.userNotFound": "उपयोगकर्ता नहीं मिला",
"registration.component.login.incorrectPassword": "गलत पासवर्ड",
"registration.component.switchLanguage": "<1>{{name}}</1> में बदलें",
"registration.component.switchLanguage": "<2>{{name}}</2> में बदलें",
"registration.component.resetPassword": "पासवर्ड रीसेट",
"registration.component.form.emailOrUsername": "ईमेल या उपयोगकर्ता का नाम",
"registration.component.form.username": "उपयोगकर्ता नाम",
Expand Down
2 changes: 1 addition & 1 deletion packages/i18n/src/locales/hu.i18n.json
Original file line number Diff line number Diff line change
Expand Up @@ -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}}</1>",
"registration.component.switchLanguage": "Átváltás <2>{{name}}</2>",
"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",
Expand Down
2 changes: 1 addition & 1 deletion packages/i18n/src/locales/nn.i18n.json
Original file line number Diff line number Diff line change
Expand Up @@ -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}}</1>",
"registration.component.switchLanguage": "Bytt til <2>{{name}}</2>",
"registration.component.resetPassword": "Tilbakestilling av passord",
"registration.component.form.username": "Brukernavn",
"registration.component.form.name": "Navn",
Expand Down
2 changes: 1 addition & 1 deletion packages/i18n/src/locales/no.i18n.json
Original file line number Diff line number Diff line change
Expand Up @@ -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}}</1>",
"registration.component.switchLanguage": "Bytt til <2>{{name}}</2>",
"registration.component.resetPassword": "Tilbakestilling av passord",
"registration.component.form.username": "Brukernavn",
"registration.component.form.name": "Navn",
Expand Down
2 changes: 1 addition & 1 deletion packages/i18n/src/locales/se.i18n.json
Original file line number Diff line number Diff line change
Expand Up @@ -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}}</1>",
"registration.component.switchLanguage": "Change to <2>{{name}}</2>",
"registration.component.resetPassword": "Reset password",
"registration.component.form.emailOrUsername": "Email or username",
"registration.component.form.username": "Username",
Expand Down
2 changes: 1 addition & 1 deletion packages/i18n/src/locales/sv.i18n.json
Original file line number Diff line number Diff line change
Expand Up @@ -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}}</1>",
"registration.component.switchLanguage": "Växla till <2>{{name}}</2>",
"registration.component.resetPassword": "Återställ lösenord",
"registration.component.form.emailOrUsername": "E-postadress eller användarnamn",
"registration.component.form.username": "Användarnamn",
Expand Down
Loading