Skip to content

Conversation

@mattn
Copy link
Member

@mattn mattn commented Dec 13, 2025

This pull request proposes adding a new optional extra field called languages (plural, as an array) to kind 0 (user metadata) events in NIP-24.

The field is an array of strings following the IETF BCP 47 language tag format (e.g., ["en"], ["ja", "en-US"], ["es-AR", "fr", "en"]), indicating the author's preferred languages in order of preference (first element = primary).

Motivation

Nostr is a global protocol with diverse multilingual users. Many people are fluent in multiple languages and want to indicate support for more than one.

A single-language field is limiting for such users. Changing to an array:

  • Allows expressing multiple preferred languages with priority.
  • Enables clients to suggest relays matching any or the primary language.
  • Facilitates building and discovering language-specific or multilingual relays more effectively.
  • Improves content discovery, filtering, and community features in multilingual environments.

This enables new use cases, such as clients suggesting language-specific relays or building dedicated language-limited relays to improve content discovery and user experience in multilingual communities.
@mattn
Copy link
Member Author

mattn commented Dec 13, 2025

I'd like to change language to languages to accept list of language.

This commit updates the proposed `language` field to `languages` (plural) and changes it from a single string to an array of strings.

Reasons for the change:
- Many users are fluent in multiple languages and may want to indicate secondary languages they are comfortable with.
- An array allows expressing language preferences with priority (first element = primary language).
- Clients can use this to match users with relays supporting any of their preferred languages, not just one.
- It better supports multilingual communities, content filtering, translation features, and discovery of language-specific relays.

The field remains optional, and clients can continue to read only the first element for basic compatibility.

Example values:
- `["en"]` (English only)
- `["ja", "en"]` (Japanese primary, English secondary)
@mattn mattn changed the title NIP-24: Add optional 'language' field to kind 0 extra metadata NIP-24: Add optional 'languages' field to kind 0 extra metadata Dec 13, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant