Skip to content

Commit cff933d

Browse files
committed
feat: render Japanese short description on heritage detail
Branch on locale in the overview section to show shortDescriptionJp when ja locale is active, falling back to the English shortDescription otherwise. Plumb locale through HeritageDetailLayout and update fixtures accordingly.
1 parent 8c470e2 commit cff933d

4 files changed

Lines changed: 8 additions & 3 deletions

File tree

client/src/app/features/heritages/mappers/__tests__/to-world-heritage-vm.test.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ const base: ApiWorldHeritageDto = {
1919
area_hectares: 442,
2020
buffer_zone_hectares: 320,
2121
short_description: "desc",
22+
short_description_jp: "ダミー",
2223
unesco_site_url: "https://whc.unesco.org/en/list/663",
2324
state_party: "JPN",
2425
state_party_codes: ["JPN"],

client/src/app/features/top/components/heritage-detail/HeritageDetailLayout.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ export function HeritageDetailLayout({ item, locale, toggleLocale }: Props) {
145145
<div className="grid gap-6 lg:gap-8 lg:grid-cols-[minmax(0,1fr)_360px] lg:items-start">
146146
{/* Left: Overview → Gallery */}
147147
<div className="space-y-8" id="content">
148-
<HeritageOverViewSection item={item} />
148+
<HeritageOverViewSection item={item} locale={locale} />
149149
<HeritageGallery images={item.images} />
150150
</div>
151151

client/src/app/features/top/components/heritage-detail/HeritageOverviewSection.tsx

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,10 @@ import { textType } from "@shared/styles/typography.ts";
33

44
type Props = {
55
item: WorldHeritageDetailVm;
6+
locale: string;
67
};
78

8-
export function HeritageOverViewSection({ item }: Props) {
9+
export function HeritageOverViewSection({ item, locale }: Props) {
910
return (
1011
<section
1112
id="overview"
@@ -31,7 +32,9 @@ export function HeritageOverViewSection({ item }: Props) {
3132

3233
{item.shortDescription ? (
3334
<p className={`${textType.body} ${textType.measure} mt-4 whitespace-pre-wrap`}>
34-
{item.shortDescription}
35+
{locale === "ja" && item.shortDescriptionJp
36+
? item.shortDescriptionJp
37+
: item.shortDescription}
3538
</p>
3639
) : (
3740
<p className={`${textType.body} mt-4 text-zinc-400`}></p>

client/src/app/features/top/containers/__tests__/world-heritage-detail-container.test.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,7 @@ describe("WorldHeritageDetailContainer", () => {
145145
latitude: null,
146146
longitude: null,
147147
shortDescription: "dummy",
148+
shortDescriptionJp: "ダミー",
148149
unescoSiteUrl: "https://example.com",
149150
statePartyCodes: [],
150151
statePartiesMeta: {},

0 commit comments

Comments
 (0)