Feature Request: Add an optional `locale` parameter to the collection metadata blocks endpoint
Overview of the Feature Request
Add an optional locale parameter to the Native API endpoint that lists the metadata blocks defined on a collection:
GET /api/dataverses/{identifier}/metadatablocks
The parameter would allow clients to select the language of the display text returned by the API, using the language bundles already installed in Dataverse.
What kind of user is the feature intended for? (Example users roles: API User, Curator, Depositor, Guest, Superuser, Sysadmin)
API users and developers of integrated applications that use field definitions to build metadata forms.
What inspired the request?
The need to present metadata forms in the user's language in applications integrated with Dataverse.
On a local Dataverse 6.12.1 installation configured with English and Brazilian Portuguese, a request with returnDatasetFieldTypes=true returned labels and descriptions in English. Sending the Accept-Language header did not change the response.
Reusing the installed translations would avoid requiring each integrated application to maintain its own translation dictionaries.
What existing behavior do you want changed?
Currently, this endpoint does not provide an explicit parameter for selecting the language, and installed translations are not consistently reflected in the returned text.
We would like to support translation of:
- Metadata block display names.
- Field titles and display names.
- Descriptions and placeholders (
watermark). - The same text properties in child fields of compound fields.
Any brand new behavior do you want to add to Dataverse?
Allow requests such as:
GET /api/dataverses/root/metadatablocks?returnDatasetFieldTypes=true&locale=pt-BR
For example, with the corresponding translations installed, the title field could return the following text:
{
"name": "title",
"displayName": "Título",
"title": "Título",
"description": "Título completo pelo qual o conjunto de dados é conhecido.",
"watermark": "Digite o título..."
}
Identifiers, types, validation rules, and controlled vocabulary values would remain unchanged. Requests without locale would retain the current behavior. If the requested language bundle or translation key were unavailable, the corresponding default value would be retained.
Any open or closed issues related to this feature request?
- #8286 — Change the language of facets in the search API: a related language selection proposal concerning the Search API.
- #4684 — Internationalization: redesign the architecture to handle metadatablocks: discussion of metadata block internationalization, implemented through PR #5290.
We did not find an issue specifically addressing language selection for this endpoint.
Are you thinking about creating a pull request for this feature?
Help is always welcome, is this feature something you or your organization plan to implement?
Yes, we plan to submit a pull request for this feature.