-
-
Notifications
You must be signed in to change notification settings - Fork 95
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #135 from zetxek/133-bug-lang-attribute-in-html-do…
…esnt-change-with-translations [bugfix] lang attribute in html doesnt change with translations
- Loading branch information
Showing
17 changed files
with
160 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
--- | ||
date: 2022-01-01T00:00:00+01:00 | ||
draft: false | ||
title: "Trabajo #1" | ||
jobTitle: "Becario Junior" | ||
company: "Internet Affairs Inc." | ||
location: "Stavanger, Noruega" | ||
duration: "2022-2024" | ||
--- | ||
### Arreglando el mundo, un byte a la vez | ||
|
||
El comienzo de una gran carrera. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
--- | ||
date: 2023-01-01T00:00:00+01:00 | ||
draft: false | ||
title: "Trabajo #2" | ||
jobTitle: "Becario Jefe" | ||
company: "Internet Affairs Inc." | ||
location: "Stavanger, Noruega" | ||
duration: "2023-2024" | ||
--- | ||
### Arreglando el mundo, un byte a la vez | ||
|
||
Continuando la misión. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
--- | ||
date: 2023-01-01T00:00:00+01:00 | ||
draft: false | ||
title: "Poste #2" | ||
jobTitle: "Stagiaire en Chef" | ||
company: "Internet Affairs Inc." | ||
location: "Stavanger, Norvège" | ||
duration: "2023-2024" | ||
--- | ||
### Réparer le monde, un octet à la fois | ||
|
||
Poursuivant la quête. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
--- | ||
date: 2024-01-01T00:00:00+01:00 | ||
draft: false | ||
title: "Trabajo #3" | ||
jobTitle: "Director Ejecutivo" | ||
company: "Internet Affairs Inc." | ||
location: "Stavanger, Noruega" | ||
duration: "2024-ahora" | ||
--- | ||
### Arreglando el mundo, un byte a la vez | ||
|
||
¡Adquisición hostil - ¿quién es el jefe ahora?! |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
--- | ||
date: 2024-01-01T00:00:00+01:00 | ||
draft: false | ||
title: "Poste #3" | ||
jobTitle: "PDG" | ||
company: "Internet Affairs Inc." | ||
location: "Stavanger, Norvège" | ||
duration: "2024-maintenant" | ||
--- | ||
### Réparer le monde, un octet à la fois | ||
|
||
Prise de contrôle hostile - qui est le patron maintenant ! |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
import { test, expect } from '@playwright/test'; | ||
|
||
const BASE_URL = 'http://localhost:1313'; | ||
|
||
test.describe('Language switching functionality', () => { | ||
test('switches between languages and verifies lang attribute', async ({ page }) => { | ||
// Go to homepage | ||
await page.goto(BASE_URL); | ||
|
||
// Verify initial English state | ||
await expect(page.locator('html')).toHaveAttribute('lang', 'en'); | ||
await expect(page.getByText('Language')).toBeVisible(); | ||
await expect(page.getByText('Experience').first()).toBeVisible(); | ||
|
||
// Switch to Spanish | ||
await page.locator('nav#footer-language-selector button').click(); | ||
await page.getByText('Español').click(); | ||
|
||
// Verify Spanish | ||
await expect(page.locator('html')).toHaveAttribute('lang', 'es'); | ||
await expect(page.getByText('Idioma')).toBeVisible(); | ||
await expect(page.getByText('Experiencia').first()).toBeVisible(); | ||
|
||
// Switch to French | ||
await page.locator('nav#footer-language-selector button').click(); | ||
await page.getByText('Français').click(); | ||
|
||
// Verify French | ||
await expect(page.locator('html')).toHaveAttribute('lang', 'fr'); | ||
await expect(page.getByText('Langue')).toBeVisible(); | ||
await expect(page.getByText('Expérience').first()).toBeVisible(); | ||
}); | ||
|
||
test('maintains language when navigating to experience pages', async ({ page }) => { | ||
// Start in Spanish | ||
await page.goto(`${BASE_URL}/es/`); | ||
await expect(page.locator('html')).toHaveAttribute('lang', 'es'); | ||
|
||
// Click on an experience link | ||
await page.getByText('Ver todo').click(); | ||
|
||
// Verify URL and language maintained | ||
await expect(page).toHaveURL(`${BASE_URL}/es/experience/`); | ||
await expect(page.locator('html')).toHaveAttribute('lang', 'es'); | ||
await expect(page.getByText('Experiencia').first()).toBeVisible(); | ||
}); | ||
|
||
test('preserves translations across page types', async ({ page }) => { | ||
// Go to French experience page | ||
await page.goto(`${BASE_URL}/fr/experience`); | ||
|
||
// Verify French state | ||
await expect(page.locator('html')).toHaveAttribute('lang', 'fr'); | ||
await expect(page.getByText('Expérience').first()).toBeVisible(); | ||
|
||
// Navigate to home | ||
await page.getByText('🏠 HOME').click(); | ||
|
||
// Verify language maintained | ||
await expect(page.locator('html')).toHaveAttribute('lang', 'fr'); | ||
await expect(page.getByText('Langue').first()).toBeVisible(); | ||
}); | ||
}); |