Heya! I'd like to have a label that is shown in t...
# gooddata-platform
Heya! I'd like to have a label that is shown in the language of the user's preferred language. Hence for a given analytic in a dashboard, I'd like a user with en-US as preferred language to have the en-US version of the label, the user with fr-FR as preferred language to have the fr-FR version of the label, and so on. Languages are not necessarily on a workspace-basis, but rather on a user-basis. I can provide the values of the translation in the datasets and the user's preferred language via the datasets as well. How would you go about it?
Hi Philippe, that is unfortunately not possible out of the box at the moment. All the GoodData objects currently point to the exact labels and labels do not have a language assigned to them. I can imagine this could be done as some kind of custom front-end development in Javascript i.e. using the Dashboard Plugins where if there was some fixed naming convention of the labels (i.e. to know which label is is for which language from the identifier of the label), then the plugin might detect user locale and dynamically redraw the insight… However since the dashboard plugins currently only work for the dashboards in view mode and not Analytical designer, its usage would be limited to viewers.
In general, there is several “layers” of language support in GoodData • The portal in different langueges per user - that is supported and can be done per user (each user can see different language of the buttons, menus etc. in GoodData portal • The Metadata localization - names of insights, attributes, facts, column names in tables, etc… - this can be done with the Metadata Localization feature, where you can import diffrent language versions of these to the workspace and then different users of the workspace can see different names • “Date dimension data” - this is officially not supported, but you can use the custom date dimension to upload customized (i.e. translated) date dimension, but that will be for the whole workspace (not per user) • “General data” - (I believe this is what you are asking for) - this is not supported, you can possibly load different values to different workspaces, but it would not be possible to use different languages in the same workspace (unless you use the dashboard plugins workaround).
What you may consider is to use M:N relation to dataset containing multiple variants of the label in different languages and use data permissions to restrict access to the only language variant based on user preferences. For example: • attribute_id - foreign key from the dimension dataset which you need to translate • attribute_text - the text translated to target language • language - attribute used for filtering using mandatory user filter the dataset would contain multiple rows for each attribute_id for different language translations. Without a language filter all the translations would be visible and result would contain duplicities (the same value with attribute text each language). I hope the proposal is clear 🙂 https://help.gooddata.com/doc/enterprise/en/data-integration/data-modeling-in-gooddata/many-to-many-in-logical-data-models https://help.gooddata.com/doc/enterprise/en/workspace-and-user-administration/managing-workspace-data-and-data-access/data-permissions
Hi Michal, Jakub! Thanks for your answers. Thanks Michal for the explainer about the type of language support in GD. Thanks Jakub for your solution. It's a really interesting avenue and I'll definitely consider it. I'll have to investigate how it affects my data warehouse and integration with GD. I think the main issue will be that I have automated end-of-line tests that test the insights against my own SQL, and that I won't be able to filter the records when calling the executeVisualization endpoint directly. Any idea how I can call executeVisualization with a dataset prop filter?