In MAQL, is there a way I can refer to the languag...
# gooddata-platform
In MAQL, is there a way I can refer to the language of preference of the currently logged-in user so that I can pick which attribute to display as name?
each user can choose the language in their account settings
although, it’s not possible to alter the attributes/labels in insight based on the language
OK, so if I understand properly, you mean that: 1. The interface supports multiple languages 2. LDM supports multiple languages, with limitation that the user cannot create their own insights/dashboard in another language than English 3. It is not possible to choose one attribute or label property over another based on the language of the user
Basically you can localize all metadata - ldm object titles, insight titles, dashboard titles, text fields on dashboards and such. Attribute values cannot be localized. But of course users can use labels in their own language for their own insights if such labels exist in the workspace. I.e. one atteibute can have two labels - one english, one french and the user can choose which one will be displayed in the insight
Great, that answers my question 🙂
If we assume that all users within a tenant will be using the same language, we can then simplify the model to have a single label attribute with the value in the language of said tenant.
Well, you can. Or you can have both and select the one that will be used the most as default, so it won’t bring any additional effort (meaning it will always be chosen as the initial one and no further change will be needed)
That's another way. The issue I see though is that I will need to have a segment created for primarily-EN workspaces and one for primarily-FR workspaces if I opt for two separate fields I'd rather have a single label field, with a label_en & label_fr for futureproofing:
Copy code
    - x__client_id
    - cp__department
    - a__label
    - l__label_fr
    - l__label_en
What do you think?
I see, of course, single label field is perfectly possible, I’ll check if it’s somehow possible to choose default label and not have it overwritten by lcm (to make it permanent regardless of lcm)
👍 1
I stumbled on something that could be a potential solution: Project/User variables Are these available when creating a Metric in MAQL?
Yes filter variable an be used in conditions. Example:
Copy code
SELECT Number of Appointments WHERE FilterVariable
If you have multiple name records, you can chose the appropriate one using variables but all will be displayed if you forget to do so. You may consider to use mandatory user filters (data permissions) to select the appropriate record this way you will not need to specify it in MAQL.
you can relate multiple records with different variations of the same name to the facts via M:N bridge dataset