Skip to main content
European CommissionEBSI European Blockchain

How to express VC properties in different languages

Last updated on

Internationalisation and expressing properties in different languages

Introduction

Issuers must be capable of issuing Verifiable Credentials (VCs) in various languages, and wallets must be equipped to present VCs in different languages. This document outlines the procedures to achieve this for any type and format of VCs.

Key Components

Configuration files are hosted in the schema registry at /translations/{iso language tag}.json

  • Claim Name: Identifies the claim. Example: "foo".
  • Claim Value: Determines the value of the claim. Example: "bar".

Example Claim Name and Claim Value pair in JSON format:

{
"foo": "bar"
}

Internationalisation

Internationalisation (i18n) is the process of designing and developing software applications to be easily adaptable to different languages and cultures. By implementing internationalisation practices, developers ensure that their applications can be localised to meet the linguistic and cultural preferences of users worldwide. i18n is a widely adopted internationalisation framework that should be used to express claim names in different languages.

Expressing a claim values in different languages

Language maps

Wallets and other elements must be able to express claim values in multiple languages and ensure developers can easily navigate language-specific data structures. To achieve this, language maps should be used. When using language maps, ISO language codes MUST be used.

{
"color": {
"en": "blue",
"de": "blau",
"es": "azul"
}
}

Default language

A default language can be defined by setting the @language key in the context:

"@context": [{ "@language": "en"}]

The language map element for the default language MUST always be present.

Profile for simple credentials

If the default language is English and all values are expressed in English, both the default language and language maps can be omitted.

Example

Example JSON object with multi-language support:

{
"car": {
"color": {
"en": "blue",
"de": "blau",
"es": "azul"
}
}
}

i18n configuration file for the color claim:

{
"color": {
"en": "color",
"de": "Autofarbe",
"es": "color"
}
}

i18next configuration file for the color claim:

{
"en": {
"translation": {
"color": "color"
}
},
"de": {
"translation": {
"color": "Farbe"
}
},
"es": {
"translation": {
"color": "color"
}
}
}

When displaying this on a website:

  • English: The color of the car is blue.
  • German: Die Farbe des Autos ist blau.
  • Spanish: El color del coche es azul.

References