Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement translation message #60

Closed
nipeharefa opened this issue Feb 27, 2019 · 2 comments
Closed

Implement translation message #60

nipeharefa opened this issue Feb 27, 2019 · 2 comments

Comments

@nipeharefa
Copy link

Hi,
Any plan to implement translation message on this package?

@cyruzin
Copy link

cyruzin commented Mar 8, 2019

Until the internalization is implemented, use messages:

messages := govalidator.MapData{
		"username": []string{"required:আপনাকে অবশ্যই ইউজারনেম দিতে হবে", "between:ইউজারনেম অবশ্যই ৩-৮ অক্ষর হতে হবে"},
		"phone":    []string{"digits:ফোন নাম্বার অবশ্যই ১১ নম্বারের হতে হবে"},
	}

@thedevsaddam
Copy link
Owner

@nipeharefa It would be great if the package support translation, can you please share some more information on how this can be achieved?

You can use MapData to translate the validation errors like @cyruzin shared an example.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants