Skip to content

How do you handle multilanguage apps? #12

@bryan-gc

Description

@bryan-gc

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions