Using the 'lang' parameter
System data
For fields like 'institution_name' the text may be given in system data languages. System data languages are predefined in Cristin system and cannot be altered by the users. They are:
- Norwegian Bokmål (nb)
- Norwegian Nynorsk (nn)
- English (en)
Filtering: These fields will be filtered on the language given by the request parameter 'lang'. The client may request one or several, comma-separated language codes.
Fallback language rules: If language is not specified in the url the default language English is used. If the specified language doesn't exist for a particular item, the data for this item will be given in 'Norwegian Bokmål'.
https://api.cristin.no/v2/institutions/2012?lang=nb { "cristin_institution_id": 2012, "institution_name": { "nb": "Oslo universitetssykehus HF" }, ... } https://api.cristin.no/v2/institutions/2012?lang=en { "cristin_institution_id": 2012, "institution_name": { "en": "Oslo University Hospital" }, ... } https://api.cristin.no/v2/institutions/2012?lang=en,nb { "cristin_institution_id": 2012, "institution_name": { "nb": "Oslo universitetssykehus HF", "en": "Oslo University Hospital" }, ... }
Default language: If the 'lang' parameter is omitted, system data will be returned in English
https://api.cristin.no/v2/institutions/2012
{
"cristin_institution_id": 2012,
"institution_name": {
"en": "Oslo University Hospital"
},
...
}
Fallback language: If the requested language doesn't exist for a field, the data for this field will be given in 'Norwegian Bokmål'
https://api.cristin.no/v2/projects/257?lang=nn
{
"cristin_project_id": "257",
...
"coordinating_institution": {
"institution": {
"cristin_institution_id": "185",
"institution_name": {
"nn": "Universitetet i Oslo" //data for 'nn' exists
},
"url": "https://api.cristin.no/v2/institutions/185"
},
"unit": {
"cristin_unit_id": "185.90.0.0",
...
}
},
"institutions_responsible_for_research": [
{
"institution": {
"cristin_institution_id": "254.0.0.0",
"institution_name": {
"nb": "NLA Høgskolen" //data for 'nn' doesn't exist, fallback to 'nb'
},
"unit": { ... }
}
...
],
...
}
User data
Other fields like 'title' may be given in several languages (user data languages) and are not limited to the three system data languages. These fields will not be affected by the 'lang' parameter.
https://api.cristin.no/v2/projects?id=257&lang=nb
[
{
"cristin_project_id": "257",
"title": {
"da": "Elektrokardiografisk kvantisering af reversibel iskæmisk celleskade mm. test av låste felt",
"nb": "BOKMÅL - Electrocardiographic quantisation of reversible ischemic cell damage and stuff. Test av låste felt",
"nn": "Sekundærtittel på norsk for prosjekt 257. test av låste felt"
},
"main_language": "da",
"url": "https://api.cristin.no/v2/projects/257"
}
]