Skip to content

Commit ae58a65

Browse files
clydindgp1130
authored andcommitted
fix(@angular/cli): expand locale pattern in workspace schema
Fixes: #16935 (cherry picked from commit 7b54164)
1 parent 267c103 commit ae58a65

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

packages/angular/cli/lib/config/schema.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -381,7 +381,8 @@
381381
"type": "string",
382382
"description": "Specifies the source locale of the application.",
383383
"default": "en-US",
384-
"pattern": "^[a-z]{2}(-[a-zA-Z]{2,})?$"
384+
"$comment": "IETF BCP 47 language tag (simplified)",
385+
"pattern": "^[a-zA-Z]{2,3}(-[a-zA-Z]{4})?(-([a-zA-Z]{2}|[0-9]{3}))?(-[a-zA-Z]{5,8})?$"
385386
},
386387
{
387388
"type": "object",
@@ -390,7 +391,7 @@
390391
"code": {
391392
"type": "string",
392393
"description": "Specifies the locale code of the source locale",
393-
"pattern": "^[a-z]{2}(-[a-zA-Z]{2,})?$"
394+
"pattern": "^[a-zA-Z]{2,3}(-[a-zA-Z]{4})?(-([a-zA-Z]{2}|[0-9]{3}))?(-[a-zA-Z]{5,8})?$"
394395
},
395396
"baseHref": {
396397
"type": "string",

packages/angular_devkit/core/src/experimental/workspace/workspace-schema.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@
136136
"type": "string",
137137
"description": "Specifies the source locale of the application.",
138138
"default": "en-US",
139-
"pattern": "^[a-z]{2}(-[a-zA-Z]{2,})?$"
139+
"pattern": "^[a-zA-Z]{2,3}(-[a-zA-Z]{4})?(-([a-zA-Z]{2}|[0-9]{3}))?(-[a-zA-Z]{5,8})?$"
140140
},
141141
{
142142
"type": "object",
@@ -145,7 +145,7 @@
145145
"code": {
146146
"type": "string",
147147
"description": "Specifies the locale code of the source locale",
148-
"pattern": "^[a-z]{2}(-[a-zA-Z]{2,})?$"
148+
"pattern": "^[a-zA-Z]{2,3}(-[a-zA-Z]{4})?(-([a-zA-Z]{2}|[0-9]{3}))?(-[a-zA-Z]{5,8})?$"
149149
},
150150
"baseHref": {
151151
"type": "string",

0 commit comments

Comments
 (0)