Skip to content

Change locale support to something that works with browserify. #216

Closed
@martinheidegger

Description

@martinheidegger

Right now its not possible to use join in the browser using browserify because it requires a dynamic string.

errors.js#L26

Browserify doesn't know how to resolve this and will throw a error like:

Uncaught Error: Cannot find module '/node_modules/joi/languages/en-us.json'

As cleanest option to resolve this I would see passing in the locales as object alternatively. Then I could setup my browser js by using something like:

joi.validate(object, rules, {localeData: require("joi/locales/en-us")});

What do you think?

Metadata

Metadata

Assignees

Labels

featureNew functionality or improvement

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions