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

How do you handle multilanguage apps? #12

Open
bryan-gc opened this issue Feb 6, 2022 · 0 comments
Open

How do you handle multilanguage apps? #12

bryan-gc opened this issue Feb 6, 2022 · 0 comments

Comments

@bryan-gc
Copy link

bryan-gc commented Feb 6, 2022

For example, I have this fail response, but the frontend is a multilanguage app.

{
    "status" : "fail",
    "data" : { "username" : "Username already exists" }
}

Should I specify the language on a header and handle it on the backend? I thought that maybe could be a good idea to add a code in a nested object like this

{
    "status" : "fail",
    "data" : {
		"username" : {
			"message": "Username already exists",
			"code": "usernameExists"
    	}
	 }
}

And the frontend should have a dictionary with "userAlreadyExists" to manage multilanguage error messages.

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

No branches or pull requests

1 participant