From 203ad8069d3311571f2a7cd7ef4a5af1e6179a32 Mon Sep 17 00:00:00 2001 From: enricobuehler Date: Fri, 26 Jun 2026 07:22:28 +0000 Subject: [PATCH] fix(web): library badge shows the actual store, not always "Steam" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The GameCard badge hard-coded steam-vs-custom, so any non-Steam non-custom store rendered with the "Steam" label. Add storeLabel(store): steam/custom keep their localized strings, every other store is shown as a capitalized proper noun — so the new Lutris/Heroic providers (and future ones) surface correctly with no per-store translation. tsc --noEmit clean. Co-Authored-By: Claude Opus 4.8 (1M context) --- web/src/sections/Library/view.tsx | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/web/src/sections/Library/view.tsx b/web/src/sections/Library/view.tsx index 7f0cb7b..3b95304 100644 --- a/web/src/sections/Library/view.tsx +++ b/web/src/sections/Library/view.tsx @@ -19,6 +19,22 @@ function customId(entry: GameEntry): string { : entry.id; } +/** + * Display label for a store badge. Steam and custom keep their localized strings; every other store + * (lutris, heroic, epic, …) is a proper noun shown capitalized, so new providers surface correctly + * without a translation per store. + */ +function storeLabel(store: string): string { + switch (store) { + case "custom": + return m.library_store_custom(); + case "steam": + return m.library_store_steam(); + default: + return store.charAt(0).toUpperCase() + store.slice(1); + } +} + interface FormState { title: string; portrait: string; @@ -276,7 +292,7 @@ const GameCard: FC = ({ game, onEdit, onDelete, deleting }) => { variant={isCustom ? "secondary" : "outline"} className="bg-background/80 backdrop-blur" > - {isCustom ? m.library_store_custom() : m.library_store_steam()} + {storeLabel(game.store)} {isCustom && (