hapijs / hapijs/joi

Validation message in Arabic language

Open
#2,941 3 comments 0 reactions 0 assignees View on GitHub
feature
Dominant language
JavaScript
Stars
21.2k
Forks
1.5k
Avg merge
4h 57m
Merged PRs (30d)
14

Description

#### Support plan

* *is this issue currently blocking your project?* (yes/no): yes
* *is this issue affecting a production system?* (yes/no): yes

#### Context

* *node version*: 18.14.2
* *module version*: joi@17.8.3
* *environment* (e.g. node, browser, native):
* *used with* (e.g. hapi application, another framework, standalone, ...):
* *any other relevant information*: using joi via cdn.jsdelivr.net, by JavaScript inside asp.net core app

#### What problem are you trying to solve?

![image](https://user-images.githubusercontent.com/64529765/231168748-91f1377e-bc3a-4e32-9358-3a6636df8fde.png)

```js
const ngoNameArSchema = joi.string()
.pattern(new RegExp('^[\u0621-\u064A\u0660-\u0669\0-9]+$'))
.min(2)
.max(30)
.messages({
//'string.base': `required`,
//'string.empty': `cannot be an empty field`,
'string.min': '@T["validation-message-minimum-string"]',
'string.pattern.base': `allow only arabic characters`,
//'any.required': `is a required field`
});
```

#### Do you have a new or modified API suggestion to solve the problem?
sorry for now no

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.