Skip to content

Multi-lingual database #4950

Answered by munxar
proofofjogi asked this question in Q&A
Discussion options

You must be logged in to vote

I personally solve it with a collection that only stores the translatable fields.
You have posts with all non translatable fields like

  • id
  • author
  • created
  • updated

and a collection posts_translations with the translatable fields like

  • id
  • post (relation to post)
  • language (relation to languages)
  • title
  • slug

(post,lang) should be a unique index.
and a collection languages

  • id
  • code (de, fr, it, en or en-AT
  • name (German, French, ...)

You can then query the posts and expand all attached translations with expand:posts_translations_via_post or just a specific one with a filter.

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by proofofjogi
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants