{{- /* responsible-gambling-block.html — locale-aware RG messaging. Call with (dict "page" . "variant" "compact"|"full"). Server renders the DEFAULT locale; the locale switcher updates the [data-age-value] / [data-rg-name] / [data-rg-link] elements client-side. */ -}} {{- $page := .page -}} {{- $variant := .variant | default "full" -}} {{- $brand := $page.Site.Data.brand -}} {{- $locales := $page.Site.Data.locales -}} {{- $currentLocale := $brand.defaultLocale -}} {{- range $brand.supportedLocales -}} {{- if or (eq . $page.Language.LanguageCode) (hasPrefix . (printf "%s-" $page.Language.Lang)) -}}{{- $currentLocale = . -}}{{- end -}} {{- end -}} {{- $default := "" -}} {{- with where $locales "locale" $currentLocale -}}{{- $default = index . 0 -}}{{- end -}} {{- $age := $brand.ageRestrictionDefault -}} {{- $orgName := "your national support service" -}} {{- $orgUrl := "#" -}} {{- $orgPhone := "" -}} {{- with $default -}} {{- $age = .ageRestriction -}} {{- $orgName = .responsibleGamblingOrgName -}} {{- $orgUrl = .responsibleGamblingUrl -}} {{- $orgPhone = .responsibleGamblingPhone | default "" -}} {{- end -}} {{- if eq $variant "compact" -}}
{{ printf (i18n "rgCompactIntro") $age }}
{{ i18n "rgNeedHelp" }} {{ $orgName }}.
{{- with $orgPhone }}Free helpline: {{ . }}.
{{ end -}} {{- else -}}{{ printf (i18n "rgFullIntro") $age }}
{{ i18n "rgRegionRecommends" }} {{ $orgName }}. {{ i18n "rgSupportIntro" }}
| {{ i18n "region" }} | {{ i18n "minimumAge" }} | {{ i18n "supportOrganisation" }} |
|---|---|---|
| {{ .label | default .locale }} | {{ .ageRestriction }}+ | {{ .responsibleGamblingOrgName }}{{ with .responsibleGamblingPhone }} {{ . }}{{ end }} |