Skip to content

the lang prop from the global configuration overrides a message from the method v.message #1192

Open
@yurrko

Description

@yurrko
import * as v from 'valibot';
import '@valibot/i18n/de';

v.setGlobalConfig({ lang: 'de' });

const Schema = v.object({
  email: v.message(v.pipe(v.string(), v.email()), 'Method v.message'),
  password: v.pipe(v.string(), v.minLength(8)),
});

const result = v.safeParse(Schema, {
  email: 'janeexample.com',
  password: '12345678',
});

console.log(result.issues?.[0].message);

expect: Method v.message
actual: Ungültige E-Mail: "janeexample.com" erhalten

Metadata

Metadata

Assignees

Labels

enhancementNew feature or requestintendedThe behavior is expected

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions