Skip to content

Commit

Permalink
fix(locale): 🐛 allow latin american spanish locale
Browse files Browse the repository at this point in the history
The valid locale identifier es-419 was being rejected by the
`isLocalFormat` function.
  • Loading branch information
davidsidlinger committed Jan 9, 2024
1 parent 2487749 commit 0602cea
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion libs/transloco-locale/src/lib/helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
Expand Down

0 comments on commit 0602cea

Please sign in to comment.