[locales] BCP 47 recommends that country codes be capitalized

Hello there,

BCP 47, in RFC 5646: Tags for Identifying Languages, states that language tags and their subtags are to be treated as case insensitive and recommends that country codes be capitalized

And that is what MDN does, for example with the en-US locale identifier in the URL of the following page (look at the URL):

But Prismic uses rather all-lowercasse local identifiers, for example: fr-fr, en-gb, etc.

I have an application with content following BCP 47 with locale identifiers like, fr, fr-BE, en, en-GB, en-US, etc. that is with capitalized country codes. I have done tests with Prismic and a document with locale fr-be is successfully fetched when requested with a locale identifier of fr-BE. Before I could definitely settle on this practice, could it be confirmed that this will never break?

Thank you in advance!

Hello @prismic-forum.mjlu5

Welcome to the Prismic forum, and thanks for reaching out to us.

I have tested it with one of my old projects in the past, and I can confirm that it should work without any issues.


1 Like