Skip to content

Add .locale() method on s.object #386

@freekh

Description

@freekh

We want to add a .locale("fieldname") method on s.object which set the field which defines the locale of an object. It will be used together with s.locale():

s.object({ title: s.string(), lang: s.locale("en_us", "fr_fr") }).locale("lang") // "lang" could be anything...

Full example will be something like this:

const schema = s.object({ title: s.string(), lang: s.locale("en_us", "fr_fr") }).locale("lang")

export default c.define("/test.val.ts", schema, {
  title: "hello",
  lang: "en_us"
})

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Status

    Todo

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions