Skip to content

Commit 7b54164

Browse files
clydindgp1130
authored andcommitted
fix(@angular/cli): expand locale pattern in workspace schema
Fixes: #16935
1 parent e64ab3d commit 7b54164

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
@@ -387,7 +387,8 @@
387387
"type": "string",
388388
"description": "Specifies the source locale of the application.",
389389
"default": "en-US",
390-
"pattern": "^[a-z]{2}(-[a-zA-Z]{2,})?$"
390+
"$comment": "IETF BCP 47 language tag (simplified)",
391+
"pattern": "^[a-zA-Z]{2,3}(-[a-zA-Z]{4})?(-([a-zA-Z]{2}|[0-9]{3}))?(-[a-zA-Z]{5,8})?$"
391392
},
392393
{
393394
"type": "object",
@@ -396,7 +397,7 @@
396397
"code": {
397398
"type": "string",
398399
"description": "Specifies the locale code of the source locale",
399-
"pattern": "^[a-z]{2}(-[a-zA-Z]{2,})?$"
400+
"pattern": "^[a-zA-Z]{2,3}(-[a-zA-Z]{4})?(-([a-zA-Z]{2}|[0-9]{3}))?(-[a-zA-Z]{5,8})?$"
400401
},
401402
"baseHref": {
402403
"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)