-
Notifications
You must be signed in to change notification settings - Fork 85
Description
When using contentMap
, it is generally better not to include content
, since the two are functionally redundant. The only real difference is that contentMap
carries explicit language tags.
A default language can be specified via the JSON-LD @language
context. However, implementations that do not process ActivityPub documents as JSON-LD may ignore this. For that reason, I recommend representing values in contentMap
as a single string with an explicit language tag, rather than duplicating content
and contentMap
.
In theory, when implementing compatibility with plugins like Polylang, contentMap
could be used to include multiple language versions. But in the case of WordPress—where articles are the primary content type—this approach may be inefficient. In practice, a more common pattern is to use a single language tag and rely on services like the DeepL API for translation.
Personally, I think multilingual profiles for actors are much more useful than multilingual content objects.
References
- [Activity Streams 2.0 — Natural Language Values](https://www.w3.org/TR/activitystreams-core/#naturalLanguageValues)
A JSON object mapping well-formed [BCP47] Language-Tags to localized, equivalent translations of the same string value. In JSON serialization:
"name"
,"summary"
,"content"
→ plain string form"nameMap"
,"summaryMap"
,"contentMap"
→ object form with language mappings
- [Activity Streams 2.0 — Default Language Context](https://www.w3.org/TR/activitystreams-core/#defaultlangcontext)
When using [JSON-LD], the
@language
property MAY be used to identify the default language. This mechanism may not be understood by implementations that do not process documents as JSON-LD.
(like a multilingual actor profile using nameMap
and summaryMap
), compare it with a multilingual Article
object case