Multi-lingual database #4950
-
For a new app, I want to build in multi-lingual support from the get go. My frontend is svelte kit, I can use i18n with it. i can think of two way of using pocketbase to be multilingual.
Is there another way that I am missing? What would you use if you had to support this? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
I personally solve it with a collection that only stores the translatable fields.
and a collection posts_translations with the translatable fields like
(post,lang) should be a unique index.
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. |
Beta Was this translation helpful? Give feedback.
-
Collection posts id |
Beta Was this translation helpful? Give feedback.
I personally solve it with a collection that only stores the translatable fields.
You have posts with all non translatable fields like
and a collection posts_translations with the translatable fields like
(post,lang) should be a unique index.
and a collection languages
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.