riasvdv / statamic-address-field

A full-featured address field for Statamic
4 stars 4 forks source link

Can't get translated country names with 'display' tag #8

Closed PieterjanNeskens closed 2 months ago

PieterjanNeskens commented 2 months ago

Can't seem to get the country in other language like the docs specify.

The display tag outputs 'Belgium' when I expect 'België'

Antlers:

{{ address:countries }}
    {{ if alpha2 == locations.0.address.country }}
        {{ display }} 
    {{ /if }}
{{ /address:countries }}

.env: APP_LOCALE=nl

PieterjanNeskens commented 2 months ago

Never mind, I found the solution because I was working with dates in Statamic.

Needed to set the locale in de Statamic sites config. From Statamic 5 onwards, needed to create a sites.yaml file in resources folder.

default: 
  name: site name
  url: '{{ config:app:url }}'
  locale: nl_BE