hello,
I’m very much interested in DGraph
I have a question regarding the @lang
directive. It’s usefulness is obvious to me (it’s a killer feature!), but after reading the “Language Support” section of the documentation, I wonder:
-
Is the mechanism that drives this feature in any way actually related to i18n?
Because I can see other ways this could be used that are not related to i18n. For example:color@rgba // get me results in RGBA color@rgba:hsva:cmyk:. // get me results in RGBA and fallback to HSVA, CMYK or whatever length@mm // get me results in millimeters
I ask, because I don’t think I would get the same mechanics, if I just name an edge
color_rgba
. -
And also, this query:
{ q(func: allofterms(name@en, "Farhan Akhtar")) { name@hi name@en director.film { name@ru:hi:en name@en name@hi name@ru } } }
will produce:
{ "data": { "q": [ { "name@hi": "फरहान अख्तर", "name@en": "Farhan Akhtar", "director.film": [ { "name@ru:hi:en": "दिल चाहता है", "name@en": "Dil Chahta Hai", "name@hi": "दिल चाहता है" } ] } ] } }
which, of course, is very handy. But it doesn’t tell me to which language the values in the response actually resolved to. What I mean is: instead of getting:
"name@ru:hi:en": "दिल चाहता है"
it would be nice to get
"name@hi": "दिल चाहता है" // so that I know what language I am getting back
or even:
"name@ru:hi:en>hi": "दिल चाहता है" // now I know both what prompted the result and the resolution // (I'm not suggesting this is a nice syntax 😆) // or: "name@ru:hi:en": { "hi": "दिल चाहता है" } // or: "name@ru:hi:en": ["hi", "दिल चाहता है"]
Please let me know if I am missing something in the docs.
By the way, I ask, not just out of curiosity, but because my first question is directly related to an actual use case I am dealing with right now. So the answer might tilt the scales towards using DGraph in my startup.
So, looking forward to your thoughts on this matter @mrjn
best,
F