Hi! What would be the best way to implement translatable content? Different projects/objects/fields?
b
busk
05/19/2017, 4:36 PM
@fabianlindfors I haven't done that yet in GraphQL but I can tell you how I've done it successfully in SQL if you want? The idea behind it can be translated 1 to 1 here 🙂
busk
05/19/2017, 4:38 PM
Let's say you have a simple example of a blog post that you'd like to translate... so a title and a body property.
The easiest thing to do is to add a new table / type. I'd call it something like 'Locale(s)' or so. In there, you have properties like ID and then the language values as strings: EN, NL, DE, FR, ...
👍 1
busk
05/19/2017, 4:38 PM
Everywhere you would normally save a value in one language, you instead create a 1:1 relationship to a newly created entry of type 'Locale(s)'
n
nilan
05/19/2017, 4:50 PM
That's a great suggestion, thanks @busk!
f
fabianlindfors
05/20/2017, 10:08 AM
That sounds convenient! Makes for simple queries as well. I was also thinking of creating multiple entries and connecting them with an internal m-m relationship to denote translations. This way all fields can be different in different languages and you can also easily find translations for a specific entry.