Skip to content

Added json translate foe multi language content#118

Open
amirvenusz2 wants to merge 1 commit intooroumand:masterfrom
amirvenusz2:Add-content-translate
Open

Added json translate foe multi language content#118
amirvenusz2 wants to merge 1 commit intooroumand:masterfrom
amirvenusz2:Add-content-translate

Conversation

@amirvenusz2
Copy link

For multilingual projects, content data can be stored in multiple languages in a structure like:
{
"fa": { "title": "یه خاطرهٔ بامزه", "body": "رفتیم پارک..." },
"en": { "title": "A funny memory", "body": "We went to the park..." },
"es": { "title": "Un recuerdo divertido", "body": "Fuimos al parque..." }
}
The data should be stored this way. By reading the request’s Accept-Language header on the frontend, you can filter the database content to the frontend language when sending data, and prevent sending content in all languages.

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

Successfully merging this pull request may close these issues.

1 participant