From cfefbc08d822cd85787d95dc2ee253e3368826d8 Mon Sep 17 00:00:00 2001 From: tobi <31960611+tsmethurst@users.noreply.github.com> Date: Tue, 21 Nov 2023 15:13:30 +0100 Subject: [feature] Federate status language in and out (#2366) * [feature] Federate status language in + out * go fmt * tests, little fix * improve comments * unnest a bit * avoid unnecessary nil check * use more descriptive variable for contentMap * prefer instance languages when selecting from contentMap * update docs to reflect lang selection * rename rdfLangString -> rdfLangs * update comments to mention Pollable * iter through slice instead of map --- internal/typeutils/internaltoas.go | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'internal/typeutils/internaltoas.go') diff --git a/internal/typeutils/internaltoas.go b/internal/typeutils/internaltoas.go index 16467be40..ff502296b 100644 --- a/internal/typeutils/internaltoas.go +++ b/internal/typeutils/internaltoas.go @@ -607,9 +607,17 @@ func (c *Converter) StatusToAS(ctx context.Context, s *gtsmodel.Status) (ap.Stat // conversation // TODO - // content -- the actual post itself + // content -- the actual post + // itself, plus the language contentProp := streams.NewActivityStreamsContentProperty() contentProp.AppendXMLSchemaString(s.Content) + + if s.Language != "" { + contentProp.AppendRDFLangString(map[string]string{ + s.Language: s.Content, + }) + } + status.SetActivityStreamsContent(contentProp) // attachments -- cgit v1.2.3