I just realized that there are no consistency in the response for locale ISO codes between Graphql and the webhook HTTP body response:
for example in webhook is en-GB
and in Graphql is en_GB
, see the image below:
Not sure if this is a bug or is intended. My issue is that Iām mapping the locales to have specific locale codes in my slug but is hard to map if I received different versions from Dato:
export const mapDatoLocaleToLocale: Record<SiteLocale, Locales> = {
de: "de-de",
en_GB: "en-gb",
nl_NL: "nl-nl",
fr: "fr-fr",
};