feat(web): translate hunt screen and encounter card copy to English

Translates every static German string in hunt-page.component.html and
encounter-card.component.html/ts: headings, buttons, aria-labels,
loading/error text, the monster level label, and the encounter
action-label logic (Defeated/In Combat/Attack).

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01ACkMEDYiwtcfchqKkiUJNX
This commit is contained in:
Bastian Wagner
2026-08-21 22:11:50 +02:00
parent 1c0a13475c
commit 14d26d06a4
5 changed files with 36 additions and 39 deletions

View File

@@ -130,26 +130,26 @@ describe('HuntPageComponent', () => {
return fixture;
}
it('shows the hunting-unavailable state at the Südtor, with no Jagd beginnen button, and a way back to the location', async () => {
it('shows the hunting-unavailable state at the Südtor, with no Begin Hunt button, and a way back to the location', async () => {
const fixture = await setup(southGate);
const element = fixture.nativeElement as HTMLElement;
expect(element.textContent).toContain('Keine Jagd verfügbar');
expect(element.textContent).toContain('Am Südtor von Graufurt gibt es keine regulären Jagdgebiete.');
expect(element.textContent).toContain('No Hunt Available');
expect(element.textContent).toContain('No hunting ground is available here right now.');
expect(
Array.from(element.querySelectorAll('button')).some(
(button) => button.textContent?.trim() === 'Jagd beginnen',
(button) => button.textContent?.trim() === 'Begin Hunt',
),
).toBe(false);
const backButton = element.querySelector<HTMLButtonElement>('[data-hunt-to-location]');
expect(backButton?.textContent?.trim()).toBe('Zurück zum Ort');
expect(backButton?.textContent?.trim()).toBe('Back to Location');
backButton?.click();
expect(router.navigate).toHaveBeenCalledWith(['/location']);
});
it('calls startHunt when Jagd beginnen is clicked at a hunting-enabled location', async () => {
it('calls startHunt when Begin Hunt is clicked at a hunting-enabled location', async () => {
const fixture = await setup(burnedRoad);
const element = fixture.nativeElement as HTMLElement;
@@ -175,11 +175,11 @@ describe('HuntPageComponent', () => {
'.encounter-card__artwork[src="/images/combat/sprites/road-bandit-620.png"]',
).length,
).toBe(1);
expect(element.textContent).toContain('Stufe 1');
expect(element.textContent).toContain('Stufe 3');
expect(element.textContent).toContain('Level 1');
expect(element.textContent).toContain('Level 3');
});
it('calls refreshHunt when Neu suchen is clicked', async () => {
it('calls refreshHunt when Search Again is clicked', async () => {
const fixture = await setup(burnedRoad, threeEncounterHunt);
const element = fixture.nativeElement as HTMLElement;
@@ -196,7 +196,7 @@ describe('HuntPageComponent', () => {
const element = fixture.nativeElement as HTMLElement;
const attackButtons = Array.from(element.querySelectorAll('button')).filter(
(button) => button.textContent?.trim() === 'Angreifen',
(button) => button.textContent?.trim() === 'Attack',
);
expect(attackButtons.length).toBe(3);
@@ -214,7 +214,7 @@ describe('HuntPageComponent', () => {
const element = fixture.nativeElement as HTMLElement;
const attackButtons = Array.from(element.querySelectorAll('button')).filter(
(button) => button.textContent?.trim() === 'Angreifen',
(button) => button.textContent?.trim() === 'Attack',
);
attackButtons[0].click();
await Promise.resolve();
@@ -234,7 +234,7 @@ describe('HuntPageComponent', () => {
const element = fixture.nativeElement as HTMLElement;
const attackButtons = Array.from(element.querySelectorAll('button')).filter(
(button) => button.textContent?.trim() === 'Angreifen',
(button) => button.textContent?.trim() === 'Attack',
);
attackButtons[0].click();
await Promise.resolve();
@@ -254,7 +254,7 @@ describe('HuntPageComponent', () => {
const element = fixture.nativeElement as HTMLElement;
const attackButtons = Array.from(element.querySelectorAll('button')).filter(
(button) => button.textContent?.trim() === 'Angreifen',
(button) => button.textContent?.trim() === 'Attack',
);
attackButtons[0].click();
await Promise.resolve();
@@ -374,7 +374,7 @@ describe('HuntPageComponent', () => {
fixture.detectChanges();
const element = fixture.nativeElement as HTMLElement;
expect(element.textContent).toContain('Du suchst nach Spuren...');
expect(element.textContent).toContain('You search for tracks...');
expect(element.querySelector<HTMLButtonElement>('[data-hunt-start]')?.disabled).toBe(true);
});