-
Notifications
You must be signed in to change notification settings - Fork 632
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
NIP-37: Language Tag #632
NIP-37: Language Tag #632
Conversation
I think users can't be trusted to specify this tag correctly and all automatic translation tools will already detect the language automatically anyway. |
I basically just copied what Mastodon does since I'm implementing some equivalent features. But I figured automatic detection would be the main counterpoint to this. I think it would still be cool if relays indexed events by their language and let you filter them. |
I would suggest using NIP 32 for this use case. That would have the benefit of using single letter tags so language would be searchable, and allowing people to both mark their own notes and those of others (for example you could build a bot that publishes 1985 events based on language detection). |
NIP-32 actually seems like it wants a I'm not sure it makes more semantic sense to add |
I don't think there is a reliable way to implement this. On Amethyst, we could get the system language, the keyboard language or try to process it with the translator before signing. However, they are all faulty solutions. Users don't generally switch keyboards to write in other languages and the in-device language identifier is not that accurate for Nostr posts (short bursts of grammatically imprecise text with tons of "weirdness" like URLs, hashtags, and bech addresses). We could ask the user to specify in the new post screen, but it might be just annoying for the average user. On the flipside, I think this could go into a longer discussion on content tagging/rating by third parties. The same NIP that can allow an agency to mark events as PG-13 content, can also be used to specify the language and other attributes of the post. Users would then follow their preferred agency to get the type of content they like to see. |
The cool thing to do would be for relays to just automatically detect the language with fasttext, and then respond to queries for a particular language. @vitorpamplona This MR is about letting the user set the language manually the way Mastodon does it: I have mixed feelings about it. I'm creating a compatibility layer with Mastodon. At first I'm going to use this "lang" tag to decide whether to display a "translate post" button to the user. But a better solution will likely evolve. |
Relays can use that, other libs or also check NIP-32 labels if available to decide what is the language. #605 (NIP-17 Event Metadata) PR is exactly for this. Recently added here a way to filter by language. |
I am using a tag like this for the language: ["l", "en", "ISO-639-1"] |
I found various issues about language labeling and I'm still confused: do we have any standard way to specify language for event kind 1 right now?
Am I right that NIP-32 currently allows {
"kind": 1,
"tags": [
["L", "ISO-639-1"],
["l", "en", "ISO-639-1"]
],
"content": "English text",
...
} but it's not that we've decided that it's best way to do that (because some suggest I'd like to post in multiple languages from single account and give my followers possibility to filter out messages in languages they don't understand; ideally disallow them with mute list. Maybe even give them "Follow my English posts" and "Follow all my posts" buttons in a relevant page of a multilingual website. Does the NIP-51 mute list support the |
Yes your event looks fine. Yes we should have the example in NIP-32. |
Adds a
lang
tag for text events allowing users to specify their language.NIP text here: https://github.com/alexgleason/nips/blob/dcb38b6e2301e149a2d592d1880bd3a6a7492f03/37.md