‎17-06-2020 09:55 AM - edited ‎07-12-2020 10:15 AM
query user {
personSystem(filter:{name:"Thomas"}) {
id
name
dataLanguage {
...on Language {
language:languageCode
languageId:id
languageName:name
}
}
}
}
In HOPEX the data can be inputted in different languages ( English, French, Spanish, Italian, German...). When connected by the GraphQL REST API it is possible to select the data language.
By default all the queries are performed in the current data language.
Query | Result |
|
|
Query | Result |
|
|
When requesting the data you can force the language of the return data for all translatable fields (name, comment...). The selection of the language is done by its code : EN, DE, JA, FR, ES, NL, IT...
In one query you can get the data in a given language or several languages.
Query | Result |
|
|
Theses request do not change the default language of the user. Any next query done without defining the language is returned in the default language.
To change the current data language you need to update the user context. For that you need to execute a graphQL mutation on the context.
Query | Result |
|
|
Aside from the current user it is also possible to update the data language of group of user.
You can query the user to understand which language they have by default. If the return value is blank the default language is the same as the installation.
Query | Result |
|
|
You can set the language of a given user by it's ID.
Query | Result |
|
|
To know the possible value of the language code available you can query graphQL.
query availableLanguage {
language(filter:{id:"I9o3by0knG00"}) {
language_SpecializedLanguage {
language:languageCode
languageId:id
languageName:name
}
}
}
You may have to to it on the MetaModel schema so that query can work.
The list of available data language depends on the options defined in HOPEX. Check the available language in the installation options or environment options :
For more details on how to add data language read the full documentation here :