feat(web): translate error messages surfaced from API error codes to English
Translates the five client-side error-message maps (world, hunting, combat, inventory, local-location stores) that re-translate already-English API error codes back to display text, per design doc §4. Also fixes four component specs that hard-coded the same German strings when asserting rendered error text (combat-page, hunt-page, location-interaction-panel, location-page).
This commit is contained in:
@@ -140,6 +140,6 @@ describe('InventoryStore', () => {
|
||||
|
||||
await store.equip('item-blade');
|
||||
|
||||
expect(store.error()).toBe('Dieser Gegenstand kann nicht ausgerüstet werden.');
|
||||
expect(store.error()).toBe("This item can't be equipped.");
|
||||
});
|
||||
});
|
||||
|
||||
@@ -5,15 +5,15 @@ import { EquipmentResponse, InventoryItem, InventoryResponse } from '../../core/
|
||||
import { GameApiService } from '../../core/api/game-api.service';
|
||||
import { WorldStore } from '../world/world.store';
|
||||
|
||||
const GENERIC_ERROR_MESSAGE = 'Inventar konnte nicht geladen werden.';
|
||||
const GENERIC_ERROR_MESSAGE = 'Could not load the inventory.';
|
||||
|
||||
// Mirrors `EquipmentErrorCode` in `apps/api/src/equipment/equipment.errors.ts`.
|
||||
const EQUIPMENT_ERROR_MESSAGES: Readonly<Record<string, string>> = {
|
||||
CHARACTER_ITEM_NOT_FOUND: 'Dieser Gegenstand konnte nicht gefunden werden.',
|
||||
ITEM_NOT_OWNED: 'Dieser Gegenstand gehört dir nicht.',
|
||||
ITEM_NOT_EQUIPPABLE: 'Dieser Gegenstand kann nicht ausgerüstet werden.',
|
||||
INVALID_EQUIPMENT_SLOT: 'Dieser Ausrüstungsplatz ist ungültig.',
|
||||
CHARACTER_IN_COMBAT: 'Ausrüstung kann während eines Kampfes nicht geändert werden.',
|
||||
CHARACTER_ITEM_NOT_FOUND: 'This item could not be found.',
|
||||
ITEM_NOT_OWNED: "This item doesn't belong to you.",
|
||||
ITEM_NOT_EQUIPPABLE: "This item can't be equipped.",
|
||||
INVALID_EQUIPMENT_SLOT: 'This equipment slot is invalid.',
|
||||
CHARACTER_IN_COMBAT: "Equipment can't be changed during combat.",
|
||||
};
|
||||
|
||||
@Injectable({ providedIn: 'root' })
|
||||
|
||||
Reference in New Issue
Block a user