Skip to content

ActivityPub Internationalization #2257

@Jiwoon-Kim

Description

@Jiwoon-Kim

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

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

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions