openwallet-foundation / bifold-wallet

Aries Mobile Agent React Native - Part of the Aries Bifold effort to provide SSI capabilities in a production ready app.
Apache License 2.0
146 stars 141 forks source link

Localisation support for VC schema attributes and value #121

Closed nbAmit closed 2 years ago

nbAmit commented 2 years ago

Can we support the localisation for schema attributes and value?

To achieve this do we need to implement this functionality on react-native app side or on Aries agent side by implementing the below RFC?

https://github.com/hyperledger/aries-rfcs/blob/main/features/0043-l10n/README.md

swcurran commented 2 years ago

I don't think we would ever want to localize values, but we would want to localize the schema attributes -- the labels for the values.

I don't think the intention of 0043 was to be used in this way, but it's an interesting idea. Somehow the holders and verifiers have to get the "schema localization" file and know it was from the issuer.

The issue of localizing the schema attributes (including the Credential Type) should be kept separate from the more straight forward issue of localizing the rest of the wallet. The latter is a well known issue and we should use the best practices for mobile apps for that.

The BC Team talked about this issue and decided to start with the following:

Note that for JSON-LD credentials, I've heard that their is a localization mechanism that can be used when defining the context of a context, but I've not seen exactly how it works. If that is in the JSON-LD spec, issuers could use that for l18n of the VCs.

Lots of ideas and questions to work through for this issue.

TimoGlastra commented 2 years ago

Have a default set of presentation rules for the schema metadata based on what is available with any VC (particularly for Indy AnonCred VCs). For example, the rule might be to extract the tag part of the credential definition, convert "_" and "-" to spaces and capitalize the name. The precise rules would be determined by looking at real examples in use in production and define best practices for the existing credentials. Similar rules for attribute names.

We also do that! May be good to write down some rules for it so we can be consistent across apps

Note that for JSON-LD credentials, I've heard that their is a localization mechanism that can be used when defining the context of a context, but I've not seen exactly how it works. If that is in the JSON-LD spec, issuers could use that for l18n of the VCs.

From the Aries RFC on JSON-LD compatibility:

It doesn’t support localization of keys--only values. There are corner cases where key localization is desirable.

ianco commented 2 years ago

Further to @swcurran 's comment about localizing the credential type and attribute labels (as opposed to the attribute values), I don't think it makes sense to include these in the credential, or in the DIDcom messages. The issuer may not know, at the time of issue, what languages need to be supported. If we implement a separate "bundle" as @swcurran suggests, then this can be updated as new languages are added. For example when the credential is issued possibly the bundle only contains English and French, but later on support is added for Chinese and other languages.

Another consideration is standardization of attributes across credentials, for example standard attribute names for things like First Name, Last Name, Address, Birth Date, etc. This is supported in JSON-LD credentials but not Indy. If we adopt some kind of standardized attribute names, then this would help with the localization issue (the attribute names could have standardized translations as well) and also facilitate requesting proofs across different credentials.

ianco commented 2 years ago

Regarding translations of attribute values, I think the internationalization RFC could support that, as it would be the issuer that would have to provide these values when the credential is issued (and only the issuer would know which values could be translated)

ianco commented 2 years ago

Consider linking Indy credential attributes to schema.org-defined properties? Apparently there is a plan to provide translations at some point:

https://schema.org/docs/faq.html

Q: Is schema.org available in multiple languages? When is that coming? What languages is the markup available in?

Schema.org markup can be used on web pages written in any language. The site is currently available in English only, but we plan to translate to other languages soon. The markup, like HTML, is in English.

darrellodonnell commented 2 years ago

Are we talking here about localizing the credential attribute names or how they appear on various devices? Imagine the most trivial "name" credential:

{ "name":"Darrell O'Donnell" }

and, en francais { "nom":"Darrell O'Donnell" }

Those, data-wise, are two different credential types, with different credential schemas.

OR - are we talking about how I learn how to render those?

NAME: Darrell O'Donnell NOM: Darrell O'Donnell

and in Canada:

Name/Nom: Darrell O'Donnell or Nom/Name: Darrell O'Donnell

ianco commented 2 years ago

How they are displayed in the UI

I.e. a credential can contain { "name":"Darrell O'Donnell" } or { "name_nomme":"Darrell O'Donnell" } (the latter because Quebec is very fussy about using French), then the UI may display one of:

NAME: Darrell O'Donnell NOMME: Darrell O'Donnell Name/Nomme: Darrell O'Donnell

... or whatever

darrellodonnell commented 2 years ago

mDL (ISO 18013-3) is quite explicit about its attribute names (e.g. family_name, given_name, birth_date, issue_date). The rendering of that data is application-specific and PERHAPS there can be a data dictionary with well-known translations. For rich data ecosystems that would be a good thing to have.

ianco commented 2 years ago

If we have a standard set of attribute names then we should be able to have a standard set of translations. It would be nice if the attribute names were standard across different credentials (for example does a Health Card also have a family_name and given_name?)

Just on the topic of names, when the BC Health folks were issuing the PoV cards, they had to re-issue twice to make sure to include all name information. The first time they just included given and family names, but had to include middle names because these are required for some non-english names. I notice that mDL has only 2 attributes for given and family names, I guess this means all given names are jammed into one attribute?

darrellodonnell commented 2 years ago

mDL uses given_name for multiple names.

"First name(s), other name(s), or secondary identifier of the license holder"

darrellodonnell commented 2 years ago

I suggest we look to create a Label Overlay, per OCA.

https://github.com/hyperledger/aries-rfcs/tree/main/concepts/0013-overlays#label-overlay

jleach commented 2 years ago

I think this is being dealt with as part of OCA. Quebec has done a PoC already and BC will do it. What can be contributed back to Bifold will be.

Closing stale issues as per July 19 Bifold UG call. Please re-open if unresolved or if its still relevant.