-
1
-
2
-
3
-
4
-
5
-
6
-
7
-
8
-
9
-
10
-
11
-
12
-
13
-
14
-
15
-
16
-
17
-
18
-
19
-
20
-
21
-
22
-
23
-
24
-
25
-
26
-
27
-
28
-
29
-
30
-
31
-
32
-
33
-
34
-
35
-
36
-
37
-
38
-
39
-
40
-
41
-
42
-
43
-
44
-
45
-
46
-
47
-
48
-
49
-
50
-
51
-
52
# yup-locale-ja



Japanese localization for [yup](https://github.com/jquense/yup) messages, with translation flavors.
[README (日本語)](./README_ja.md)
## Getting Started
```sh
$ yarn add yup yup-locale-ja
# or...
$ npm i yup yup-locale-ja
```
then, set a locale object as yup's default message dictionary with `setLocale` function.
```js
import { setLocale } from "yup";
import * as ja from "yup-locale-ja";
setLocale(ja.suggestive);
```
For more info, see [yup's README](https://github.com/jquense/yup#using-a-custom-locale-dictionary).
## Translation Flavors
This package comes with two flavors: **descriptive** and **suggestive**.
**descriptive** is such like "~です" ("... is ...") form, which simply describe the field's attribute.
In contrast, **suggestive** messages show a user an action to fix the error, such as "~してください" ("Please do ...").
```js
import * as ja from "yup-locale-ja";
ja.suggestive; // suggestive messages
ja.descriptive; // descriptive messages
```
## How to show a field label?
Add a label by calling [`.label`](https://github.com/jquense/yup#mixedlabellabel-string-schema) method on the field.
This package omits a field path unless a label is set.
## Related Projects
- [loicmahieu/yup-locales](https://github.com/loicmahieu/yup-locales) ... `fr`, `nl`, `nb`, `de`, `ar`
- [arfurlaneto/yup-locale-pt](https://github.com/arfurlaneto/yup-locale-pt) ... `pt` with three translation flavors