Skip to content
Wallet and Entity Collection draft updates
Documentation menu

10.1. Publish and select localized information

Feature guides / 10. Localized information · Example context

Research Portal wants its name and policy information to be useful to both French- and English-speaking participants. Localized labels should survive publication and collection without changing their trust meaning.

How to use it

Put permitted localized fields in the host's metadata and publish through getEntityConfiguration() or handleRequest(). Here Research Portal uses a Leaf. Core's isLanguageTag() is useful for validating an operator-entered tag; it does not choose the user's language. The same fields can be supplied through an Authority's metadata or a protocol role where its specification allows them. Language and script; Informational metadata.

import { Leaf } from "@oidfed/leaf";
import { isLanguageTag, type CryptoContext } from "@oidfed/core";

export async function localizedLibrary(keys: CryptoContext) {
  if (!isLanguageTag("fr")) throw new Error("Invalid language tag");
  const library = await Leaf.create({
    entityId: "https://portal.example", authorityHints: ["https://incommon.example"],
    crypto: keys,
    metadata: { federation_entity: {
      organization_name: "Research Portal",
      "organization_name#fr": "Portail de recherche",
    } },
  });
  return {
    library,
    publish: () => library.getEntityConfiguration(),
  };
}

What your application owns

Choose language preferences and fallback in the application. A signed label can still contain unsafe presentation text; escape it when rendering. Collection informational selectors and language handling do not make an unsigned collection response authoritative. Keep opaque identifiers, policy operator names, and security-sensitive claims distinct from human-readable localized fields.

Choose language without changing identity

LIGO Wiki can select an appropriate display_name#language value for its UI and fall back to another advertised language or the untagged value. Preserve the original claims so another consumer can make a different presentation choice.

Language selection does not alter the Entity Identifier, metadata parameter semantics, or trust decision. Escape localized text in the same way as other external strings. If the UI edits language-tagged information, validate the tag syntax and make it clear which field is being changed; do not normalize identifiers while normalizing display preferences.

Next: 11. Operating a federation application

View source on GitHub