Skip to content

Latest commit

 

History

History
29 lines (18 loc) · 1.05 KB

37.md

File metadata and controls

29 lines (18 loc) · 1.05 KB

NIP-37

Language Tag

draft optional author:alexgleason

A lang tag may be added to text events to indicate the language of the text. The value of the tag MUST be a valid ISO 639-1 language code.

For example:

["lang", "en"]

The language tag is a hint for automatic translations, as well as a tool for filtering by language. It is not a guarantee that the text is in the specified language. Some messages could contain text in multiple languages, text in a different language, or text in no language at all.

Client behavior

Clients may append a lang tag based on the user's selection at the time of the post, or based on a user setting. If the user has not selected a language, the client should omit the lang tag.

Relay behavior

Relays implementing this NIP should validate that the lang tag is a valid ISO 639-1 language code, and if so index the event so it can be requested with tag filters:

["REQ", <subscription_id>, {"#lang": ["en"]}]