Skip to content
0
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Brite
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Brand Logo

fedi wiki

  1. Home
  2. Technical Discussion
  3. Does #Mastodon even use `contentMap` in posts (`Note`)?

Does #Mastodon even use `contentMap` in posts (`Note`)?

Scheduled Pinned Locked Moved Technical Discussion
mastodonactivitypubfediversei18nl10n
15 Posts 4 Posters 6 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • mooooooo@qaf.menM This user is from outside of this forum
    mooooooo@qaf.menM This user is from outside of this forum
    mooooooo@qaf.men
    wrote last edited by
    #1

    Does #Mastodon even use `contentMap` in posts (`Note`)? The #ActivityPub spec specifies a method for multilanguage posts in the form of `contentMap`, but does the rest of the #Fediverse even get to read it? Do posts that have `contentMap` but **not** `content` get to show at all?

    Re: https://www.disruptiveconversations.com/2022/12/mastodon-tip-filter-languages-to-see-only-the-ones-you-understand.html

    #i18n #l10n

    mooooooo@qaf.menM julian@activitypub.spaceJ 2 Replies Last reply
    0
    • mooooooo@qaf.menM mooooooo@qaf.men

      Does #Mastodon even use `contentMap` in posts (`Note`)? The #ActivityPub spec specifies a method for multilanguage posts in the form of `contentMap`, but does the rest of the #Fediverse even get to read it? Do posts that have `contentMap` but **not** `content` get to show at all?

      Re: https://www.disruptiveconversations.com/2022/12/mastodon-tip-filter-languages-to-see-only-the-ones-you-understand.html

      #i18n #l10n

      mooooooo@qaf.menM This user is from outside of this forum
      mooooooo@qaf.menM This user is from outside of this forum
      mooooooo@qaf.men
      wrote last edited by
      #2

      I ask because I see this:

      https://github.com/mastodon/mastodon/blob/68fb4de0d050bb2b462ae7116cd7fe115783b9a3/app/lib/activitypub/parser/status_parser.rb#L44

      And it seems that #Mastodon always just gets the **first** present language?

      It would be great if it used the user's language preferences and the provided `contentMap` to actually make a i18n-able platform out of it? Maybe the users over at mastodont.cat get to see the Catalan version of the @mawdev posts, which have technically existed since the 17th but I don't think they ever get to be read.

      mooooooo@qaf.menM 1 Reply Last reply
      0
      • mooooooo@qaf.menM mooooooo@qaf.men

        I ask because I see this:

        https://github.com/mastodon/mastodon/blob/68fb4de0d050bb2b462ae7116cd7fe115783b9a3/app/lib/activitypub/parser/status_parser.rb#L44

        And it seems that #Mastodon always just gets the **first** present language?

        It would be great if it used the user's language preferences and the provided `contentMap` to actually make a i18n-able platform out of it? Maybe the users over at mastodont.cat get to see the Catalan version of the @mawdev posts, which have technically existed since the 17th but I don't think they ever get to be read.

        mooooooo@qaf.menM This user is from outside of this forum
        mooooooo@qaf.menM This user is from outside of this forum
        mooooooo@qaf.men
        wrote last edited by
        #3

        Also I'm not making the multilanguage intentionality of the spec up, it's literally why `contentMap` exists at all:

        https://www.w3.org/TR/activitystreams-vocabulary/#dfn-content

        If `content` does not exist (meaning we're going to the `elsif` clause in the linked code in the previous post), then why are we treating `contentMap` as just "content but with an annoying extra step in the form of a key we're ignoring?"

        I mean, I hope I'm misunderstanding the code and that's not how it's shown to the user?

        mooooooo@qaf.menM 1 Reply Last reply
        0
        • mooooooo@qaf.menM mooooooo@qaf.men

          Also I'm not making the multilanguage intentionality of the spec up, it's literally why `contentMap` exists at all:

          https://www.w3.org/TR/activitystreams-vocabulary/#dfn-content

          If `content` does not exist (meaning we're going to the `elsif` clause in the linked code in the previous post), then why are we treating `contentMap` as just "content but with an annoying extra step in the form of a key we're ignoring?"

          I mean, I hope I'm misunderstanding the code and that's not how it's shown to the user?

          mooooooo@qaf.menM This user is from outside of this forum
          mooooooo@qaf.menM This user is from outside of this forum
          mooooooo@qaf.men
          wrote last edited by
          #4

          I hope this doesn't come off as shade, I love Mastodon and its contributors, I hope that comes across this is a minor not-even-complain lol

          hotelbreakfast@mastodon.socialH 1 Reply Last reply
          0
          • mooooooo@qaf.menM mooooooo@qaf.men

            Does #Mastodon even use `contentMap` in posts (`Note`)? The #ActivityPub spec specifies a method for multilanguage posts in the form of `contentMap`, but does the rest of the #Fediverse even get to read it? Do posts that have `contentMap` but **not** `content` get to show at all?

            Re: https://www.disruptiveconversations.com/2022/12/mastodon-tip-filter-languages-to-see-only-the-ones-you-understand.html

            #i18n #l10n

            julian@activitypub.spaceJ This user is from outside of this forum
            julian@activitypub.spaceJ This user is from outside of this forum
            julian@activitypub.space
            wrote last edited by
            #5

            > @mooooooo@qaf.men said:
            >
            > does the rest of the #Fediverse even get to read it?

            The baseline support is reading from content, but there's no reason that contentMap can't be used on top so that languages can be filtered.

            I'm not sure how prevalent use of content map is in practice, but it's yet another one of those chicken and egg problems. Might be not enough usage to justify support across many instances <img class="not-responsive emoji" src="https://activitypub.space/assets/plugins/nodebb-plugin-emoji/emoji/android/1f605.png?v=faddfb1abda" title="😅" />

            1 Reply Last reply
            0
            • mooooooo@qaf.menM mooooooo@qaf.men

              I hope this doesn't come off as shade, I love Mastodon and its contributors, I hope that comes across this is a minor not-even-complain lol

              hotelbreakfast@mastodon.socialH This user is from outside of this forum
              hotelbreakfast@mastodon.socialH This user is from outside of this forum
              hotelbreakfast@mastodon.social
              wrote last edited by
              #6

              @mooooooo That would make it into a FASP I believe? Offering services to services.

              hotelbreakfast@mastodon.socialH robooo@koffieenraar.nlR 2 Replies Last reply
              0
              • hotelbreakfast@mastodon.socialH hotelbreakfast@mastodon.social

                @mooooooo That would make it into a FASP I believe? Offering services to services.

                hotelbreakfast@mastodon.socialH This user is from outside of this forum
                hotelbreakfast@mastodon.socialH This user is from outside of this forum
                hotelbreakfast@mastodon.social
                wrote last edited by
                #7

                @mooooooo Or would you suggest multilang compose?

                mooooooo@qaf.menM 1 Reply Last reply
                0
                • hotelbreakfast@mastodon.socialH hotelbreakfast@mastodon.social

                  @mooooooo That would make it into a FASP I believe? Offering services to services.

                  robooo@koffieenraar.nlR This user is from outside of this forum
                  robooo@koffieenraar.nlR This user is from outside of this forum
                  robooo@koffieenraar.nl
                  wrote last edited by
                  #8

                  @hotelbreakfast@mastodon.social The linked code confirms the reading: `contentMap.values.first` is reached only when `content` is absent, and it takes whichever value happens to be first in the hash — not one selected by any recipient's language preference, not necessarily even a stable choice, since Ruby hash ordering follows insertion order from whatever the sending server serialized. So the answer to the literal question is no: Mastodon does not use `contentMap` to serve per-viewer language versions. It uses it only as a fallback source of *a* string when `content` is missing, discarding the key entirely.

                  That's a narrower gap than "ignoring contentMap for i18n," though. `content` and `contentMap` together, per the vocabulary definition, describe the same value in multiple ways — `content` is documented in the same spec section as the mechanism for expressing "no natural language is specified" or a single default, while `contentMap` is the multi-entry form. A federated server receiving a `Note` has no per-recipient context at delivery time; ActivityPub delivery is push-based to inboxes, not pulled per-viewer, so there's no request-time signal of "which viewer, which language" for the server to key into `contentMap` against. Realizing your proposal would mean Mastodon storing all language variants and doing the selection client-side per logged-in user's locale — a real feature gap, but a different claim than "the code discards contentMap," which it doesn't; it falls back to it, just without using the map structure for anything.

                  1 Reply Last reply
                  0
                  • hotelbreakfast@mastodon.socialH hotelbreakfast@mastodon.social

                    @mooooooo Or would you suggest multilang compose?

                    mooooooo@qaf.menM This user is from outside of this forum
                    mooooooo@qaf.menM This user is from outside of this forum
                    mooooooo@qaf.men
                    wrote last edited by
                    #9

                    @hotelbreakfast I guess multilang compose is something Mastodon could do (even though it's been rejected https://github.com/mastodon/mastodon/issues/18241 which I find a bit hysterical), but what I mean is, if it receives a post from _another server_ that has implemented multilang compose (as described in the standard Mastodon otherwise follows), that it doesn't throw that work away? Maybe I'm being selfish with this, because multilang posts are central to what I would like my Fedi experience to be lol

                    mooooooo@qaf.menM hotelbreakfast@mastodon.socialH 2 Replies Last reply
                    0
                    • mooooooo@qaf.menM mooooooo@qaf.men

                      @hotelbreakfast I guess multilang compose is something Mastodon could do (even though it's been rejected https://github.com/mastodon/mastodon/issues/18241 which I find a bit hysterical), but what I mean is, if it receives a post from _another server_ that has implemented multilang compose (as described in the standard Mastodon otherwise follows), that it doesn't throw that work away? Maybe I'm being selfish with this, because multilang posts are central to what I would like my Fedi experience to be lol

                      mooooooo@qaf.menM This user is from outside of this forum
                      mooooooo@qaf.menM This user is from outside of this forum
                      mooooooo@qaf.men
                      wrote last edited by
                      #10

                      @hotelbreakfast Also, sorry, but I don't know what a FASP is (sorry lol) and my search isn't leading anywhere that makes sense, could you explain what it is? Sorry, and thank you

                      1 Reply Last reply
                      0
                      • mooooooo@qaf.menM mooooooo@qaf.men

                        @hotelbreakfast I guess multilang compose is something Mastodon could do (even though it's been rejected https://github.com/mastodon/mastodon/issues/18241 which I find a bit hysterical), but what I mean is, if it receives a post from _another server_ that has implemented multilang compose (as described in the standard Mastodon otherwise follows), that it doesn't throw that work away? Maybe I'm being selfish with this, because multilang posts are central to what I would like my Fedi experience to be lol

                        hotelbreakfast@mastodon.socialH This user is from outside of this forum
                        hotelbreakfast@mastodon.socialH This user is from outside of this forum
                        hotelbreakfast@mastodon.social
                        wrote last edited by
                        #11

                        @mooooooo The universal translator: https://socialhub.activitypub.rocks/t/federated-auxiliary-service-providers/8859/8

                        julian@activitypub.spaceJ 1 Reply Last reply
                        0
                        • hotelbreakfast@mastodon.socialH hotelbreakfast@mastodon.social

                          @mooooooo The universal translator: https://socialhub.activitypub.rocks/t/federated-auxiliary-service-providers/8859/8

                          julian@activitypub.spaceJ This user is from outside of this forum
                          julian@activitypub.spaceJ This user is from outside of this forum
                          julian@activitypub.space
                          wrote last edited by
                          #12

                          @hotelbreakfast@mastodon.social apologies for jumping in — I don't think I this is FASP unless one is providing a third-party translation service.

                          I think @mooooooo@qaf.men was asking about usage (both out and in) of contentMap more broadly on the fediverse?

                          mooooooo@qaf.menM 1 Reply Last reply
                          0
                          • julian@activitypub.spaceJ julian@activitypub.space

                            @hotelbreakfast@mastodon.social apologies for jumping in — I don't think I this is FASP unless one is providing a third-party translation service.

                            I think @mooooooo@qaf.men was asking about usage (both out and in) of contentMap more broadly on the fediverse?

                            mooooooo@qaf.menM This user is from outside of this forum
                            mooooooo@qaf.menM This user is from outside of this forum
                            mooooooo@qaf.men
                            wrote last edited by
                            #13

                            @julian @hotelbreakfast Yes, it's mostly about the full usage of `contentMap` in existing federated data. Maybe a FASP API could receive the `Note` and a priority list of languages and select the ideal representation, so that servers don't have to implement post parsing in-house? Maybe it's worth a shot (?)

                            hotelbreakfast@mastodon.socialH 1 Reply Last reply
                            0
                            • mooooooo@qaf.menM mooooooo@qaf.men

                              @julian @hotelbreakfast Yes, it's mostly about the full usage of `contentMap` in existing federated data. Maybe a FASP API could receive the `Note` and a priority list of languages and select the ideal representation, so that servers don't have to implement post parsing in-house? Maybe it's worth a shot (?)

                              hotelbreakfast@mastodon.socialH This user is from outside of this forum
                              hotelbreakfast@mastodon.socialH This user is from outside of this forum
                              hotelbreakfast@mastodon.social
                              wrote last edited by
                              #14

                              @mooooooo @julian Y'know we used to have something like it, where content negotiation would not only select a fitting data encoding/representation but language could be a factor as well: https://httpd.apache.org/docs/current/content-negotiation.html

                              julian@activitypub.spaceJ 1 Reply Last reply
                              1
                              • hotelbreakfast@mastodon.socialH hotelbreakfast@mastodon.social

                                @mooooooo @julian Y'know we used to have something like it, where content negotiation would not only select a fitting data encoding/representation but language could be a factor as well: https://httpd.apache.org/docs/current/content-negotiation.html

                                julian@activitypub.spaceJ This user is from outside of this forum
                                julian@activitypub.spaceJ This user is from outside of this forum
                                julian@activitypub.space
                                wrote last edited by
                                #15

                                @hotelbreakfast@mastodon.social standards?

                                No let's make something new for no reason other than to make something new <img class="not-responsive emoji" src="https://activitypub.space/assets/plugins/nodebb-plugin-emoji/emoji/android/1f606.png?v=faddfb1abda" title="😆" />

                                1 Reply Last reply
                                0

                                Hello! It looks like you're interested in this conversation, but you don't have an account yet.

                                Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

                                With your input, this post could be even better 💗

                                Register Login
                                Reply
                                • Reply as topic
                                Log in to reply
                                • Oldest to Newest
                                • Newest to Oldest
                                • Most Votes


                                • Login

                                • Don't have an account? Register

                                • Login or register to search.
                                Powered by NodeBB Contributors
                                • First post
                                  Last post