@sarimarcus/content-sites-ui 0.54.0 → 0.54.2

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.
Files changed (56) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/package.json +2 -2
  3. package/src/affiliate/AffiliateCard.astro +10 -8
  4. package/src/affiliate/AffiliateCardSection.astro +5 -2
  5. package/src/affiliate/AffiliateCarousel.astro +6 -2
  6. package/src/affiliate/AffiliateComparisonTable.astro +14 -11
  7. package/src/affiliate/AmazonProductCard.astro +3 -2
  8. package/src/affiliate/AmazonProductSection.astro +5 -3
  9. package/src/affiliate/HotelAffiliateCTA.astro +15 -12
  10. package/src/affiliate/InlineAffiliateCTA.astro +3 -2
  11. package/src/affiliate/StickyCTA.astro +7 -4
  12. package/src/affiliate/TravelpayoutsWidget.astro +3 -2
  13. package/src/affiliate/cardItem.ts +1 -1
  14. package/src/composed/CardCarousel.astro +8 -5
  15. package/src/composed/FAQ.astro +3 -2
  16. package/src/composed/Pagination.astro +9 -6
  17. package/src/composed/TableOfContents.astro +7 -4
  18. package/src/editorial/AlsoExplore.astro +3 -2
  19. package/src/editorial/ArticleCategoryNav.astro +6 -3
  20. package/src/editorial/ArticleFeatureCard.astro +5 -2
  21. package/src/editorial/ArticleTopicPager.astro +9 -6
  22. package/src/editorial/ChronologyTimeline.astro +12 -7
  23. package/src/editorial/DossierSection.astro +7 -4
  24. package/src/editorial/EraChip.astro +5 -2
  25. package/src/editorial/EraDossiers.astro +3 -2
  26. package/src/editorial/EraPeopleRow.astro +10 -6
  27. package/src/editorial/EraScenes.astro +9 -6
  28. package/src/editorial/EraTimelineNav.astro +3 -2
  29. package/src/editorial/EventEditionBadge.astro +6 -4
  30. package/src/editorial/EventEditionBanner.astro +8 -5
  31. package/src/editorial/EventPage.astro +1 -1
  32. package/src/editorial/NotFoundPage.astro +5 -2
  33. package/src/editorial/PeopleBand.astro +5 -3
  34. package/src/editorial/PeopleChips.astro +4 -3
  35. package/src/editorial/PeopleHub.astro +11 -5
  36. package/src/editorial/PeopleTimeline.astro +7 -4
  37. package/src/editorial/PersonCard.astro +3 -2
  38. package/src/editorial/PersonChip.astro +3 -2
  39. package/src/editorial/PersonPage.astro +22 -17
  40. package/src/editorial/VisitTiming.astro +6 -3
  41. package/src/editorial/chronology-page.ts +4 -2
  42. package/src/editorial/era-listing.ts +3 -2
  43. package/src/editorial/eventEdition.ts +3 -2
  44. package/src/editorial/person-page.ts +5 -3
  45. package/src/internal/labels.ts +194 -0
  46. package/src/layout/DocumentShell.astro +7 -2
  47. package/src/navigation/ArticlesNavMenu.astro +4 -3
  48. package/src/navigation/SiteFooter.astro +7 -4
  49. package/src/navigation/SiteHeader.astro +7 -4
  50. package/src/navigation/types.ts +2 -0
  51. package/src/seo/ArticleMetadata.astro +9 -7
  52. package/src/seo/AuthoritativeSources.astro +20 -12
  53. package/src/seo/Breadcrumb.astro +6 -3
  54. package/src/seo/schemaContext.ts +2 -1
  55. package/src/seo/sourceLabels.ts +1 -0
  56. package/src/seo/types.ts +1 -1
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.54.2 (2026-11-03)
6
+
7
+ - `internal/labels`, `editorial`, `affiliate`, `layout`, `navigation`, `seo`: add `LABELS_IT`, `LABELS_BY_LOCALE`, and `getLabels(locale)` with automatic `Astro.currentLocale` / `locale` resolution across UI components, `it`/`es`/`de` number formatting locales in `cardItem`, and guillemet quotes (`«…»`) + foreign `lang` tagging in `AuthoritativeSources` (SLA-3787).
8
+
9
+ ## 0.54.1 (2026-11-02)
10
+
11
+ - Lockstep release, no change.
12
+
5
13
  ## 0.54.0 (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-ui",
3
- "version": "0.54.0",
3
+ "version": "0.54.2",
4
4
  "description": "Universal Astro UI components, layout shell and design tokens shared by the content sites.",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -50,6 +50,6 @@
50
50
  "@lucide/astro": "^1.23.0",
51
51
  "astro": "^7.0.6",
52
52
  "tailwindcss": "^4.1.18",
53
- "@sarimarcus/content-sites-core": "0.54.0"
53
+ "@sarimarcus/content-sites-core": "0.54.2"
54
54
  }
55
55
  }
@@ -26,7 +26,7 @@ import Icon from '../primitives/Icon.astro';
26
26
  import type { AffiliateCardOptions } from './types';
27
27
  import { templateLine } from './templateText';
28
28
  import ResponsivePicture from '../primitives/ResponsivePicture.astro';
29
- import { LABELS } from '../internal/labels';
29
+ import { getLabels } from '../internal/labels';
30
30
 
31
31
  interface Props extends AffiliateCardOptions {
32
32
  href: string;
@@ -50,6 +50,8 @@ interface Props extends AffiliateCardOptions {
50
50
  class?: string;
51
51
  }
52
52
 
53
+ const defaultLabels = getLabels(Astro.props.locale ?? Astro.currentLocale).affiliateCard;
54
+
53
55
  const {
54
56
  href,
55
57
  provider,
@@ -64,12 +66,12 @@ const {
64
66
  description,
65
67
  price,
66
68
  currency,
67
- locale = 'en-GB',
69
+ locale = Astro.currentLocale && Astro.currentLocale !== 'en' ? Astro.currentLocale : 'en-GB',
68
70
  rating = 0,
69
71
  reviewCount = 0,
70
72
  duration,
71
73
  index = 0,
72
- pricePrefix = LABELS.affiliateCard.pricePrefix,
74
+ pricePrefix = defaultLabels.pricePrefix,
73
75
  legacyFractionDigits = false,
74
76
  bestSellerAt = 1000,
75
77
  skipTheLineBadge = true,
@@ -85,11 +87,11 @@ const {
85
87
  } = Astro.props;
86
88
 
87
89
  const {
88
- bestSeller = LABELS.affiliateCard.bestSeller,
89
- topRated = LABELS.affiliateCard.topRated,
90
- skipTheLine = LABELS.affiliateCard.skipTheLine,
91
- cta = LABELS.affiliateCard.cta,
92
- reviewCount: reviewCountLabel = LABELS.affiliateCard.reviewCount,
90
+ bestSeller = defaultLabels.bestSeller,
91
+ topRated = defaultLabels.topRated,
92
+ skipTheLine = defaultLabels.skipTheLine,
93
+ cta = defaultLabels.cta,
94
+ reviewCount: reviewCountLabel = defaultLabels.reviewCount,
93
95
  verified,
94
96
  booksUp,
95
97
  } = labels;
@@ -9,7 +9,7 @@ import AffiliateCard from './AffiliateCard.astro';
9
9
  import AffiliateBandShell from './AffiliateBandShell.astro';
10
10
  import { bandImageSizes } from './band';
11
11
  import type { AffiliateCardItem, AffiliateCardOptions } from './types';
12
- import { LABELS } from '../internal/labels';
12
+ import { getLabels } from '../internal/labels';
13
13
 
14
14
  interface Props {
15
15
  items: AffiliateCardItem[];
@@ -20,19 +20,21 @@ interface Props {
20
20
  cardOptions?: AffiliateCardOptions;
21
21
  sectionClass?: string;
22
22
  headingClass?: string;
23
+ locale?: string;
23
24
  id?: string;
24
25
  class?: string;
25
26
  }
26
27
 
27
28
  const {
28
29
  items,
29
- title = LABELS.affiliateCardSection.title,
30
+ title = getLabels(Astro.props.locale ?? Astro.currentLocale).affiliateCardSection.title,
30
31
  subtitle,
31
32
  placement,
32
33
  imageFetchpriority,
33
34
  cardOptions = {},
34
35
  sectionClass,
35
36
  headingClass,
37
+ locale,
36
38
  id,
37
39
  class: className,
38
40
  } = Astro.props;
@@ -46,6 +48,7 @@ const imageSizes = bandImageSizes(visible.length);
46
48
  visible.length > 0 && (
47
49
  <AffiliateBandShell title={title} subtitle={subtitle} count={visible.length} sectionClass={sectionClass} headingClass={headingClass} id={id} class={className}><slot name="disclosure" slot="disclosure" />{visible.map((item, index) => (
48
50
  <AffiliateCard
51
+ locale={locale}
49
52
  {...cardOptions}
50
53
  {...item}
51
54
  index={index}
@@ -11,7 +11,7 @@ import CardCarousel from '../composed/CardCarousel.astro';
11
11
  import AffiliateCard from './AffiliateCard.astro';
12
12
  import { selectActivities } from './select';
13
13
  import type { AffiliateCardItem, AffiliateCardOptions } from './types';
14
- import { LABELS } from '../internal/labels';
14
+ import { getLabels } from '../internal/labels';
15
15
 
16
16
  type Activity = { id?: string | number; title?: string; reviewCount?: number; [key: string]: unknown };
17
17
 
@@ -28,6 +28,7 @@ interface Props {
28
28
  placement?: string;
29
29
  imageSizes?: string;
30
30
  cardOptions?: AffiliateCardOptions;
31
+ locale?: string;
31
32
  class?: string;
32
33
  }
33
34
 
@@ -35,7 +36,7 @@ const {
35
36
  activities,
36
37
  ids,
37
38
  resolve = (activity) => activity as AffiliateCardItem,
38
- heading = LABELS.affiliateCarousel.heading,
39
+ heading = getLabels(Astro.props.locale ?? Astro.currentLocale).affiliateCarousel.heading,
39
40
  subtitle,
40
41
  headingTag = 'h3',
41
42
  headingClass = 'font-display text-lg font-semibold text-foreground',
@@ -44,6 +45,7 @@ const {
44
45
  placement = 'carousel',
45
46
  imageSizes,
46
47
  cardOptions = {},
48
+ locale,
47
49
  class: className,
48
50
  } = Astro.props;
49
51
 
@@ -70,11 +72,13 @@ const visible = shown.map((a) => {
70
72
  description={subtitle}
71
73
  id={id}
72
74
  ariaLabel={heading}
75
+ locale={locale}
73
76
  >
74
77
  <slot name="disclosure" slot="header-note" />
75
78
  {visible.map((item, index) => (
76
79
  <div class="snap-start shrink-0 w-[78vw] sm:w-72">
77
80
  <AffiliateCard
81
+ locale={locale}
78
82
  {...cardOptions}
79
83
  {...item}
80
84
  placement={placement}
@@ -9,7 +9,7 @@ import Icon from '../primitives/Icon.astro';
9
9
  import Badge from '../primitives/Badge.astro';
10
10
  import type { ComparisonRow, ComparisonTableLabels } from './types';
11
11
  import { providerFromHref } from './provider';
12
- import { LABELS } from '../internal/labels';
12
+ import { getLabels } from '../internal/labels';
13
13
 
14
14
  interface Props {
15
15
  rows: ComparisonRow[];
@@ -21,16 +21,19 @@ interface Props {
21
21
  placement?: string;
22
22
  provider?: string;
23
23
  labels?: ComparisonTableLabels;
24
+ locale?: string;
24
25
  class?: string;
25
26
  }
26
27
 
28
+ const defaultLabels = getLabels(Astro.props.locale ?? Astro.currentLocale).affiliateComparisonTable;
29
+
27
30
  const {
28
31
  rows = [],
29
32
  title,
30
33
  titleTag = 'p',
31
- nameLabel = LABELS.affiliateComparisonTable.nameLabel,
32
- priceLabel = LABELS.affiliateComparisonTable.priceLabel,
33
- featureLabel = LABELS.affiliateComparisonTable.featureLabel,
34
+ nameLabel = defaultLabels.nameLabel,
35
+ priceLabel = defaultLabels.priceLabel,
36
+ featureLabel = defaultLabels.featureLabel,
34
37
  placement = 'comparison-table',
35
38
  provider,
36
39
  labels = {},
@@ -38,13 +41,13 @@ const {
38
41
  } = Astro.props;
39
42
 
40
43
  const {
41
- caption = LABELS.affiliateComparisonTable.caption,
42
- ctaColumn = LABELS.affiliateComparisonTable.ctaColumn,
43
- externalCta = LABELS.affiliateComparisonTable.externalCta,
44
- internalCta = LABELS.affiliateComparisonTable.internalCta,
45
- externalAria = LABELS.affiliateComparisonTable.externalAria,
46
- internalAria = LABELS.affiliateComparisonTable.internalAria,
47
- rated = LABELS.affiliateComparisonTable.rated,
44
+ caption = defaultLabels.caption,
45
+ ctaColumn = defaultLabels.ctaColumn,
46
+ externalCta = defaultLabels.externalCta,
47
+ internalCta = defaultLabels.internalCta,
48
+ externalAria = defaultLabels.externalAria,
49
+ internalAria = defaultLabels.internalAria,
50
+ rated = defaultLabels.rated,
48
51
  } = labels;
49
52
 
50
53
  const captionText = title ?? caption;
@@ -8,7 +8,7 @@ import Badge from '../primitives/Badge.astro';
8
8
  import { CARD_LINK_CLASS, CARD_BODY_CLASS, CARD_CTA_CLASS, CARD_BADGE_CLASS } from './cardClasses';
9
9
  import Icon from '../primitives/Icon.astro';
10
10
  import { templateLine } from './templateText';
11
- import { LABELS } from '../internal/labels';
11
+ import { getLabels } from '../internal/labels';
12
12
 
13
13
  interface Props {
14
14
  href: string;
@@ -22,6 +22,7 @@ interface Props {
22
22
  badge?: string;
23
23
  placement?: string;
24
24
  ctaLabel?: string;
25
+ locale?: string;
25
26
  class?: string;
26
27
  }
27
28
 
@@ -36,7 +37,7 @@ const {
36
37
  category = 'book',
37
38
  badge,
38
39
  placement = 'card',
39
- ctaLabel = LABELS.amazonProductCard.ctaLabel,
40
+ ctaLabel = getLabels(Astro.props.locale ?? Astro.currentLocale).amazonProductCard.ctaLabel,
40
41
  class: className,
41
42
  } = Astro.props;
42
43
 
@@ -5,7 +5,7 @@
5
5
  */
6
6
  import AmazonProductCard from './AmazonProductCard.astro';
7
7
  import AffiliateBandShell from './AffiliateBandShell.astro';
8
- import { LABELS } from '../internal/labels';
8
+ import { getLabels } from '../internal/labels';
9
9
 
10
10
  interface Product {
11
11
  href: string;
@@ -26,17 +26,19 @@ interface Props {
26
26
  maxCards?: number;
27
27
  enabled?: boolean;
28
28
  ctaLabel?: string;
29
+ locale?: string;
29
30
  id?: string;
30
31
  class?: string;
31
32
  }
32
33
 
33
34
  const {
34
- title = LABELS.amazonProductSection.title,
35
+ title = getLabels(Astro.props.locale ?? Astro.currentLocale).amazonProductSection.title,
35
36
  subtitle,
36
37
  products,
37
38
  maxCards,
38
39
  enabled = true,
39
40
  ctaLabel,
41
+ locale,
40
42
  id,
41
43
  class: className,
42
44
  } = Astro.props;
@@ -49,7 +51,7 @@ const visibleProducts = enabled ? [...(products ?? [])].slice(0, cappedMax) : []
49
51
  {
50
52
  visibleProducts.length > 0 && (
51
53
  <AffiliateBandShell title={title} subtitle={subtitle} count={visibleProducts.length} id={id} class={className}><slot name="disclosure" slot="disclosure" />{visibleProducts.map((product) => (
52
- <AmazonProductCard {...product} ctaLabel={ctaLabel} />
54
+ <AmazonProductCard {...product} ctaLabel={ctaLabel} locale={locale} />
53
55
  ))}</AffiliateBandShell>
54
56
  )
55
57
  }
@@ -14,7 +14,7 @@ import { isBadgeLength } from '../primitives/badgeText';
14
14
  import type { HotelCtaLabels } from './types';
15
15
  import { templateLine } from './templateText';
16
16
  import { providerFromHref } from './provider';
17
- import { LABELS } from '../internal/labels';
17
+ import { getLabels } from '../internal/labels';
18
18
 
19
19
 
20
20
  interface Props {
@@ -36,10 +36,13 @@ interface Props {
36
36
  website?: string;
37
37
  officialSiteTrackId?: string;
38
38
  labels?: HotelCtaLabels;
39
+ locale?: string;
39
40
  panelClass?: string;
40
41
  class?: string;
41
42
  }
42
43
 
44
+ const defaultLabels = getLabels(Astro.props.locale ?? Astro.currentLocale).hotelAffiliateCTA;
45
+
43
46
  const {
44
47
  name,
45
48
  href,
@@ -64,17 +67,17 @@ const {
64
67
  } = Astro.props;
65
68
 
66
69
  const {
67
- headline = LABELS.hotelAffiliateCTA.headline,
68
- bookCta = LABELS.hotelAffiliateCTA.bookCta(entityNoun),
69
- searchCta = LABELS.hotelAffiliateCTA.searchCta,
70
- bookSubhead = LABELS.hotelAffiliateCTA.bookSubhead,
71
- searchSubhead = LABELS.hotelAffiliateCTA.searchSubhead(entityNoun),
72
- from = LABELS.hotelAffiliateCTA.from,
73
- perNight = LABELS.hotelAffiliateCTA.perNight,
74
- reviews = LABELS.hotelAffiliateCTA.reviews,
75
- ratingOn = LABELS.hotelAffiliateCTA.ratingOn,
76
- freeToSearch = LABELS.hotelAffiliateCTA.freeToSearch,
77
- officialSite = LABELS.hotelAffiliateCTA.officialSite(entityNoun),
70
+ headline = defaultLabels.headline,
71
+ bookCta = defaultLabels.bookCta(entityNoun),
72
+ searchCta = defaultLabels.searchCta,
73
+ bookSubhead = defaultLabels.bookSubhead,
74
+ searchSubhead = defaultLabels.searchSubhead(entityNoun),
75
+ from = defaultLabels.from,
76
+ perNight = defaultLabels.perNight,
77
+ reviews = defaultLabels.reviews,
78
+ ratingOn = defaultLabels.ratingOn,
79
+ freeToSearch = defaultLabels.freeToSearch,
80
+ officialSite = defaultLabels.officialSite(entityNoun),
78
81
  } = labels;
79
82
 
80
83
  const trackProvider = provider ?? providerFromHref(href);
@@ -6,7 +6,7 @@
6
6
  * so inline clicks land in the same analytics fields. Render an AffiliateDisclosure nearby.
7
7
  */
8
8
  import Icon from '../primitives/Icon.astro';
9
- import { LABELS } from '../internal/labels';
9
+ import { getLabels } from '../internal/labels';
10
10
 
11
11
  interface Props {
12
12
  href: string;
@@ -17,6 +17,7 @@ interface Props {
17
17
  trackPlacement: string;
18
18
  provider?: string;
19
19
  productId?: string;
20
+ locale?: string;
20
21
  class?: string;
21
22
  }
22
23
 
@@ -24,7 +25,7 @@ const {
24
25
  href,
25
26
  label,
26
27
  description,
27
- cta = LABELS.inlineAffiliateCTA.cta,
28
+ cta = getLabels(Astro.props.locale ?? Astro.currentLocale).inlineAffiliateCTA.cta,
28
29
  trackId,
29
30
  trackPlacement,
30
31
  provider,
@@ -15,7 +15,7 @@
15
15
  * no secondary action: both only reproduce a site's earlier markup byte for byte.
16
16
  */
17
17
  import Icon from '../primitives/Icon.astro';
18
- import { LABELS } from '../internal/labels';
18
+ import { getLabels } from '../internal/labels';
19
19
 
20
20
  interface Props {
21
21
  label?: string;
@@ -35,19 +35,22 @@ interface Props {
35
35
  shadowClass?: string;
36
36
  desktopHiddenFirst?: boolean;
37
37
  ctaWhitespace?: 'single' | 'double';
38
+ locale?: string;
38
39
  }
39
40
 
41
+ const defaultLabels = getLabels(Astro.props.locale ?? Astro.currentLocale).stickyCTA;
42
+
40
43
  const {
41
- label = LABELS.stickyCTA.label,
44
+ label = defaultLabels.label,
42
45
  anchorId = 'affiliate-tours',
43
46
  eyebrow,
44
- note = LABELS.stickyCTA.note,
47
+ note = defaultLabels.note,
45
48
  icon = 'ticket',
46
49
  secondary,
47
50
  showOnDesktop = false,
48
51
  hideWhenVisible,
49
52
  dismissKey = 'affiliate-bar-dismissed',
50
- dismissLabel = LABELS.stickyCTA.dismissLabel,
53
+ dismissLabel = defaultLabels.dismissLabel,
51
54
  track = true,
52
55
  trackId = 'affiliate-sticky-bar',
53
56
  inertWhenHidden = true,
@@ -14,7 +14,7 @@
14
14
  */
15
15
  import TravelpayoutsWidgetBody from './TravelpayoutsWidgetBody.astro';
16
16
  import type { WidgetKind as Kind } from './resources';
17
- import { LABELS } from '../internal/labels';
17
+ import { getLabels } from '../internal/labels';
18
18
 
19
19
  interface Props {
20
20
  kind: Kind;
@@ -31,6 +31,7 @@ interface Props {
31
31
  trackPlacement?: string;
32
32
  marker?: boolean;
33
33
  compactRegion?: boolean;
34
+ locale?: string;
34
35
  }
35
36
 
36
37
  const WRAPPER: Record<Kind, string> = {
@@ -39,7 +40,7 @@ const WRAPPER: Record<Kind, string> = {
39
40
  train: 'train-search-widget min-h-[280px]',
40
41
  car: 'car-rental-widget',
41
42
  };
42
- const LABEL: Record<Kind, string> = LABELS.travelpayoutsWidget;
43
+ const LABEL: Record<Kind, string> = getLabels(Astro.props.locale ?? Astro.currentLocale).travelpayoutsWidget;
43
44
 
44
45
  const {
45
46
  kind,
@@ -22,7 +22,7 @@ export interface GygActivity extends GygCardActivity {
22
22
  reviewCount: number;
23
23
  }
24
24
 
25
- const LOCALES: Record<string, string> = { en: 'en-GB', fr: 'fr-FR' };
25
+ const LOCALES: Record<string, string> = { en: 'en-GB', fr: 'fr-FR', it: 'it-IT', es: 'es-ES', de: 'de-DE' };
26
26
 
27
27
  /** The card's number/currency locale for an activity's language code; en-GB when unknown. */
28
28
  export const gygCardLocale = (language: string) => LOCALES[language] || 'en-GB';
@@ -15,7 +15,7 @@
15
15
  */
16
16
  import Icon from '../primitives/Icon.astro';
17
17
  import { deterministicId } from '@sarimarcus/content-sites-core/dom';
18
- import { LABELS } from '../internal/labels';
18
+ import { getLabels } from '../internal/labels';
19
19
 
20
20
  interface Props {
21
21
  /** Section heading rendered above the track. */
@@ -44,9 +44,12 @@ interface Props {
44
44
  staticFrom?: 'sm';
45
45
  /** Extra classes on the track, e.g. the static layout's grid. */
46
46
  trackClass?: string;
47
+ locale?: string;
47
48
  class?: string;
48
49
  }
49
50
 
51
+ const defaultLabels = getLabels(Astro.props.locale ?? Astro.currentLocale).cardCarousel;
52
+
50
53
  const {
51
54
  heading,
52
55
  headingTag = 'h2',
@@ -54,11 +57,11 @@ const {
54
57
  description,
55
58
  id,
56
59
  viewAllHref,
57
- viewAllLabel = LABELS.cardCarousel.viewAllLabel,
60
+ viewAllLabel = defaultLabels.viewAllLabel,
58
61
  ariaLabel,
59
- regionLabel = LABELS.cardCarousel.regionLabel,
60
- previousLabel = LABELS.cardCarousel.previousLabel,
61
- nextLabel = LABELS.cardCarousel.nextLabel,
62
+ regionLabel = defaultLabels.regionLabel,
63
+ previousLabel = defaultLabels.previousLabel,
64
+ nextLabel = defaultLabels.nextLabel,
62
65
  staticFrom,
63
66
  trackClass: extraTrackClass,
64
67
  class: className,
@@ -8,7 +8,7 @@
8
8
  */
9
9
  import Icon from '../primitives/Icon.astro';
10
10
  import type { TrustedHtml } from '../types/index.ts';
11
- import { LABELS } from '../internal/labels';
11
+ import { getLabels } from '../internal/labels';
12
12
 
13
13
  export interface FaqItem {
14
14
  questionHtml: TrustedHtml;
@@ -23,12 +23,13 @@ interface Props {
23
23
  /** Replaces the title's classes. */
24
24
  headingClass?: string;
25
25
  id?: string;
26
+ locale?: string;
26
27
  class?: string;
27
28
  }
28
29
 
29
30
  const {
30
31
  items,
31
- title = LABELS.faq.title,
32
+ title = getLabels(Astro.props.locale ?? Astro.currentLocale).faq.title,
32
33
  icon = true,
33
34
  headingClass = 'text-2xl sm:text-3xl font-normal mb-6 flex items-center gap-3 font-display',
34
35
  id,
@@ -5,7 +5,7 @@
5
5
  * all agree on URLs.
6
6
  */
7
7
  import Icon from '../primitives/Icon.astro';
8
- import { LABELS } from '../internal/labels';
8
+ import { getLabels } from '../internal/labels';
9
9
 
10
10
  interface Props {
11
11
  currentPage: number;
@@ -19,17 +19,20 @@ interface Props {
19
19
  pageLabel?: (page: number) => string;
20
20
  /** Accessible name of the current page. */
21
21
  currentPageLabel?: (page: number) => string;
22
+ locale?: string;
22
23
  }
23
24
 
25
+ const defaultLabels = getLabels(Astro.props.locale ?? Astro.currentLocale).pagination;
26
+
24
27
  const {
25
28
  currentPage,
26
29
  totalPages,
27
30
  href,
28
- ariaLabel = LABELS.pagination.ariaLabel,
29
- previousLabel = LABELS.pagination.previousLabel,
30
- nextLabel = LABELS.pagination.nextLabel,
31
- pageLabel = LABELS.pagination.pageLabel,
32
- currentPageLabel = LABELS.pagination.currentPageLabel,
31
+ ariaLabel = defaultLabels.ariaLabel,
32
+ previousLabel = defaultLabels.previousLabel,
33
+ nextLabel = defaultLabels.nextLabel,
34
+ pageLabel = defaultLabels.pageLabel,
35
+ currentPageLabel = defaultLabels.currentPageLabel,
33
36
  } = Astro.props;
34
37
 
35
38
  const prevPage = currentPage > 1 ? currentPage - 1 : null;
@@ -7,7 +7,7 @@
7
7
  // empty heading on every caller that omits one (SLA-2340); `mb-2` sits behind `title` so an eyebrow-only header does
8
8
  // not double the gap.
9
9
  import Chip from '../primitives/Chip.astro';
10
- import { LABELS } from '../internal/labels';
10
+ import { getLabels } from '../internal/labels';
11
11
  import type { TableOfContentsItem } from './tocItem.ts';
12
12
 
13
13
  interface Props {
@@ -21,6 +21,7 @@ interface Props {
21
21
  stickyLabel?: (name: string) => string;
22
22
  eyebrow?: string;
23
23
  description?: string;
24
+ locale?: string;
24
25
  class?: string;
25
26
  eyebrowClass?: string;
26
27
  variant?: 'card' | 'plain';
@@ -34,12 +35,14 @@ interface Props {
34
35
  hideMiniPastLastSection?: boolean;
35
36
  }
36
37
 
38
+ const defaultLabels = getLabels(Astro.props.locale ?? Astro.currentLocale).tableOfContents;
39
+
37
40
  const {
38
41
  title = '',
39
42
  items,
40
- ariaLabel = title || LABELS.tableOfContents.ariaLabel,
41
- jumpLabel = LABELS.tableOfContents.jumpLabel,
42
- stickyLabel = LABELS.tableOfContents.stickyLabel,
43
+ ariaLabel = title || defaultLabels.ariaLabel,
44
+ jumpLabel = defaultLabels.jumpLabel,
45
+ stickyLabel = defaultLabels.stickyLabel,
43
46
  eyebrow,
44
47
  description,
45
48
  class: className = '',
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  /** "Also explore": up to four sibling links under a hairline, at the foot of a hub or listing page. */
3
3
  import Icon from '../primitives/Icon.astro';
4
- import { LABELS } from '../internal/labels';
4
+ import { getLabels } from '../internal/labels';
5
5
 
6
6
  export interface AlsoExploreItem {
7
7
  href: string;
@@ -11,10 +11,11 @@ export interface AlsoExploreItem {
11
11
  interface Props {
12
12
  eyebrow?: string;
13
13
  items: AlsoExploreItem[];
14
+ locale?: string;
14
15
  class?: string;
15
16
  }
16
17
 
17
- const { eyebrow = LABELS.alsoExplore.eyebrow, items, class: className } = Astro.props;
18
+ const { eyebrow = getLabels(Astro.props.locale ?? Astro.currentLocale).alsoExplore.eyebrow, items, class: className } = Astro.props;
18
19
 
19
20
  if (import.meta.env.DEV && items.length > 4) {
20
21
  console.warn(`AlsoExplore: received ${items.length} items, capping at 4.`);
@@ -7,7 +7,7 @@ import { routePath, url, type SiteRoutes } from '@sarimarcus/content-sites-core/
7
7
  import Chip from '../primitives/Chip.astro';
8
8
  import Badge from '../primitives/Badge.astro';
9
9
  import type { ArticleCategoryLink, ArticleCategoryMeta } from './types';
10
- import { LABELS } from '../internal/labels';
10
+ import { getLabels } from '../internal/labels';
11
11
 
12
12
  interface Props {
13
13
  articles: readonly { data: { category?: string | null } }[];
@@ -17,15 +17,18 @@ interface Props {
17
17
  allLabel?: string;
18
18
  /** Overrides of the article routes (`articles`, `articleTopic`). */
19
19
  routes?: SiteRoutes;
20
+ locale?: string;
20
21
  class?: string;
21
22
  }
22
23
 
24
+ const defaultLabels = getLabels(Astro.props.locale ?? Astro.currentLocale).articleCategoryNav;
25
+
23
26
  const {
24
27
  articles,
25
28
  categories: categoryMeta,
26
29
  current,
27
- ariaLabel = LABELS.articleCategoryNav.ariaLabel,
28
- allLabel = LABELS.articleCategoryNav.allLabel,
30
+ ariaLabel = defaultLabels.ariaLabel,
31
+ allLabel = defaultLabels.allLabel,
29
32
  routes,
30
33
  class: className,
31
34
  } = Astro.props;
@@ -7,7 +7,7 @@ import type { ImageMetadata } from 'astro';
7
7
  import ArticleByline from './ArticleByline.astro';
8
8
  import Icon from '../primitives/Icon.astro';
9
9
  import ResponsivePicture from '../primitives/ResponsivePicture.astro';
10
- import { LABELS } from '../internal/labels';
10
+ import { getLabels } from '../internal/labels';
11
11
 
12
12
  interface Props {
13
13
  href: string;
@@ -30,10 +30,13 @@ interface Props {
30
30
  loading?: 'eager' | 'lazy';
31
31
  headingLevel?: 2 | 3;
32
32
  pagefindIgnore?: boolean;
33
+ locale?: string;
33
34
  class?: string;
34
35
  }
35
36
 
36
- const { href, title, description, author, label, image, imageAlt = '', dateTime, dateLabel, updated = false, readLabel = LABELS.articleFeatureCard.readLabel, updatedLabel = LABELS.articleFeatureCard.updatedLabel, readingLabel, loading = 'eager', headingLevel = 2, pagefindIgnore = false, class: className = 'mb-12' } = Astro.props;
37
+ const defaultLabels = getLabels(Astro.props.locale ?? Astro.currentLocale).articleFeatureCard;
38
+
39
+ const { href, title, description, author, label, image, imageAlt = '', dateTime, dateLabel, updated = false, readLabel = defaultLabels.readLabel, updatedLabel = defaultLabels.updatedLabel, readingLabel, loading = 'eager', headingLevel = 2, pagefindIgnore = false, class: className = 'mb-12' } = Astro.props;
37
40
  const Heading = `h${headingLevel}` as 'h2' | 'h3';
38
41
  ---
39
42