Subject: [Jmap] JSContact: how to localize content

From: "Robert Stepanek" <[email-masked]>
Date: Wed, 21 Jul 2021 14:12:38 +0200

At the joint CALEXT/JMAP interim meeting <https://datatracker.ietf.org/doc/minutes-interim-2021-jmap-01-202104150300/> in April we discussed options how localize JSContact values. This can be useful to provide names and addresses in multiple languages within the same contact. In VCARD this is achieved with the LANG parameter.

We would now like to find consensus how to achieve this in JSContact.

*Current approach*
The current scheme in the spec defines a LocalizedString object for fields that can be localized. A LocalizedString has a value and optional localized variants of this value:
"addresses": {
  "addr1": {
    "city": {
      "value": "Tokyo",
      "localizations": {
        "jp": "東京"
      }
    }
  }
}
The idea is to keep values and their localizations close. It is built on the assumption that the majority of values will have localized variants.

*Proposed approach*
Multiple participants in the interim meeting vouched for replacing the current approach with the one defined in section 4.6.1 <https://datatracker.ietf.org/doc/html/rfc8984#section-4.6.1> of the JSCalendar RFC. That is, the "localizations" property is a JSON object where the keys are language tags, and the values are patch objects which overwrite one or multiple properties within a contact.

A main benefit  of this is to reuse for the same approach in both JMAP calendars and contacts. It treats localized content as the exception, not the norm, and the data types should reflect this. Any property value can be localized (except if the spec explicitly forbids it). In contrast, only values of LocalizedString can be localized in the current approach.

This an example how to localize a single address field:
"addresses": {
  "addr1": {
    "city": "Tokyo",
   }
},
"localizations": {
  "jp": {
    "addresses/addr1/city":"東京"
  }
}
To fully localize an address, one would write:
"localizations": {
  "jp": {
    "addresses/addr1": {
      "city": "東京"
    }
  }
}

*Finding consensus*
Mario and I would now like to know which approach you prefer, or any other you would like to propose. Our goal is to reach clear consensus. We look forward to your feedback.

Thanks,
Robert

---

From: "Neil Jenkins" <[email-masked]>
Date: Thu, 22 Jul 2021 22:05:36 +1000

I am very much in favour of the proposed approach rather than the current approach. Our experience with vCards at least is that the vast majority of contact cards to do not store multiple localised forms. The proposed approach makes sense both from a consistency point with JSCalendar, and more importantly it keeps the simple case simple, which makes adoption much easier.

Neil.

---

From: Ken Murchison <[email-masked]>
Date: Thu, 22 Jul 2021 08:42:41 -0400

I agree with all of Neil's points.

On 7/22/21 8:05 AM, Neil Jenkins wrote:
> I am very much in favour of the proposed approach rather than the 
> current approach. Our experience with vCards at least is that the vast 
> majority of contact cards to do not store multiple localised forms. 
> The proposed approach makes sense both from a consistency point with 
> JSCalendar, and more importantly it keeps the simple case simple, 
> which makes adoption much easier.
>
> Neil.
>
> _______________________________________________
> Jmap mailing list
> [email-masked]
> https://www.ietf.org/mailman/listinfo/jmap

-- 
Kenneth Murchison
Senior Software Developer
Fastmail US LLC

---

From: Joris Baum <[email-masked]>
Date: Fri, 23 Jul 2021 08:38:48 +0200

Total agreement from my side as well :) .

On 22.07.21 14:42, Ken Murchison wrote:
>> current approach. Our experience with vCards at least is that the 
>> vast majority of contact cards to do not store multiple localised 
>> forms. The proposed approach makes sense both from a consistency 
>> point with JSCalendar, and more importantly it keeps the simple case 
>> simple, which makes adoption much easier.
>>
>> Neil.
>>

-- 
Joris Baum
Tel: +49 721 170293 16
Fax: +49 721 170293 179

http://www.audriga.com | http://www.twitter.com/audriga

--------------------------------------------------------------------------
audriga GmbH | Durlacher Allee 47 | 76131 Karlsruhe
Sitz der Gesellschaft: Karlsruhe - Amtsgericht Mannheim - HRB 713034
Geschäftsführer: Dr. Frank Dengler, Dr.-Ing. Hans-Jörg Happel
--------------------------------------------------------------------------