fix: localize validation and api messages
This commit is contained in:
@@ -40,7 +40,7 @@ const environmentSchema = z.object({
|
||||
export const config = environmentSchema.parse(process.env);
|
||||
|
||||
if (config.APP_ENV === 'production' && config.JWT_SECRET === 'development-only-secret-change-before-production') {
|
||||
throw new Error('JWT_SECRET must be set to a unique value in production.');
|
||||
throw new Error('JWT_SECRET deve ter um valor único em produção.');
|
||||
}
|
||||
|
||||
const bunnyConfigurationValues = [
|
||||
@@ -50,7 +50,7 @@ const bunnyConfigurationValues = [
|
||||
];
|
||||
|
||||
if (bunnyConfigurationValues.some(Boolean) && !bunnyConfigurationValues.every(Boolean)) {
|
||||
throw new Error('BUNNY_STREAM_LIBRARY_ID, BUNNY_STREAM_API_KEY, and BUNNY_EMBED_TOKEN_KEY must be configured together.');
|
||||
throw new Error('BUNNY_STREAM_LIBRARY_ID, BUNNY_STREAM_API_KEY e BUNNY_EMBED_TOKEN_KEY devem ser configurados juntos.');
|
||||
}
|
||||
|
||||
const bunnyStorageConfigurationValues = [
|
||||
@@ -61,10 +61,10 @@ const bunnyStorageConfigurationValues = [
|
||||
];
|
||||
|
||||
if (bunnyStorageConfigurationValues.some(Boolean) && !bunnyStorageConfigurationValues.every(Boolean)) {
|
||||
throw new Error('BUNNY_STORAGE_ZONE, BUNNY_STORAGE_PASSWORD, BUNNY_STORAGE_ENDPOINT, and BUNNY_STORAGE_CDN_HOST must be configured together.');
|
||||
throw new Error('BUNNY_STORAGE_ZONE, BUNNY_STORAGE_PASSWORD, BUNNY_STORAGE_ENDPOINT e BUNNY_STORAGE_CDN_HOST devem ser configurados juntos.');
|
||||
}
|
||||
|
||||
const smtpConfigurationValues = [config.SMTP_HOST, config.SMTP_PORT, config.SMTP_USER, config.SMTP_PASS, config.MAIL_FROM];
|
||||
if (smtpConfigurationValues.some(Boolean) && !smtpConfigurationValues.every(Boolean)) {
|
||||
throw new Error('SMTP_HOST, SMTP_PORT, SMTP_USER, SMTP_PASS, and MAIL_FROM must be configured together.');
|
||||
throw new Error('SMTP_HOST, SMTP_PORT, SMTP_USER, SMTP_PASS e MAIL_FROM devem ser configurados juntos.');
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user