mirror of
https://github.com/Lifeforge-app/lifeforge.git
synced 2026-03-03 02:27:00 +00:00
fix(cli): update locale name validation when installing locales
This commit is contained in:
@@ -14,7 +14,7 @@ export async function installLocaleHandler(langCode: string): Promise<void> {
|
||||
'locale'
|
||||
)
|
||||
|
||||
if (!/^@lifeforge\/lang-[a-z]{2}(-[A-Z]{2})?$/i.test(fullName)) {
|
||||
if (!/^@lifeforge\/.*?-lang-[a-z]{2}(-[A-Z]{2})?$/i.test(fullName)) {
|
||||
logger.error(
|
||||
`Invalid locale name: ${chalk.blue(langCode)}. Locale names should follow the format "xx" or "xx-XX", where "xx" is a two-letter language code and "XX" is a two-letter country code.`
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user