From 0602cea20fe53600a1425acfccb4c483eb7532df Mon Sep 17 00:00:00 2001 From: David Sidlinger Date: Tue, 9 Jan 2024 15:44:01 -0600 Subject: [PATCH] =?UTF-8?q?fix(locale):=20=F0=9F=90=9B=20allow=20latin=20a?= =?UTF-8?q?merican=20spanish=20locale?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The valid locale identifier es-419 was being rejected by the `isLocalFormat` function. --- libs/transloco-locale/src/lib/helpers.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libs/transloco-locale/src/lib/helpers.ts b/libs/transloco-locale/src/lib/helpers.ts index fbcdecb4f..08d79132f 100644 --- a/libs/transloco-locale/src/lib/helpers.ts +++ b/libs/transloco-locale/src/lib/helpers.ts @@ -12,7 +12,7 @@ export const ISO8601_DATE_REGEX = * isLocaleFormat('en-US') // true */ export function isLocaleFormat(val: any): val is Locale { - const irregulars = `en-GB-oed|i-ami|i-bnn|i-default|i-enochian|i-hak|i-klingon|i-lux|i-mingo|i-navajo|i-pwn|i-tao|i-tay|i-tsu|sgn-BE-FR|sgn-BE-NL|sgn-CH-DE|art-lojban|cel-gaulish|no-bok|no-nyn|zh-guoyu|zh-hakka|zh-min|zh-min-nan|zh-xiang`; + const irregulars = `en-GB-oed|i-ami|i-bnn|i-default|i-enochian|i-hak|i-klingon|i-lux|i-mingo|i-navajo|i-pwn|i-tao|i-tay|i-tsu|sgn-BE-FR|sgn-BE-NL|sgn-CH-DE|art-lojban|cel-gaulish|no-bok|no-nyn|zh-guoyu|zh-hakka|zh-min|zh-min-nan|zh-xiang|es-419`; const BCPFormat = `[a-z]{2}-[A-Z]{2}`; const scriptFormat = `[a-z]{2}-[A-Za-z]{4}`; return (