Skip to content

@lang directive. Info on resolved language #3801

@vilarfg

Description

@vilarfg

Experience Report

What you wanted to do

When I write a query using the @lang directive, I don't receive info on the locale of the result.
Example query:

{
    q(func: allofterms(name@en, "Farhan Akhtar")) {
        name@hi
        name@en

        director.film {
            name@ru:hi:en
            name@en
            name@hi
            name@ru
        }
    }
}

Example result (only the bit about director.film, for brevity):

"director.film": [
    {
        "name@ru:hi:en": "दिल चाहता है"
    }
]

I can see it's been resolved to hindi, but it's not labeled as hindi. It's labeled as ru:hi:en

Why that wasn't great, with examples

It would be nicer to have an indication on the language of the result (and ideally the prompt as well). Like:

"director.film": [
    {
        "name@hi": "दिल चाहता है"
    }
]

or

"director.film": [
    {
        "name@ru:hi:en": { "hi": "दिल चाहता है"}
    }
]

PS: I've been instructed to CC @campoy on this one

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/querylangIssues related to the query language specification and implementation.kind/featureSomething completely new we should consider.priority/P2Somehow important but would not block a release.status/acceptedWe accept to investigate/work on it.status/more-info-neededThe issue has been sent back to the reporter asking for clarifications

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions