Common "langs" type?

I am wondering if there is a lexicon type out there intended for folks to use in their own lexicons for i18n. Bluesky has their langs field. Others could emulate it, but there’s not much momentum or incentive to do so. If there were a well made internationalization type that I could use in my lexicons, it would be a lot easier for me to adopt that and for i18n behavior to be more consistent across lexicons.

For example, in this lex I have a langs field modeled after Bluesky’s approach.

{
  "lexicon": 1,
  "id": "community.lexicon.rating.prompt",
  "description": "A prompt or question that a rating answers, clarifying what aspect of a subject is being evaluated.",
  "defs": {
    "main": {
      "type": "record",
      "key": "tid",
      "record": {
        "type": "object",
        "required": ["text"],
        "properties": {
          "text": { "type": "string", "maxLength": 1024, "description": "The prompt or question text." },
          "langs": {
            "type": "array",
            "items": { "type": "string", "format": "language" },
            "maxItems": 3,
            "description": "BCP-47 tag(s) the prompt text is written in."
          },
          "createdAt": { "type": "string", "format": "datetime" }
        }
      }
    }
  }
}

But instead what if it just borrowed an existing type for language tagging.

{
  "lexicon": 1,
  "id": "community.lexicon.rating.prompt",
  "description": "A prompt or question that a rating answers, clarifying what aspect of a subject is being evaluated.",
  "defs": {
    "main": {
      "type": "record",
      "key": "tid",
      "record": {
        "type": "object",
        "required": ["text"],
        "properties": {
          "text": { "type": "string", "maxLength": 1024, "description": "The prompt or question text." },
          "langs": {
            "type": "ref", "ref": "some.i18n.thing",
          },
          "createdAt": { "type": "string", "format": "datetime" }
        }
      }
    }
  }
}

Thoughts? If I missed an existing topic on this my apologies.

6 Likes

Ahh, a way to offer translations of a given on-protocol string inside the record?

I know Scan/PaddingLabs was looking at building a translations app/lexicon, which would need a lexicon that represents translations, but they’d probably each have their own record.

I figure this would be a structure specifically for multi-lingual people, who want to be able to store different localisations of the same text on a supporting record. It seems fairly edge-case to me, though I’ve used the Bluesky pattern you mention in some lexicons.

I’ll take a look through my lexicon estate and see where something like this might be useful! :slight_smile:

2 Likes

Not even necessarily translations, but language tagging records so that they can be marked appropriately. Showing relevant content to people of different primary languages. Does also help for queuing browser and device translation.

1 Like

My guess is that having the convention of it being a top-level field named langs and having array-of-strings type is more important for reuse than having a declared lexicon schema to reference. For such a simple thing having a layer of indirection doesn’t feel worth it: easier for humans and machines to understand the lexicon-in-place than needing to go resolve the reference.

Generic app frameworks (like HappyView) could look for that data pattern, either in raw data or looking at the Lexicon schema.

(just my 2c)

1 Like

Just as a side note, there have been some issues filed for Bluesky because it uses (as far as I understood) ISO 639-1 with incomplete ISO 639-2 fallback.

I too prefer BCP 47 anyway though, since that’s vastly easier to use on the web and has better coverage. Its registry also looks very good to me in terms of being easy to process, for friendly naming in English UIs.
I think end users might be somewhat familiar with it too (or at least may recognise their own language and region tags) since they appear in URLs of localised sites quite often.

1 Like

hi!

I’ve a languages field in lichen wiki lexicon, I’m using BCP 47.

Felt like it was the best fit for lexicons as well.

1 Like

We talked about this topic in the BlamPow Discord a bit (though this isn’t a summary of that discussion, just my own two cents for the most part after being made aware of the issue):

It would be great to be able to explicitly indicate prominent language-agnostic or no-language content while localised content may also be present in the same presentation unit.

For example, if someone writes a post “Wow, endlich fertig!” and attaches a photo of their painting, or writes “So süß!” and a photo of a sleeping kitten, that crosses language borders quite easily, and most recipients hopefully wouldn’t care too much if they can’t read the caption right away. (That means calligraphy and graffiti may also be considered prominently language-agnostic if the author intends them to be, even if they consist of text carrying language.)

It would be helpful to reduce or ignore language filters in discovery in such cases. I’m aware this is tricky to do in general (so as not to create a “:rocket:”-button for reach that every spammer would press), but for example Feeds could indicate that they require weaker filters.
I’m thinking of e.g. For You or Popular with Friends-style Feeds, which already strongly filter by user group or proximity, respectively, or Mutuals (which in my opinion shouldn’t be language-filtered at all by default). A Feed like :fire:Hot Links on the other hand looks like it would want to at least default to strict language filters across the board.


Semi-relatedly: From a user perspective, I’d really like to be able to adjust the filter on the fly more easily. It would be great if that was unobtrusively surfaced in e.g. the Home/Feed view header(s) in Bluesky-compatible apps.