DateTimeFormat shows current locale locally, but not in deployment

Hello,

I am using Eleventy. And I am using a shortcode that displays the name of the month in Dutch. It works locally, but when I deploy to Netlify, the name of the month is in English (see f.e. www.babymatras.net). Below is the code I use in the eleventy config file. Not sure what the problem is.

  eleventyConfig.addShortcode("month", function () {
    const formatter = new Intl.DateTimeFormat('nl', { month: 'long' });
    return formatter.format(new Date());
   });

Can you help me out?

Is it just the simple case that the Netlify servers don’t support the dutch locale?

hi tulipa, sorry to be slow to get back to you, we were a little unsure about this one ourselves.

does this work for locales other than nl?

Hi Perry,

No, it doesn’t work for other locales: Luieremmer.net . I see the German and Spanish names at my localhost.

I have made a workaround where I put the names of the Dutch months in an array. But I’d rather use the code I posted here.

Kind regards,
Jelle

Tis possible that we are missing that locale:

If so a PR to add it might be what is needed - feel free to submit one if you think so!

Thanks for the reply. I see the german language-pack in the list, but it doesn’t appear to be working for the german language either. :frowning:

Hi there, @tulipa-im :wave:

Apologies for the slow response here! Are you still encountering this issue? If so, please let me know, and I will raise it to a member of the Support team.