@sarimarcus/content-sites-tourism 0.54.1 → 0.55.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -2,6 +2,14 @@
2
2
 
3
3
  All packages in the platform release in lockstep; entries are per release version.
4
4
 
5
+ ## 0.55.0 (2026-11-04)
6
+
7
+ - Lockstep release, no change (SLA-3756).
8
+
9
+ ## 0.54.2 (2026-11-03)
10
+
11
+ - `internal/labels`, `cards`, `sections`, `templates`, `schema`: add `LABELS_IT`, `LABELS_BY_LOCALE`, and `getLabels(locale)` with automatic `Astro.currentLocale` / `locale` resolution across tourism cards, sections, neighborhood models, and homepage templates, plus dynamic `inLanguage` on dish/event schema builders (SLA-3787).
12
+
5
13
  ## 0.54.1 (2026-11-02)
6
14
 
7
15
  - Lockstep release, no change.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sarimarcus/content-sites-tourism",
3
- "version": "0.54.1",
3
+ "version": "0.55.0",
4
4
  "description": "City-tourism vertical: city-entity components, pages templates and utilities for the tourism sites.",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -38,7 +38,7 @@
38
38
  "peerDependencies": {
39
39
  "astro": "^7.0.6",
40
40
  "tailwindcss": "^4.1.18",
41
- "@sarimarcus/content-sites-core": "0.54.1",
42
- "@sarimarcus/content-sites-ui": "0.54.1"
41
+ "@sarimarcus/content-sites-core": "0.55.0",
42
+ "@sarimarcus/content-sites-ui": "0.55.0"
43
43
  }
44
44
  }
@@ -7,7 +7,7 @@
7
7
  import type { ImageMetadata } from 'astro';
8
8
  import { ArrowLabel, Badge, Icon } from '@sarimarcus/content-sites-ui/primitives';
9
9
  import { EntityCard } from '@sarimarcus/content-sites-ui/composed';
10
- import { LABELS } from '../internal/labels';
10
+ import { getLabels } from '../internal/labels';
11
11
 
12
12
  interface Props {
13
13
  href: string;
@@ -35,8 +35,11 @@ interface Props {
35
35
  /** Event `type` → its name; an unknown type shows `fallbackTypeLabel`. */
36
36
  typeLabels?: Record<string, string>;
37
37
  fallbackTypeLabel?: string;
38
+ locale?: string;
38
39
  }
39
40
 
41
+ const defaultLabels = getLabels(Astro.props.locale ?? Astro.currentLocale).eventCard;
42
+
40
43
  const {
41
44
  href,
42
45
  name,
@@ -55,11 +58,11 @@ const {
55
58
  class: className,
56
59
  priority = false,
57
60
  eager = 1,
58
- unescoLabel = LABELS.eventCard.unescoLabel,
59
- freeLabel = LABELS.eventCard.freeLabel,
60
- ctaLabel = LABELS.eventCard.ctaLabel,
61
- typeLabels = LABELS.eventCard.typeLabels,
62
- fallbackTypeLabel = LABELS.eventCard.fallbackTypeLabel,
61
+ unescoLabel = defaultLabels.unescoLabel,
62
+ freeLabel = defaultLabels.freeLabel,
63
+ ctaLabel = defaultLabels.ctaLabel,
64
+ typeLabels = defaultLabels.typeLabels,
65
+ fallbackTypeLabel = defaultLabels.fallbackTypeLabel,
63
66
  } = Astro.props;
64
67
 
65
68
  const isUNESCO = tags.includes('unesco');
@@ -54,3 +54,69 @@ export const LABELS = {
54
54
  neighborhoodBadges: { 'editors-pick': 'Editor’s pick', 'hidden-gem': 'Hidden gem', 'family-friendly': 'Family-friendly', 'tourist-centre': 'Tourist centre', nightlife: 'Nightlife' } as Record<string, string>,
55
55
  neighborhoodFacets: { monuments: 'Monuments', hotels: 'Hotels', restaurants: 'Restaurants', bars: 'Bars', activities: 'Activities' } as Record<string, string>,
56
56
  };
57
+
58
+ export const LABELS_IT: typeof LABELS = {
59
+ articleCardGrid: { readLabel: 'Leggi', updatedLabel: 'Aggiornato' },
60
+ tourismHomePage: {
61
+ marks: { trip: 'Vale il viaggio', detour: 'Vale una deviazione', season: 'Di stagione' },
62
+ separator: ' · ',
63
+ },
64
+ homeTripPlanner: { eyebrow: 'Organizza il viaggio', heading: 'Che taglio avrà la tua visita?' },
65
+ itineraryTeaser: { badgeLabel: 'Itinerario consigliato' },
66
+ rankedListingRow: { ctaLabel: 'Scopri di più', ratingSuffix: 'su 5' },
67
+ walkStops: {
68
+ heading: 'Percorso tappa per tappa',
69
+ tipLabel: 'Consiglio:',
70
+ typeLabels: {
71
+ monument: 'Monumento',
72
+ museum: 'Museo',
73
+ restaurant: 'Ristorante',
74
+ bar: 'Bar',
75
+ neighborhood: 'Quartiere',
76
+ activity: 'Attività',
77
+ dish: 'Piatto',
78
+ event: 'Evento',
79
+ landmark: 'Punto di interesse',
80
+ } as Record<string, string>,
81
+ },
82
+ relatedBlock: { title: 'Correlati' },
83
+ whoItsFor: { label: 'Per chi è ideale', ariaLabel: 'Pubblico e temi correlati' },
84
+ eventCard: {
85
+ unescoLabel: 'UNESCO',
86
+ freeLabel: 'Gratuito',
87
+ ctaLabel: 'Scopri',
88
+ typeLabels: { festival: 'Festival', feria: 'Fiera', gastronomie: 'Gastronomia', religieux: 'Tradizione' } as Record<string, string>,
89
+ fallbackTypeLabel: 'Evento',
90
+ },
91
+ monumentBodySlot: { didYouKnow: 'Lo sapevi?', timeline: 'Cronologia' },
92
+ neighborhoodModel: {
93
+ see: 'Vedere', stay: 'Dormire', eat: 'Mangiare', drink: 'Bere', do: 'Fare', walk: 'Passeggiare', eventsIn: 'Eventi a {name}',
94
+ baseHeading: '{name} fa al caso tuo come base?', openMap: 'Apri la mappa', noHotels: 'Nessun hotel ancora in elenco',
95
+ allIn: 'Tutti i {count} {noun} a {name}', kmFrom: '{km} km da {anchor}', beside: 'Accanto a {anchor}',
96
+ insiderTips: 'Consigli locali', otherHoods: 'Altri quartieri', allHoods: 'Tutti i quartieri', googleMaps: 'Apri in Google Maps',
97
+ detailMapAria: 'Mappa indicativa dei quartieri di {city}, non in scala, con {name} evidenziato e {anchor} segnato.',
98
+ detailMapCaption: 'Dove si trova {name}. Non in scala.', detailLiveMapCaption: 'Dove si trova {name}.',
99
+ hubHeading: 'Dove dormire a {city}, quartiere per quartiere',
100
+ hubStandfirst: '{count} zone messe a confronto come base: a chi si adatta ciascuna, cosa offre sotto casa e quanto dista da {anchor}.',
101
+ allAreas: 'Tutte le zone', filterAria: 'Filtra i quartieri in base a chi si adattano', status: '{shown} di {total} quartieri visualizzati',
102
+ hubMapAria: 'Mappa indicativa dei {count} quartieri di {city}, numerati come nell’elenco, con {anchor} segnato. Non in scala.',
103
+ hubMapSummary: 'Mappa delle {count} zone', hubMapNote: 'I numeri corrispondono all’elenco. Non in scala: l’elenco riporta le distanze reali in linea d’aria da {anchor}.', hubLiveMapNote: 'I numeri corrispondono all’elenco.',
104
+ explore: 'Esplora {name}', seeHotels: 'Vedi i {count} hotel', siblingsLabel: 'Altri quartieri:',
105
+ hotel: ['hotel', 'hotel'] as const, restaurant: ['ristorante', 'ristoranti'] as const, monument: ['monumento', 'monumenti'] as const,
106
+ museum: ['museo', 'musei'] as const, bar: ['bar', 'bar'] as const, activity: ['attività', 'attività'] as const, sight: ['luogo', 'luoghi'] as const,
107
+ },
108
+ neighborhoodAreaTypes: { historic: 'Centro storico', authentic: 'Quartiere autentico', modern: 'Quartiere moderno' } as Record<string, string>,
109
+ neighborhoodBadges: { 'editors-pick': 'Scelta della redazione', 'hidden-gem': 'Gemma nascosta', 'family-friendly': 'Per famiglie', 'tourist-centre': 'Cuore turistico', nightlife: 'Vita notturna' } as Record<string, string>,
110
+ neighborhoodFacets: { monuments: 'Monumenti', hotels: 'Hotel', restaurants: 'Ristoranti', bars: 'Bar', activities: 'Attività' } as Record<string, string>,
111
+ };
112
+
113
+ export const LABELS_BY_LOCALE = {
114
+ en: LABELS,
115
+ it: LABELS_IT,
116
+ } as const;
117
+
118
+ export function getLabels(locale?: string): typeof LABELS {
119
+ if (!locale) return LABELS;
120
+ const lang = locale.split(/[-_]/)[0]?.toLowerCase() ?? 'en';
121
+ return (LABELS_BY_LOCALE as Record<string, typeof LABELS>)[lang] ?? LABELS;
122
+ }
@@ -71,7 +71,7 @@ function barBuilder(city: TourismCity): SchemaBuilder {
71
71
  }
72
72
 
73
73
  /** A dish page as an Article at route `dish`, dated by `dateModified` (now when absent). */
74
- function dishBuilder(): SchemaBuilder {
74
+ function dishBuilder(city?: TourismCity): SchemaBuilder {
75
75
  return (data, ctx) => {
76
76
  const author = ctx.resolveAuthor(data.author);
77
77
  const node: JsonLdNode = {
@@ -86,7 +86,7 @@ function dishBuilder(): SchemaBuilder {
86
86
  dateModified: ctx.formatDate(data.dateModified, true),
87
87
  keywords: data.tags?.join(', ') || '',
88
88
  articleSection: 'Gastronomy',
89
- inLanguage: 'en',
89
+ inLanguage: city?.inLanguage ?? ctx.inLanguage ?? 'en',
90
90
  url: ctx.route('dish', data.slug),
91
91
  };
92
92
  return author ? [createPersonSchema(author), node] : node;
@@ -144,7 +144,7 @@ export function tourismCityBuilders(city: TourismCity): SchemaBuilders {
144
144
  museum: museumBuilder(city),
145
145
  restaurant: restaurantBuilder(city),
146
146
  bar: barBuilder(city),
147
- dish: dishBuilder(),
147
+ dish: dishBuilder(city),
148
148
  neighborhood: neighborhoodBuilder(city),
149
149
  hotel: hotelBuilder({ address: cityAddressPolicy(city) }),
150
150
  touristTrip: touristTripBuilder(),
@@ -12,6 +12,8 @@ export interface TourismCity {
12
12
  /** Postal code for an item with none of its own. Leave unset rather than invent one. */
13
13
  postalFallback?: string;
14
14
  geo: { lat: number; lng: number };
15
+ /** BCP-47 language tag for JSON-LD `inLanguage` (defaults to `ctx.inLanguage` or `'en'`). */
16
+ inLanguage?: string;
15
17
  }
16
18
 
17
19
  /** Fixed locality/region/country from the city; an empty street is kept as `""`. */
@@ -64,6 +66,7 @@ export function cityEventPolicy(city: TourismCity, options: CityEventOptions): E
64
66
  address: cityAddressPolicy(city),
65
67
  defaultLocationName: city.locality,
66
68
  ...(options.geo && { geo: true }),
69
+ ...(city.inLanguage && { inLanguage: city.inLanguage }),
67
70
  performer: (d) => options.performer(d, council()),
68
71
  organizer: (d) => (d.organizer ? organization(d.organizer.name, d.organizer.url) : council()),
69
72
  itemOrganizer: council,
@@ -8,7 +8,7 @@ import { ArticleGrid } from '@sarimarcus/content-sites-ui/editorial';
8
8
  import { isUpdatedAfterPublication } from '@sarimarcus/content-sites-core/articles';
9
9
  import { formatDisplayDay } from '@sarimarcus/content-sites-core/dates';
10
10
  import { routePath, url, type SiteRoutes } from '@sarimarcus/content-sites-core/url';
11
- import { LABELS } from '../internal/labels';
11
+ import { getLabels } from '../internal/labels';
12
12
 
13
13
  export interface ArticleCardGridEntry {
14
14
  data: {
@@ -27,6 +27,8 @@ interface Props {
27
27
  articleImages: Record<string, ImageMetadata>;
28
28
  /** IANA zone the card dates are shown in. */
29
29
  timeZone?: string;
30
+ /** BCP-47 locale for card dates and default labels (defaults to `en-GB`). */
31
+ locale?: string;
30
32
  readLabel?: string;
31
33
  updatedLabel?: string;
32
34
  /** Overrides of the `articles` route. */
@@ -35,7 +37,7 @@ interface Props {
35
37
  class?: string;
36
38
  }
37
39
 
38
- const { articles, articleImages, timeZone = 'Europe/Madrid', readLabel = LABELS.articleCardGrid.readLabel, updatedLabel = LABELS.articleCardGrid.updatedLabel, routes, class: className = 'grid gap-6 sm:grid-cols-2 lg:grid-cols-3' } = Astro.props;
40
+ const { articles, articleImages, timeZone = 'Europe/Madrid', locale = Astro.currentLocale && Astro.currentLocale !== 'en' ? Astro.currentLocale : 'en-GB', readLabel = getLabels(locale).articleCardGrid.readLabel, updatedLabel = getLabels(locale).articleCardGrid.updatedLabel, routes, class: className = 'grid gap-6 sm:grid-cols-2 lg:grid-cols-3' } = Astro.props;
39
41
 
40
42
  const items = articles.map(({ data: a }) => {
41
43
  const updated = isUpdatedAfterPublication(a);
@@ -48,7 +50,7 @@ const items = articles.map(({ data: a }) => {
48
50
  image: articleImages[a.slug],
49
51
  imageAlt: a.imageAlt,
50
52
  dateTime,
51
- dateLabel: formatDisplayDay(dateTime, 'en-GB', timeZone),
53
+ dateLabel: formatDisplayDay(dateTime, locale, timeZone),
52
54
  updated,
53
55
  };
54
56
  });
@@ -2,7 +2,7 @@
2
2
  /** HomeTripPlanner — the home page's "Build your trip" band: one card per plan page, the featured one outlined. */
3
3
  import { Container } from '@sarimarcus/content-sites-ui/layout';
4
4
  import { url } from '@sarimarcus/content-sites-core/url';
5
- import { LABELS } from '../internal/labels';
5
+ import { getLabels } from '../internal/labels';
6
6
 
7
7
  export interface HomeTripPlannerCard {
8
8
  title: string;
@@ -15,9 +15,11 @@ interface Props {
15
15
  cards: HomeTripPlannerCard[];
16
16
  eyebrow?: string;
17
17
  heading?: string;
18
+ locale?: string;
18
19
  }
19
20
 
20
- const { cards, eyebrow = LABELS.homeTripPlanner.eyebrow, heading = LABELS.homeTripPlanner.heading } = Astro.props;
21
+ const defaultLabels = getLabels(Astro.props.locale ?? Astro.currentLocale).homeTripPlanner;
22
+ const { cards, eyebrow = defaultLabels.eyebrow, heading = defaultLabels.heading } = Astro.props;
21
23
  ---
22
24
 
23
25
  <section class="bg-chalk-warm border-b border-border py-12 lg:py-16">
@@ -6,7 +6,7 @@
6
6
  */
7
7
  import { Badge, Icon } from '@sarimarcus/content-sites-ui/primitives';
8
8
  import { routePath, url, type SiteRoutes } from '@sarimarcus/content-sites-core/url';
9
- import { LABELS } from '../internal/labels';
9
+ import { getLabels } from '../internal/labels';
10
10
 
11
11
  export interface ItineraryTeaserStop {
12
12
  neighborhood: string;
@@ -22,6 +22,7 @@ interface Props {
22
22
  ctaText: string;
23
23
  ctaUrl: string;
24
24
  badgeLabel?: string;
25
+ locale?: string;
25
26
  /** Overrides of the `neighborhood` route. */
26
27
  routes?: SiteRoutes;
27
28
  class?: string;
@@ -33,7 +34,7 @@ const {
33
34
  stops,
34
35
  ctaText,
35
36
  ctaUrl,
36
- badgeLabel = LABELS.itineraryTeaser.badgeLabel,
37
+ badgeLabel = getLabels(Astro.props.locale ?? Astro.currentLocale).itineraryTeaser.badgeLabel,
37
38
  routes,
38
39
  class: className,
39
40
  } = Astro.props;
@@ -4,16 +4,17 @@
4
4
  * `label` names it for assistive tech; in the key the label sits beside the glyph, so the glyph is `decorative`.
5
5
  */
6
6
  import { Icon } from '@sarimarcus/content-sites-ui/primitives';
7
- import { LABELS } from '../internal/labels';
7
+ import { getLabels } from '../internal/labels';
8
8
  import type { MarkKind } from './marks';
9
9
 
10
10
  interface Props {
11
11
  kind: MarkKind;
12
12
  decorative?: boolean;
13
13
  label?: string;
14
+ locale?: string;
14
15
  }
15
16
 
16
- const { kind, decorative = false, label = LABELS.tourismHomePage.marks[kind] } = Astro.props;
17
+ const { kind, decorative = false, label = getLabels(Astro.props.locale ?? Astro.currentLocale).tourismHomePage.marks[kind] } = Astro.props;
17
18
  const glyphs = kind === 'trip' ? ['diamond', 'diamond'] : kind === 'detour' ? ['diamond'] : ['circle-dot'];
18
19
  ---
19
20
  <span class={`hp-mark hp-mark--${kind}`} aria-hidden={decorative ? 'true' : undefined} role={decorative ? undefined : 'img'} aria-label={decorative ? undefined : label}>{glyphs.map((name) => <Icon name={name} filled={name === 'diamond'} strokeWidth={2} class="" />)}</span>
@@ -4,7 +4,7 @@ import { Callout } from '@sarimarcus/content-sites-ui/primitives';
4
4
  import { ComparisonTable, DidYouKnow, Quote, StatFact, Timeline, VisitTiming } from '@sarimarcus/content-sites-ui/editorial';
5
5
  import { trustedHtml } from '@sarimarcus/content-sites-ui/types';
6
6
  import type { MonumentBodyLabels, MonumentBodySection, MonumentBodyTip, MonumentBodyVisitTiming } from './monumentBody.ts';
7
- import { LABELS } from '../internal/labels';
7
+ import { getLabels } from '../internal/labels';
8
8
 
9
9
  interface Props {
10
10
  index: number;
@@ -17,11 +17,13 @@ interface Props {
17
17
  renderInline: (markdown: string) => string;
18
18
  tagLinks?: (html: string, pathname: string) => string;
19
19
  labels?: MonumentBodyLabels;
20
+ locale?: string;
20
21
  }
21
22
 
22
- const { section, lede, visitTiming, interludes, tip, renderMarkdown, renderInline, tagLinks, labels } = Astro.props;
23
- const didYouKnowLabel = labels?.didYouKnow ?? LABELS.monumentBodySlot.didYouKnow;
24
- const timelineLabel = labels?.timeline ?? LABELS.monumentBodySlot.timeline;
23
+ const defaultLabels = getLabels(Astro.props.locale ?? Astro.currentLocale).monumentBodySlot;
24
+ const { section, lede, visitTiming, interludes, tip, renderMarkdown, renderInline, tagLinks, labels, locale } = Astro.props;
25
+ const didYouKnowLabel = labels?.didYouKnow ?? defaultLabels.didYouKnow;
26
+ const timelineLabel = labels?.timeline ?? defaultLabels.timeline;
25
27
  const pathname = Astro.url.pathname;
26
28
  const md = (s: string | undefined) => trustedHtml(typeof s === 'string' ? renderInline(s) : '');
27
29
  const tag = (html: string) => (tagLinks ? tagLinks(html, pathname) : html);
@@ -36,7 +38,7 @@ const tag = (html: string) => (tagLinks ? tagLinks(html, pathname) : html);
36
38
  {lede && <Fragment set:html={tag(lede)} />}
37
39
  {visitTiming && (
38
40
  <div class="not-prose">
39
- <VisitTiming visitTiming={visitTiming} class="mt-12 !mt-10 mb-10" />
41
+ <VisitTiming visitTiming={visitTiming} locale={locale} class="mt-12 !mt-10 mb-10" />
40
42
  </div>
41
43
  )}
42
44
  {interludes.map((il) => (
@@ -6,7 +6,7 @@
6
6
  */
7
7
  import type { ImageMetadata } from 'astro';
8
8
  import { Icon, ResponsivePicture } from '@sarimarcus/content-sites-ui/primitives';
9
- import { LABELS } from '../internal/labels';
9
+ import { getLabels } from '../internal/labels';
10
10
 
11
11
  interface Props {
12
12
  rank: number;
@@ -28,8 +28,11 @@ interface Props {
28
28
  specialties?: string[];
29
29
  description: string;
30
30
  ctaLabel?: string;
31
+ locale?: string;
31
32
  }
32
33
 
34
+ const defaultLabels = getLabels(Astro.props.locale ?? Astro.currentLocale).rankedListingRow;
35
+
33
36
  const {
34
37
  rank,
35
38
  href,
@@ -40,12 +43,12 @@ const {
40
43
  distanceText,
41
44
  walkLabel,
42
45
  rating,
43
- ratingSuffix = LABELS.rankedListingRow.ratingSuffix,
46
+ ratingSuffix = defaultLabels.ratingSuffix,
44
47
  meta,
45
48
  priceLine,
46
49
  specialties = [],
47
50
  description,
48
- ctaLabel = LABELS.rankedListingRow.ctaLabel,
51
+ ctaLabel = defaultLabels.ctaLabel,
49
52
  } = Astro.props;
50
53
 
51
54
  const paddedRank = String(rank).padStart(2, '0');
@@ -18,7 +18,7 @@
18
18
  import type { ImageMetadata } from 'astro';
19
19
  import { dedupRelated, url } from '@sarimarcus/content-sites-core/url';
20
20
  import type { RelatedBlockCard, RelatedBlockDeps } from './relatedBlock.ts';
21
- import { LABELS } from '../internal/labels';
21
+ import { getLabels } from '../internal/labels';
22
22
 
23
23
  interface Props {
24
24
  /** The content item's own data (needs `slug` and `relatedContent`). */
@@ -30,6 +30,7 @@ interface Props {
30
30
  selfType: string;
31
31
  deps: RelatedBlockDeps;
32
32
  title?: string;
33
+ locale?: string;
33
34
  layout?: 'grid' | 'carousel';
34
35
  columns?: 2 | 3;
35
36
  class?: string;
@@ -60,7 +61,7 @@ const {
60
61
  item,
61
62
  selfType,
62
63
  deps,
63
- title = LABELS.relatedBlock.title,
64
+ title = getLabels(Astro.props.locale ?? Astro.currentLocale).relatedBlock.title,
64
65
  layout = 'carousel',
65
66
  columns = 3,
66
67
  class: className = '',
@@ -5,7 +5,7 @@
5
5
  */
6
6
  import { Badge, Icon } from '@sarimarcus/content-sites-ui/primitives';
7
7
  import { url } from '@sarimarcus/content-sites-core/url';
8
- import { LABELS } from '../internal/labels';
8
+ import { getLabels } from '../internal/labels';
9
9
 
10
10
  export interface WalkStop {
11
11
  order: number;
@@ -25,14 +25,17 @@ interface Props {
25
25
  tipLabel?: string;
26
26
  /** Stop type → label; default English. */
27
27
  typeLabels?: Record<string, string>;
28
+ locale?: string;
28
29
  class?: string;
29
30
  }
30
31
 
32
+ const defaultLabels = getLabels(Astro.props.locale ?? Astro.currentLocale).walkStops;
33
+
31
34
  const {
32
35
  stops,
33
- heading = LABELS.walkStops.heading,
34
- tipLabel = LABELS.walkStops.tipLabel,
35
- typeLabels = LABELS.walkStops.typeLabels as Record<string, string>,
36
+ heading = defaultLabels.heading,
37
+ tipLabel = defaultLabels.tipLabel,
38
+ typeLabels = defaultLabels.typeLabels as Record<string, string>,
36
39
  class: className,
37
40
  } = Astro.props;
38
41
 
@@ -6,7 +6,7 @@
6
6
  */
7
7
  import { LinkArrow } from '@sarimarcus/content-sites-ui/primitives';
8
8
  import { url } from '@sarimarcus/content-sites-core/url';
9
- import { LABELS } from '../internal/labels';
9
+ import { getLabels } from '../internal/labels';
10
10
 
11
11
  export interface WhoItsForTag {
12
12
  field: 'audiences' | 'themes';
@@ -19,10 +19,12 @@ interface Props {
19
19
  tags: readonly WhoItsForTag[];
20
20
  label?: string;
21
21
  ariaLabel?: string;
22
+ locale?: string;
22
23
  class?: string;
23
24
  }
24
25
 
25
- const { tags, label = LABELS.whoItsFor.label, ariaLabel = LABELS.whoItsFor.ariaLabel, class: className = '' } = Astro.props;
26
+ const defaultLabels = getLabels(Astro.props.locale ?? Astro.currentLocale).whoItsFor;
27
+ const { tags, label = defaultLabels.label, ariaLabel = defaultLabels.ariaLabel, class: className = '' } = Astro.props;
26
28
 
27
29
  const links = tags.map((tag) => ({
28
30
  label: tag.label,
@@ -13,17 +13,19 @@ import { CardCarousel } from '@sarimarcus/content-sites-ui/composed';
13
13
  import { Container } from '@sarimarcus/content-sites-ui/layout';
14
14
  import { Image } from 'astro:assets';
15
15
  import Mark from '../sections/Mark.astro';
16
- import { LABELS } from '../internal/labels';
16
+ import { getLabels } from '../internal/labels';
17
17
  import type { MarkKind } from '../sections/marks.ts';
18
18
  import type { TourismHomeModel } from './tourismHomeModel.ts';
19
19
 
20
20
  interface Props {
21
21
  model: TourismHomeModel;
22
+ locale?: string;
22
23
  }
23
24
 
24
- const { model: m } = Astro.props;
25
- const marks = m.marks ?? LABELS.tourismHomePage.marks;
26
- const sep = m.separator ?? LABELS.tourismHomePage.separator;
25
+ const { model: m, locale } = Astro.props;
26
+ const defaultLabels = getLabels(locale ?? Astro.currentLocale).tourismHomePage;
27
+ const marks = m.marks ?? defaultLabels.marks;
28
+ const sep = m.separator ?? defaultLabels.separator;
27
29
  const markKinds = Object.keys(marks) as MarkKind[];
28
30
  const { lead, essentials, itineraries, plan, events, articles, monuments, history, outings, food, stay, faq } = m;
29
31
  ---
@@ -62,14 +64,14 @@ const { lead, essentials, itineraries, plan, events, articles, monuments, histor
62
64
  <div class="hp-ess__head">
63
65
  <h2 id="hp-ess-h">{essentials.heading}</h2>
64
66
  <ul role="list" class="hp-key" aria-label={essentials.keyAriaLabel}>
65
- {markKinds.map((kind) => <li><Mark kind={kind} decorative />{marks[kind]}</li>)}
67
+ {markKinds.map((kind) => <li><Mark kind={kind} decorative locale={locale} />{marks[kind]}</li>)}
66
68
  </ul>
67
69
  </div>
68
70
  <ol role="list" class="hp-rank">
69
71
  {essentials.items.map((e, i) => (
70
72
  <li>
71
73
  <span class="hp-rank__n" aria-hidden="true">{i + 1}</span>
72
- <Mark kind={e.mark} label={marks[e.mark]} />
74
+ <Mark kind={e.mark} label={marks[e.mark]} locale={locale} />
73
75
  <span class="hp-rank__thumb">{e.image && <ResponsiveImage src={e.image} alt="" sizes="(min-width: 52rem) 96px, 72px" loading="lazy" />}</span>
74
76
  <div class="hp-rank__body">
75
77
  <h3><a href={e.href}>{e.title}</a></h3>
@@ -97,7 +99,7 @@ const { lead, essentials, itineraries, plan, events, articles, monuments, histor
97
99
  <h2 id="hp-itin-h">{itineraries.heading}</h2>
98
100
  {itineraries.intro && <p>{itineraries.intro}</p>}
99
101
  </div>
100
- <CardCarousel staticFrom="sm" ariaLabel={itineraries.carouselAriaLabel} trackClass="hp-itins hp-swipe">
102
+ <CardCarousel staticFrom="sm" ariaLabel={itineraries.carouselAriaLabel} trackClass="hp-itins hp-swipe" locale={locale}>
101
103
  {itineraries.items.map((it) => (
102
104
  <div class="hp-itin">
103
105
  <div class="hp-img">{it.image && <ResponsiveImage src={it.image} alt="" sizes="(min-width: 40rem) 33vw, 82vw" loading="lazy" />}</div>
@@ -123,7 +125,7 @@ const { lead, essentials, itineraries, plan, events, articles, monuments, histor
123
125
  <h3>{plan.when.heading}</h3>
124
126
  <ol role="list" class="hp-months" aria-label={plan.when.monthsAriaLabel}>
125
127
  {plan.when.months.map((mo) => (
126
- <li class:list={[{ 'is-peak': mo.peak }]}><a class="hp-quiet" href={mo.href} aria-label={mo.ariaLabel}>{mo.label}{mo.mark && <Mark kind={mo.mark} label={marks[mo.mark]} decorative />}</a></li>
128
+ <li class:list={[{ 'is-peak': mo.peak }]}><a class="hp-quiet" href={mo.href} aria-label={mo.ariaLabel}>{mo.label}{mo.mark && <Mark kind={mo.mark} label={marks[mo.mark]} decorative locale={locale} />}</a></li>
127
129
  ))}
128
130
  </ol>
129
131
  <p set:html={plan.when.note} />
@@ -142,7 +144,7 @@ const { lead, essentials, itineraries, plan, events, articles, monuments, histor
142
144
  <aside class="hp-tours" aria-labelledby="hp-tours-h" data-track-zone="activities">
143
145
  <h3 id="hp-tours-h">{plan.tours.heading}</h3>
144
146
  <p class="hp-tours__note">{plan.tours.note}</p>
145
- <CardCarousel staticFrom="sm" ariaLabel={plan.tours.carouselAriaLabel} trackClass="hp-swipe">
147
+ <CardCarousel staticFrom="sm" ariaLabel={plan.tours.carouselAriaLabel} trackClass="hp-swipe" locale={locale}>
146
148
  {plan.tours.items.map((t) => (
147
149
  <div>
148
150
  <div class="hp-img hp-m-only">{t.image && <ResponsiveImage src={t.image} alt="" sizes="82vw" loading="lazy" />}</div>
@@ -176,7 +178,7 @@ const { lead, essentials, itineraries, plan, events, articles, monuments, histor
176
178
  <th scope="row">
177
179
  <div class="hp-cal__ev">
178
180
  <span class="hp-cal__thumb">{r.image && <ResponsiveImage src={r.image} alt="" sizes="64px" loading="lazy" />}</span>
179
- <span class="hp-cal__name"><a href={r.href}>{r.name}</a>{r.seasonal && <Mark kind="season" label={marks.season} />}</span>
181
+ <span class="hp-cal__name"><a href={r.href}>{r.name}</a>{r.seasonal && <Mark kind="season" label={marks.season} locale={locale} />}</span>
180
182
  </div>
181
183
  </th>
182
184
  <td class="hp-where">{r.place}</td>
@@ -209,7 +211,7 @@ const { lead, essentials, itineraries, plan, events, articles, monuments, histor
209
211
  {sep}<time datetime={articles.lead.datetime}>{articles.lead.dateLabel}</time>
210
212
  </p>
211
213
  </article>
212
- <CardCarousel staticFrom="sm" ariaLabel={articles.moreAriaLabel} trackClass="hp-feed__list hp-swipe">
214
+ <CardCarousel staticFrom="sm" ariaLabel={articles.moreAriaLabel} trackClass="hp-feed__list hp-swipe" locale={locale}>
213
215
  {articles.more.map((a) => (
214
216
  <div>
215
217
  <div>
@@ -251,7 +253,7 @@ const { lead, essentials, itineraries, plan, events, articles, monuments, histor
251
253
  <h2 id="hp-mon-h">{monuments.heading}</h2>
252
254
  {monuments.intro && <p>{monuments.intro}</p>}
253
255
  </div>
254
- <CardCarousel staticFrom="sm" ariaLabel={monuments.carouselAriaLabel} trackClass="hp-mons hp-swipe">
256
+ <CardCarousel staticFrom="sm" ariaLabel={monuments.carouselAriaLabel} trackClass="hp-mons hp-swipe" locale={locale}>
255
257
  {monuments.items.map((mo) => (
256
258
  <div>
257
259
  <div class="hp-thumb">{mo.image && <ResponsiveImage src={mo.image} alt="" sizes="(min-width: 40rem) 120px, 82vw" loading="lazy" />}</div>
@@ -273,7 +275,7 @@ const { lead, essentials, itineraries, plan, events, articles, monuments, histor
273
275
  <h2 id="hp-hist-h">{history.heading}</h2>
274
276
  {history.intro && <p>{history.intro}</p>}
275
277
  </div>
276
- <CardCarousel ariaLabel={history.carouselAriaLabel} trackClass="hp-eras">
278
+ <CardCarousel ariaLabel={history.carouselAriaLabel} trackClass="hp-eras" locale={locale}>
277
279
  {history.eras.map((era) => (
278
280
  <div class="hp-era">
279
281
  <p class="hp-era__range">{era.rangeLabel}</p>
@@ -312,7 +314,7 @@ const { lead, essentials, itineraries, plan, events, articles, monuments, histor
312
314
  <div class="hp-out">
313
315
  <div data-track-zone="walks">
314
316
  <h3 class="hp-sub">{outings.walks.heading}</h3>
315
- <CardCarousel staticFrom="sm" ariaLabel={outings.walks.carouselAriaLabel} trackClass="hp-walks hp-swipe">
317
+ <CardCarousel staticFrom="sm" ariaLabel={outings.walks.carouselAriaLabel} trackClass="hp-walks hp-swipe" locale={locale}>
316
318
  {outings.walks.items.map((w) => (
317
319
  <div>
318
320
  <div class="hp-img hp-m-only">{w.image && <ResponsiveImage src={w.image} alt="" sizes="82vw" loading="lazy" />}</div>
@@ -324,7 +326,7 @@ const { lead, essentials, itineraries, plan, events, articles, monuments, histor
324
326
  </div>
325
327
  <div data-track-zone="day-trips">
326
328
  <h3 class="hp-sub">{outings.trips.heading}</h3>
327
- <CardCarousel staticFrom="sm" ariaLabel={outings.trips.carouselAriaLabel} trackClass="hp-trips hp-swipe">
329
+ <CardCarousel staticFrom="sm" ariaLabel={outings.trips.carouselAriaLabel} trackClass="hp-trips hp-swipe" locale={locale}>
328
330
  {outings.trips.items.map((t) => (
329
331
  <div>
330
332
  <div class="hp-img hp-m-only">{t.image && <ResponsiveImage src={t.image} alt="" sizes="82vw" loading="lazy" />}</div>
@@ -350,7 +352,7 @@ const { lead, essentials, itineraries, plan, events, articles, monuments, histor
350
352
  <h2 id="hp-food-h">{food.heading}</h2>
351
353
  {food.intro && <p>{food.intro}</p>}
352
354
  </div>
353
- <CardCarousel staticFrom="sm" ariaLabel={food.carouselAriaLabel} trackClass="hp-dishes hp-swipe">
355
+ <CardCarousel staticFrom="sm" ariaLabel={food.carouselAriaLabel} trackClass="hp-dishes hp-swipe" locale={locale}>
354
356
  {food.dishes.map((d) => (
355
357
  <div>
356
358
  <div class="hp-img hp-m-only">{d.image && <ResponsiveImage src={d.image} alt="" sizes="82vw" loading="lazy" />}</div>
@@ -375,7 +377,7 @@ const { lead, essentials, itineraries, plan, events, articles, monuments, histor
375
377
  <h2 id="hp-stay-h">{stay.heading}</h2>
376
378
  {stay.intro && <p>{stay.intro}</p>}
377
379
  </div>
378
- <CardCarousel staticFrom="sm" ariaLabel={stay.carouselAriaLabel} trackClass="hp-quarters hp-swipe">
380
+ <CardCarousel staticFrom="sm" ariaLabel={stay.carouselAriaLabel} trackClass="hp-quarters hp-swipe" locale={locale}>
379
381
  {stay.quarters.map((q) => (
380
382
  <div>
381
383
  <div class="hp-img">{q.image && <ResponsiveImage src={q.image} alt="" sizes="(min-width: 52rem) 270px, (min-width: 40rem) 45vw, 82vw" loading="lazy" />}</div>
@@ -3,7 +3,7 @@
3
3
  import type { z as Zod } from 'astro/zod';
4
4
  import { haversineMetres } from '@sarimarcus/content-sites-core/geo';
5
5
  import type { FacetNavItem } from './facet.ts';
6
- import { LABELS } from '../internal/labels.ts';
6
+ import { getLabels, LABELS } from '../internal/labels.ts';
7
7
 
8
8
  /** `areaType`, not `category`: guide and listing code reads any item's `category` as a display label. */
9
9
  export const NEIGHBORHOOD_CATEGORIES = ['historic', 'authentic', 'modern'] as const;
@@ -59,11 +59,12 @@ export function neighborhoodFacetItems(
59
59
  counts: Partial<Record<FacetType, number>>,
60
60
  current: FacetType,
61
61
  href: (path: string) => string,
62
- labels: Record<string, string> = LABELS.neighborhoodFacets,
62
+ labels: Record<string, string> | string = LABELS.neighborhoodFacets,
63
63
  ): FacetNavItem[] {
64
+ const resolved = typeof labels === 'string' ? getLabels(labels).neighborhoodFacets : labels;
64
65
  return FACET_TYPES.filter((t) => (counts[t] ?? 0) >= FACET_MIN_ITEMS).map((t) => ({
65
66
  href: href(`/neighborhood/${slug}/${t}`),
66
- label: labels[t] ?? t,
67
+ label: resolved[t] ?? t,
67
68
  count: counts[t] ?? 0,
68
69
  active: t === current,
69
70
  }));
@@ -6,7 +6,7 @@ import type { ImageMetadata } from 'astro';
6
6
  import { parseMarkdownInline, stripMarkdown } from '@sarimarcus/content-sites-core/text';
7
7
  import { textAsHtml, trustedHtml } from '@sarimarcus/content-sites-ui/types';
8
8
  import type { TrustedHtml } from '@sarimarcus/content-sites-ui/types';
9
- import { LABELS } from '../internal/labels.ts';
9
+ import { getLabels, type LABELS } from '../internal/labels.ts';
10
10
  import { fill } from '../internal/fill.ts';
11
11
  import {
12
12
  FACET_MIN_ITEMS, PICKS_MAX, centroid, distanceKm, locatorPoints, shelfPlan,
@@ -130,11 +130,12 @@ export interface DetailModelInput {
130
130
  basePath?: string;
131
131
  /** Cap the sibling strip (Granada: 6, for its closer's tail-link budget). */
132
132
  siblingsCap?: number;
133
+ locale?: string;
133
134
  labels?: Partial<Labels>;
134
135
  }
135
136
 
136
137
  export function neighborhoodDetailModel(input: DetailModelInput) {
137
- const L: Labels = { ...LABELS.neighborhoodModel, ...input.labels };
138
+ const L: Labels = { ...getLabels(input.locale).neighborhoodModel, ...input.labels };
138
139
  const { hood, items, anchor, url } = input;
139
140
  const n = Object.fromEntries(Object.entries(items).map(([k, v]) => [k, v.length])) as Record<ItemType, number>;
140
141
  const intro = (t?: string) => (t ? trustedHtml(parseMarkdownInline(t, input.basePath)) : undefined);
@@ -235,6 +236,7 @@ export interface HubModelInput {
235
236
  /** Defaults: LABELS.neighborhoodAreaTypes / neighborhoodBadges. */
236
237
  areaLabels?: Record<string, string>;
237
238
  badgeLabels?: Record<string, string>;
239
+ locale?: string;
238
240
  labels?: Partial<Labels>;
239
241
  }
240
242
 
@@ -251,10 +253,11 @@ export function hubFilters(valueSets: readonly (readonly string[])[], max = 3):
251
253
  }
252
254
 
253
255
  export function neighborhoodHubModel(input: HubModelInput) {
254
- const L: Labels = { ...LABELS.neighborhoodModel, ...input.labels };
256
+ const defaultLabels = getLabels(input.locale);
257
+ const L: Labels = { ...defaultLabels.neighborhoodModel, ...input.labels };
255
258
  const { anchor } = input;
256
- const areaLabels = input.areaLabels ?? LABELS.neighborhoodAreaTypes;
257
- const badgeLabels = input.badgeLabels ?? LABELS.neighborhoodBadges;
259
+ const areaLabels = input.areaLabels ?? defaultLabels.neighborhoodAreaTypes;
260
+ const badgeLabels = input.badgeLabels ?? defaultLabels.neighborhoodBadges;
258
261
  const order = hubOrder(input.hoods, anchor);
259
262
  const rows = order.map((h, i) => {
260
263
  const values = [...(h.audiences ?? []), ...(h.themes ?? [])];